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
1# Basic installation2pip install recall-memory3
4# With all optional dependencies5pip install recall-memory[all]6
7# Specific extras8pip install recall-memory[async] # Async support9pip install recall-memory[monitoring] # Metrics and monitoring10pip install recall-memory[dev] # Development tools
Bash
1# Add to your project2poetry add recall-memory3
4# With extras5poetry add recall-memory[async,monitoring]
Bash
1# Add to Pipfile2pipenv install recall-memory3
4# With extras5pipenv install recall-memory[all]
Node.js / TypeScript
Bash
1# Basic installation2npm install @recall/client3
4# With TypeScript types5npm install @recall/client @types/node
Bash
1# Basic installation2yarn add @recall/client3
4# With TypeScript5yarn add @recall/client @types/node
Bash
1# Basic installation2pnpm add @recall/client3
4# With TypeScript5pnpm add @recall/client @types/node
Bash
1# Basic installation2bun add @recall/client
Redis Setup
Local Development
Option 1: Docker (Recommended)
Bash
1# Run Redis with persistence2docker run -d \3 --name recall-redis \4 -p 6379:6379 \5 -v redis-data:/data \6 redis:7-alpine \7 redis-server --appendonly yes8
9# Verify connection10docker exec -it recall-redis redis-cli ping11# Should return: PONG
Option 2: Direct Installation
Bash
1# Install2brew install redis3
4# Start service5brew services start redis6
7# Or run in foreground8redis-server
Bash
1# Install2sudo apt update3sudo apt install redis-server4
5# Start service6sudo systemctl start redis-server7sudo systemctl enable redis-server8
9# Verify10redis-cli ping
Bash
1# Install2sudo yum install epel-release3sudo yum install redis4
5# Start service6sudo systemctl start redis7sudo systemctl enable redis8
9# Verify10redis-cli ping
Bash
1# Using WSL2 (recommended)2wsl --install3# Then follow Ubuntu instructions4
5# Or use Redis Windows port6# 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
ENV
1REDIS_URL=redis://default:password@your-endpoint.redis.io:port
AWS ElastiCache
Python
1# Connection with SSL2client = RecallClient(3 redis_url="rediss://your-cluster.cache.amazonaws.com:6379",4 redis_options={5 "ssl_cert_reqs": "required",6 "ssl_ca_certs": "/path/to/ca-cert.pem"7 }8)
Google Cloud Memorystore
Python
1# VPC connection2client = RecallClient(3 redis_url="redis://10.x.x.x:6379",4 redis_options={5 "decode_responses": True,6 "socket_keepalive": True7 }8)
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
1# .env file2MEM0_API_KEY=m0-xxxxxxxxxxxxxxxxxxxx3
4# Or export directly5export MEM0_API_KEY="m0-xxxxxxxxxxxxxxxxxxxx"
Python
1# Direct configuration2client = RecallClient(3 mem0_api_key="m0-xxxxxxxxxxxxxxxxxxxx"4)5
6# From environment7import os8client = RecallClient(9 mem0_api_key=os.getenv("MEM0_API_KEY")10)
TypeScript
1// Direct configuration2const client = new RecallClient({3 mem0ApiKey: "m0-xxxxxxxxxxxxxxxxxxxx",4});5
6// From environment7const client = new RecallClient({8 mem0ApiKey: process.env.MEM0_API_KEY,9});
Configuration
Basic Configuration
Python
1from recall import RecallClient2
3client = RecallClient(4 # Required5 redis_url="redis://localhost:6379",6 mem0_api_key="your-api-key",7
8 # Optional9 environment="production",10 app_name="my-app",11 cache_ttl=3600, # 1 hour12 max_retries=3,13 timeout=3014)
TypeScript
1import { RecallClient } from "@recall/client";2
3const client = new RecallClient({4 // Required5 redisUrl: "redis://localhost:6379",6 mem0ApiKey: "your-api-key",7
8 // Optional9 environment: "production",10 appName: "my-app",11 cacheTtl: 3600, // 1 hour12 maxRetries: 3,13 timeout: 30,14});
YAML
1# recall.config.yaml2redis:3 url: redis://localhost:63794 max_connections: 505
6mem0:7 api_key: ${MEM0_API_KEY}8 base_url: https://api.mem0.ai9
10cache:11 ttl: 360012 max_size: 100013 eviction_policy: lru14
15monitoring:16 enabled: true17 metrics_port: 9090
Advanced Configuration
Python
1from recall import RecallClient, CacheConfig, SyncConfig2
3client = RecallClient(4 redis_url="redis://localhost:6379",5 mem0_api_key="your-api-key",6
7 # Cache configuration8 cache_config=CacheConfig(9 ttl={10 "critical": None, # Never expire11 "high": 86400, # 24 hours12 "medium": 3600, # 1 hour13 "low": 300 # 5 minutes14 },15 max_memory="1gb",16 eviction_policy="allkeys-lru",17 compression=True18 ),19
20 # Sync configuration21 sync_config=SyncConfig(22 mode="lazy", # lazy, eager, or manual23 batch_size=100,24 interval=60, # seconds25 retry_policy="exponential"26 ),27
28 # Connection pools29 redis_pool_size=20,30 mem0_pool_size=10,31
32 # Performance33 enable_pipelining=True,34 enable_clustering=False35)
TypeScript
1import { RecallClient, CacheConfig, SyncConfig } from "@recall/client";2
3const client = new RecallClient({4 redisUrl: "redis://localhost:6379",5 mem0ApiKey: "your-api-key",6
7 // Cache configuration8 cacheConfig: {9 ttl: {10 critical: null, // Never expire11 high: 86400, // 24 hours12 medium: 3600, // 1 hour13 low: 300, // 5 minutes14 },15 maxMemory: "1gb",16 evictionPolicy: "allkeys-lru",17 compression: true,18 },19
20 // Sync configuration21 syncConfig: {22 mode: "lazy", // lazy, eager, or manual23 batchSize: 100,24 interval: 60, // seconds25 retryPolicy: "exponential",26 },27
28 // Connection pools29 redisPoolSize: 20,30 mem0PoolSize: 10,31
32 // Performance33 enablePipelining: true,34 enableClustering: false,35});
Docker Deployment
Using Docker Compose
YAML
1# docker-compose.yml2version: "3.8"3
4services:5 redis:6 image: redis:7-alpine7 command: redis-server --appendonly yes8 volumes:9 - redis-data:/data10 ports:11 - "6379:6379"12 healthcheck:13 test: ["CMD", "redis-cli", "ping"]14 interval: 5s15 timeout: 3s16 retries: 517
18 app:19 build: .20 environment:21 - REDIS_URL=redis://redis:637922 - MEM0_API_KEY=${MEM0_API_KEY}23 - RECALL_ENV=production24 depends_on:25 redis:26 condition: service_healthy27 ports:28 - "8000:8000"29
30volumes:31 redis-data:
Dockerfile Example
DOCKERFILE
1# Python application2FROM python:3.11-slim3
4WORKDIR /app5
6# Install dependencies7COPY requirements.txt .8RUN pip install --no-cache-dir -r requirements.txt9
10# Copy application11COPY . .12
13# Health check14HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \15 CMD python -c "from recall import RecallClient; RecallClient().health_check()"16
17CMD ["python", "app.py"]
Kubernetes Deployment
Helm Chart
Bash
1# Add Recall Helm repository2helm repo add recall https://charts.recall.ai3helm repo update4
5# Install with custom values6helm install my-recall recall/recall \7 --set redis.enabled=true \8 --set mem0.apiKey=$MEM0_API_KEY \9 --set ingress.enabled=true \10 --set ingress.host=recall.example.com
Manual Kubernetes Configuration
YAML
1# recall-deployment.yaml2apiVersion: apps/v13kind: Deployment4metadata:5 name: recall-app6spec:7 replicas: 38 selector:9 matchLabels:10 app: recall11 template:12 metadata:13 labels:14 app: recall15 spec:16 containers:17 - name: recall18 image: recall/app:latest19 env:20 - name: REDIS_URL21 value: "redis://redis-service:6379"22 - name: MEM0_API_KEY23 valueFrom:24 secretKeyRef:25 name: recall-secrets26 key: mem0-api-key27 resources:28 requests:29 memory: "256Mi"30 cpu: "100m"31 limits:32 memory: "512Mi"33 cpu: "500m"34 livenessProbe:35 httpGet:36 path: /health37 port: 800038 initialDelaySeconds: 3039 periodSeconds: 10
Verification
Health Check
Python
1# Verify installation2from recall import RecallClient3
4client = RecallClient()5health = client.health_check()6
7print(f"Status: {health['status']}")8print(f"Redis: {health['redis']['status']}")9print(f"Mem0: {health['mem0']['status']}")10print(f"Cache Size: {health['cache']['size']}")11print(f"Version: {health['version']}")
TypeScript
1// Verify installation2import { RecallClient } from "@recall/client";3
4const client = new RecallClient();5const health = await client.healthCheck();6
7console.log(`Status: ${health.status}`);8console.log(`Redis: ${health.redis.status}`);9console.log(`Mem0: ${health.mem0.status}`);10console.log(`Cache Size: ${health.cache.size}`);11console.log(`Version: ${health.version}`);
Bash
1# Using the CLI tool2recall health3
4# Output:5# ✓ Redis: Connected (localhost:6379)6# ✓ Mem0: Connected (api.mem0.ai)7# ✓ Cache: 1,234 items (45.6 MB)8# ✓ 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