Docs/Getting Started

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 installation
2pip install recall-memory
3
4# With all optional dependencies
5pip install recall-memory[all]
6
7# Specific extras
8pip install recall-memory[async] # Async support
9pip install recall-memory[monitoring] # Metrics and monitoring
10pip install recall-memory[dev] # Development tools
Bash
1# Add to your project
2poetry add recall-memory
3
4# With extras
5poetry add recall-memory[async,monitoring]
Bash
1# Add to Pipfile
2pipenv install recall-memory
3
4# With extras
5pipenv install recall-memory[all]

Node.js / TypeScript

Bash
1# Basic installation
2npm install @recall/client
3
4# With TypeScript types
5npm install @recall/client @types/node
Bash
1# Basic installation
2yarn add @recall/client
3
4# With TypeScript
5yarn add @recall/client @types/node
Bash
1# Basic installation
2pnpm add @recall/client
3
4# With TypeScript
5pnpm add @recall/client @types/node
Bash
1# Basic installation
2bun add @recall/client

Redis Setup

Local Development

Option 1: Docker (Recommended)

Bash
1# Run Redis with persistence
2docker run -d \
3 --name recall-redis \
4 -p 6379:6379 \
5 -v redis-data:/data \
6 redis:7-alpine \
7 redis-server --appendonly yes
8
9# Verify connection
10docker exec -it recall-redis redis-cli ping
11# Should return: PONG

Option 2: Direct Installation

Bash
1# Install
2brew install redis
3
4# Start service
5brew services start redis
6
7# Or run in foreground
8redis-server
Bash
1# Install
2sudo apt update
3sudo apt install redis-server
4
5# Start service
6sudo systemctl start redis-server
7sudo systemctl enable redis-server
8
9# Verify
10redis-cli ping
Bash
1# Install
2sudo yum install epel-release
3sudo yum install redis
4
5# Start service
6sudo systemctl start redis
7sudo systemctl enable redis
8
9# Verify
10redis-cli ping
Bash
1# Using WSL2 (recommended)
2wsl --install
3# Then follow Ubuntu instructions
4
5# Or use Redis Windows port
6# 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 SSL
2client = 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 connection
2client = RecallClient(
3 redis_url="redis://10.x.x.x:6379",
4 redis_options={
5 "decode_responses": True,
6 "socket_keepalive": True
7 }
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 file
2MEM0_API_KEY=m0-xxxxxxxxxxxxxxxxxxxx
3
4# Or export directly
5export MEM0_API_KEY="m0-xxxxxxxxxxxxxxxxxxxx"
Python
1# Direct configuration
2client = RecallClient(
3 mem0_api_key="m0-xxxxxxxxxxxxxxxxxxxx"
4)
5
6# From environment
7import os
8client = RecallClient(
9 mem0_api_key=os.getenv("MEM0_API_KEY")
10)
TypeScript
1// Direct configuration
2const client = new RecallClient({
3 mem0ApiKey: "m0-xxxxxxxxxxxxxxxxxxxx",
4});
5
6// From environment
7const client = new RecallClient({
8 mem0ApiKey: process.env.MEM0_API_KEY,
9});

Configuration

Basic Configuration

Python
1from recall import RecallClient
2
3client = RecallClient(
4 # Required
5 redis_url="redis://localhost:6379",
6 mem0_api_key="your-api-key",
7
8 # Optional
9 environment="production",
10 app_name="my-app",
11 cache_ttl=3600, # 1 hour
12 max_retries=3,
13 timeout=30
14)
TypeScript
1import { RecallClient } from "@recall/client";
2
3const client = new RecallClient({
4 // Required
5 redisUrl: "redis://localhost:6379",
6 mem0ApiKey: "your-api-key",
7
8 // Optional
9 environment: "production",
10 appName: "my-app",
11 cacheTtl: 3600, // 1 hour
12 maxRetries: 3,
13 timeout: 30,
14});
YAML
1# recall.config.yaml
2redis:
3 url: redis://localhost:6379
4 max_connections: 50
5
6mem0:
7 api_key: ${MEM0_API_KEY}
8 base_url: https://api.mem0.ai
9
10cache:
11 ttl: 3600
12 max_size: 1000
13 eviction_policy: lru
14
15monitoring:
16 enabled: true
17 metrics_port: 9090

Advanced Configuration

Python
1from recall import RecallClient, CacheConfig, SyncConfig
2
3client = RecallClient(
4 redis_url="redis://localhost:6379",
5 mem0_api_key="your-api-key",
6
7 # Cache configuration
8 cache_config=CacheConfig(
9 ttl={
10 "critical": None, # Never expire
11 "high": 86400, # 24 hours
12 "medium": 3600, # 1 hour
13 "low": 300 # 5 minutes
14 },
15 max_memory="1gb",
16 eviction_policy="allkeys-lru",
17 compression=True
18 ),
19
20 # Sync configuration
21 sync_config=SyncConfig(
22 mode="lazy", # lazy, eager, or manual
23 batch_size=100,
24 interval=60, # seconds
25 retry_policy="exponential"
26 ),
27
28 # Connection pools
29 redis_pool_size=20,
30 mem0_pool_size=10,
31
32 # Performance
33 enable_pipelining=True,
34 enable_clustering=False
35)
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 configuration
8 cacheConfig: {
9 ttl: {
10 critical: null, // Never expire
11 high: 86400, // 24 hours
12 medium: 3600, // 1 hour
13 low: 300, // 5 minutes
14 },
15 maxMemory: "1gb",
16 evictionPolicy: "allkeys-lru",
17 compression: true,
18 },
19
20 // Sync configuration
21 syncConfig: {
22 mode: "lazy", // lazy, eager, or manual
23 batchSize: 100,
24 interval: 60, // seconds
25 retryPolicy: "exponential",
26 },
27
28 // Connection pools
29 redisPoolSize: 20,
30 mem0PoolSize: 10,
31
32 // Performance
33 enablePipelining: true,
34 enableClustering: false,
35});

Docker Deployment

Using Docker Compose

YAML
1# docker-compose.yml
2version: "3.8"
3
4services:
5 redis:
6 image: redis:7-alpine
7 command: redis-server --appendonly yes
8 volumes:
9 - redis-data:/data
10 ports:
11 - "6379:6379"
12 healthcheck:
13 test: ["CMD", "redis-cli", "ping"]
14 interval: 5s
15 timeout: 3s
16 retries: 5
17
18 app:
19 build: .
20 environment:
21 - REDIS_URL=redis://redis:6379
22 - MEM0_API_KEY=${MEM0_API_KEY}
23 - RECALL_ENV=production
24 depends_on:
25 redis:
26 condition: service_healthy
27 ports:
28 - "8000:8000"
29
30volumes:
31 redis-data:

Dockerfile Example

DOCKERFILE
1# Python application
2FROM python:3.11-slim
3
4WORKDIR /app
5
6# Install dependencies
7COPY requirements.txt .
8RUN pip install --no-cache-dir -r requirements.txt
9
10# Copy application
11COPY . .
12
13# Health check
14HEALTHCHECK --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 repository
2helm repo add recall https://charts.recall.ai
3helm repo update
4
5# Install with custom values
6helm 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.yaml
2apiVersion: apps/v1
3kind: Deployment
4metadata:
5 name: recall-app
6spec:
7 replicas: 3
8 selector:
9 matchLabels:
10 app: recall
11 template:
12 metadata:
13 labels:
14 app: recall
15 spec:
16 containers:
17 - name: recall
18 image: recall/app:latest
19 env:
20 - name: REDIS_URL
21 value: "redis://redis-service:6379"
22 - name: MEM0_API_KEY
23 valueFrom:
24 secretKeyRef:
25 name: recall-secrets
26 key: mem0-api-key
27 resources:
28 requests:
29 memory: "256Mi"
30 cpu: "100m"
31 limits:
32 memory: "512Mi"
33 cpu: "500m"
34 livenessProbe:
35 httpGet:
36 path: /health
37 port: 8000
38 initialDelaySeconds: 30
39 periodSeconds: 10

Verification

Health Check

Python
1# Verify installation
2from recall import RecallClient
3
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 installation
2import { 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 tool
2recall health
3
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:

IssueSolution
Redis connection refusedEnsure Redis is running and accessible
Invalid Mem0 API keyVerify key in Mem0 dashboard
High latencyCheck Redis memory usage and network
Cache missesReview priority levels and TTL settings

Next Steps