Installation
Complete setup guide for Recall in different environments and configurations.
System Requirements
Minimum Requirements
- Python: 3.8+ or Node.js: 16+
- Redis: 6.0+ (or Redis-compatible service)
- Memory: 512MB RAM minimum
- Storage: 100MB for cache data
Recommended Requirements
- Python: 3.10+ or Node.js: 18+
- Redis: 7.0+ with persistence enabled
- Memory: 2GB+ RAM for production
- Storage: SSD with 10GB+ for optimal cache performance
Package Installation
Python
bash# Basic installationpip install recall-memory# With all optional dependenciespip install recall-memory[all]# Specific extraspip install recall-memory[async] # Async supportpip install recall-memory[monitoring] # Metrics and monitoringpip install recall-memory[dev] # Development tools
bash# Add to your projectpoetry add recall-memory# With extraspoetry add recall-memory[async,monitoring]
bash# Add to Pipfilepipenv install recall-memory# With extraspipenv install recall-memory[all]
Node.js / TypeScript
bash# Basic installationnpm install @recall/client# With TypeScript typesnpm install @recall/client @types/node
bash# Basic installationyarn add @recall/client# With TypeScriptyarn add @recall/client @types/node
bash# Basic installationpnpm add @recall/client# With TypeScriptpnpm add @recall/client @types/node
bash# Basic installationbun add @recall/client
Redis Setup
Local Development
Option 1: Docker (Recommended)
bash# Run Redis with persistencedocker run -d \--name recall-redis \-p 6379:6379 \-v redis-data:/data \redis:7-alpine \redis-server --appendonly yes# Verify connectiondocker exec -it recall-redis redis-cli ping# Should return: PONG
Option 2: Direct Installation
bash# Installbrew install redis# Start servicebrew services start redis# Or run in foregroundredis-server
bash# Installsudo apt updatesudo apt install redis-server# Start servicesudo systemctl start redis-serversudo systemctl enable redis-server# Verifyredis-cli ping
bash# Installsudo yum install epel-releasesudo yum install redis# Start servicesudo systemctl start redissudo systemctl enable redis# Verifyredis-cli ping
bash# Using WSL2 (recommended)wsl --install# Then follow Ubuntu instructions# Or use Redis Windows port# Download from: https://github.com/microsoftarchive/redis/releases
Cloud Redis Services
Redis Cloud (Recommended for Production)
- Sign up at Redis Cloud
- Create a new database
- Copy the connection string
envREDIS_URL=redis://default:password@your-endpoint.redis.io:port
AWS ElastiCache
python# Connection with SSLclient = RecallClient(redis_url="rediss://your-cluster.cache.amazonaws.com:6379",redis_options={"ssl_cert_reqs": "required","ssl_ca_certs": "/path/to/ca-cert.pem"})
Google Cloud Memorystore
python# VPC connectionclient = RecallClient(redis_url="redis://10.x.x.x:6379",redis_options={"decode_responses": True,"socket_keepalive": True})
Mem0 Setup
Getting an API Key
- Visit mem0.ai
- Sign up for a free account
- Navigate to API Keys in your dashboard
- Create a new API key
- Copy and secure your key
API Key Configuration
bash# .env fileMEM0_API_KEY=m0-xxxxxxxxxxxxxxxxxxxx# Or export directlyexport MEM0_API_KEY="m0-xxxxxxxxxxxxxxxxxxxx"
python# Direct configurationclient = RecallClient(mem0_api_key="m0-xxxxxxxxxxxxxxxxxxxx")# From environmentimport osclient = RecallClient(mem0_api_key=os.getenv("MEM0_API_KEY"))
typescript// Direct configurationconst client = new RecallClient({mem0ApiKey: "m0-xxxxxxxxxxxxxxxxxxxx",});// From environmentconst client = new RecallClient({mem0ApiKey: process.env.MEM0_API_KEY,});
Configuration
Basic Configuration
pythonfrom recall import RecallClientclient = RecallClient(# Requiredredis_url="redis://localhost:6379",mem0_api_key="your-api-key",# Optionalenvironment="production",app_name="my-app",cache_ttl=3600, # 1 hourmax_retries=3,timeout=30)
typescriptimport { RecallClient } from "@recall/client";const client = new RecallClient({// RequiredredisUrl: "redis://localhost:6379",mem0ApiKey: "your-api-key",// Optionalenvironment: "production",appName: "my-app",cacheTtl: 3600, // 1 hourmaxRetries: 3,timeout: 30,});
yaml# recall.config.yamlredis:url: redis://localhost:6379max_connections: 50mem0:api_key: ${MEM0_API_KEY}base_url: https://api.mem0.aicache:ttl: 3600max_size: 1000eviction_policy: lrumonitoring:enabled: truemetrics_port: 9090
Advanced Configuration
pythonfrom recall import RecallClient, CacheConfig, SyncConfigclient = RecallClient(redis_url="redis://localhost:6379",mem0_api_key="your-api-key",# Cache configurationcache_config=CacheConfig(ttl={"critical": None, # Never expire"high": 86400, # 24 hours"medium": 3600, # 1 hour"low": 300 # 5 minutes},max_memory="1gb",eviction_policy="allkeys-lru",compression=True),# Sync configurationsync_config=SyncConfig(mode="lazy", # lazy, eager, or manualbatch_size=100,interval=60, # secondsretry_policy="exponential"),# Connection poolsredis_pool_size=20,mem0_pool_size=10,# Performanceenable_pipelining=True,enable_clustering=False)
typescriptimport { RecallClient, CacheConfig, SyncConfig } from "@recall/client";const client = new RecallClient({redisUrl: "redis://localhost:6379",mem0ApiKey: "your-api-key",// Cache configurationcacheConfig: {ttl: {critical: null, // Never expirehigh: 86400, // 24 hoursmedium: 3600, // 1 hourlow: 300, // 5 minutes},maxMemory: "1gb",evictionPolicy: "allkeys-lru",compression: true,},// Sync configurationsyncConfig: {mode: "lazy", // lazy, eager, or manualbatchSize: 100,interval: 60, // secondsretryPolicy: "exponential",},// Connection poolsredisPoolSize: 20,mem0PoolSize: 10,// PerformanceenablePipelining: true,enableClustering: false,});
Docker Deployment
Using Docker Compose
yaml# docker-compose.ymlversion: "3.8"services:redis:image: redis:7-alpinecommand: redis-server --appendonly yesvolumes:- redis-data:/dataports:- "6379:6379"healthcheck:test: ["CMD", "redis-cli", "ping"]interval: 5stimeout: 3sretries: 5app:build: .environment:- REDIS_URL=redis://redis:6379- MEM0_API_KEY=${MEM0_API_KEY}- RECALL_ENV=productiondepends_on:redis:condition: service_healthyports:- "8000:8000"volumes:redis-data:
Dockerfile Example
dockerfile# Python applicationFROM python:3.11-slimWORKDIR /app# Install dependenciesCOPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt# Copy applicationCOPY . .# Health checkHEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \CMD python -c "from recall import RecallClient; RecallClient().health_check()"CMD ["python", "app.py"]
Kubernetes Deployment
Helm Chart
bash# Add Recall Helm repositoryhelm repo add recall https://charts.recall.aihelm repo update# Install with custom valueshelm install my-recall recall/recall \--set redis.enabled=true \--set mem0.apiKey=$MEM0_API_KEY \--set ingress.enabled=true \--set ingress.host=recall.example.com
Manual Kubernetes Configuration
yaml# recall-deployment.yamlapiVersion: apps/v1kind: Deploymentmetadata:name: recall-appspec:replicas: 3selector:matchLabels:app: recalltemplate:metadata:labels:app: recallspec:containers:- name: recallimage: recall/app:latestenv:- name: REDIS_URLvalue: "redis://redis-service:6379"- name: MEM0_API_KEYvalueFrom:secretKeyRef:name: recall-secretskey: mem0-api-keyresources:requests:memory: "256Mi"cpu: "100m"limits:memory: "512Mi"cpu: "500m"livenessProbe:httpGet:path: /healthport: 8000initialDelaySeconds: 30periodSeconds: 10
Verification
Health Check
python# Verify installationfrom recall import RecallClientclient = RecallClient()health = client.health_check()print(f"Status: {health['status']}")print(f"Redis: {health['redis']['status']}")print(f"Mem0: {health['mem0']['status']}")print(f"Cache Size: {health['cache']['size']}")print(f"Version: {health['version']}")
typescript// Verify installationimport { RecallClient } from "@recall/client";const client = new RecallClient();const health = await client.healthCheck();console.log(`Status: ${health.status}`);console.log(`Redis: ${health.redis.status}`);console.log(`Mem0: ${health.mem0.status}`);console.log(`Cache Size: ${health.cache.size}`);console.log(`Version: ${health.version}`);
bash# Using the CLI toolrecall health# Output:# ✓ Redis: Connected (localhost:6379)# ✓ Mem0: Connected (api.mem0.ai)# ✓ Cache: 1,234 items (45.6 MB)# ✓ Version: 1.0.0
Troubleshooting
Common issues and solutions:
| Issue | Solution |
|---|---|
| Redis connection refused | Ensure Redis is running and accessible |
| Invalid Mem0 API key | Verify key in Mem0 dashboard |
| High latency | Check Redis memory usage and network |
| Cache misses | Review priority levels and TTL settings |
Next Steps
- Configure monitoring and metrics
- Set up logging and debugging
- Review security best practices
- Explore advanced features