Installation
Install the Rekall SDK for your language, configure environment variables, and verify your setup. Rekall supports TypeScript, Python, Go, and direct REST API access.
SDK Installation
Rekall provides first-class SDKs for the most popular languages. Each SDK includes typed interfaces, automatic retries, and built-in support for all 7 memory types.
TypeScript
The @rekall/agent-sdk package is the full-featured agent SDK with type-safe memory operations, semantic search, and agent lifecycle management. It requires Node.js 18 or later.
npm install @rekall/agent-sdk
Verify the installation:
npx rekall --version# => @rekall/agent-sdk v1.x.x
Python
The rekall-agent-sdk package supports Python 3.9+ and includes both synchronous and async interfaces. It works with any Python AI framework including LangChain, LlamaIndex, and CrewAI.
pip install rekall-agent-sdk
Verify the installation:
python -c "import rekall; print(rekall.__version__)"# => 1.x.x
Go
The Go SDK provides idiomatic Go interfaces with context support, structured errors, and efficient connection pooling. Requires Go 1.21 or later.
go get github.com/rekall-ai/rekall-agent-sdk
Import it in your code:
import (rekall "github.com/rekall-ai/rekall-agent-sdk")func main() {client, err := rekall.NewClient(rekall.WithAPIKey(os.Getenv("REKALL_API_KEY")),)if err != nil {log.Fatal(err)}defer client.Close()}
Lightweight REST Client
If you do not need the full agent SDK features (lifecycle management, automatic consolidation, local caching), the @rekall/client package provides a thin, typed wrapper around the REST API with minimal dependencies.
npm install @rekall/client
import { Rekall } from '@rekall/client';const client = new Rekall({apiKey: process.env.REKALL_API_KEY,});// Same API, lighter footprintconst memory = await client.memories.create({type: 'episodic',content: 'User prefers dark mode interfaces.',});
Which package should I use?
Use @rekall/agent-sdk if you are building an AI agent that needs memory management, execution state, and automatic consolidation. Use @rekall/client if you just need to read and write memories from a backend service or script.
Docker Setup
For self-hosted deployments or local development, Rekall provides official Docker images. The Docker setup includes the API server, PostgreSQL, Redis, Qdrant for vector search, and Neo4j for the semantic knowledge graph.
1version: '3.8'23services:4 rekall-api:5 image: ghcr.io/rekall-ai/rekall-server:latest6 ports:7 - "8080:8080"8 environment:9 - DATABASE_URL=postgresql://rekall:rekall@postgres:5432/rekall10 - REDIS_URL=redis://redis:637911 - QDRANT_URL=http://qdrant:633312 - NEO4J_URI=bolt://neo4j:768713 - NEO4J_USER=neo4j14 - NEO4J_PASSWORD=your_neo4j_password15 - GRAPHITI_ENABLED=true16 - REKALL_API_KEY=rk_your_api_key_here17 depends_on:18 - postgres19 - redis20 - qdrant21 - neo4j2223 postgres:24 image: postgres:1625 environment:26 - POSTGRES_USER=rekall27 - POSTGRES_PASSWORD=rekall28 - POSTGRES_DB=rekall29 volumes:30 - pgdata:/var/lib/postgresql/data31 ports:32 - "5432:5432"3334 redis:35 image: redis:7-alpine36 ports:37 - "6379:6379"3839 qdrant:40 image: qdrant/qdrant:latest41 ports:42 - "6333:6333"43 volumes:44 - qdrant_data:/qdrant/storage4546 neo4j:47 image: neo4j:5.15.0-community48 environment:49 - NEO4J_AUTH=neo4j/your_neo4j_password50 - NEO4J_PLUGINS=["apoc"]51 ports:52 - "7474:7474"53 - "7687:7687"54 volumes:55 - neo4j_data:/data5657volumes:58 pgdata:59 qdrant_data:60 neo4j_data:
Start the services:
docker compose up -d# Check that all services are runningdocker compose ps# View logsdocker compose logs -f rekall-api
Production deployments
The Docker Compose configuration above is intended for local development. For production, use managed PostgreSQL, managed Qdrant (or Qdrant Cloud), configure TLS, set strong passwords, and use a secrets manager for API keys. See the self-hosting guide for production recommendations.
Environment Variables
Configure Rekall using these environment variables. Only REKALL_API_KEY is required; all others have sensible defaults.
| Variable | Required | Default | Description |
|---|---|---|---|
REKALL_API_KEY | Yes | -- | Your API key, prefixed with rk_ |
REKALL_BASE_URL | No | https://api.rekall.ai/v1 | API base URL. Override for self-hosted or staging. |
REKALL_TIMEOUT | No | 30000 | Request timeout in milliseconds. |
REKALL_MAX_RETRIES | No | 3 | Maximum number of automatic retries on failure. |
REKALL_LOG_LEVEL | No | warn | Log level: debug, info, warn, error. |
Example .env file:
REKALL_API_KEY=rk_live_abc123def456ghi789REKALL_BASE_URL=https://api.rekall.ai/v1REKALL_TIMEOUT=30000REKALL_MAX_RETRIES=3REKALL_LOG_LEVEL=info
Do not commit .env files
Add .env to your .gitignore file. For production deployments, use your platform's secrets management (e.g., AWS Secrets Manager, Vault, or Vercel Environment Variables).
Health Check
The Rekall API exposes a health check endpoint that does not require authentication. Use it to verify connectivity and check the API version.
const health = await rekall.health();console.log(health);// => { status: 'ok', version: '1.4.2', uptime: 86400 }
A 200 OK response with "status": "ok" confirms the API is running and accessible. For self-hosted setups, this also verifies that the database and Redis connections are healthy.
Verification
Run this end-to-end verification script to confirm everything is configured correctly. It checks authentication, creates a test memory, searches for it, and cleans up.
import { RekallClient } from '@rekall/agent-sdk';async function verify() {const rekall = new RekallClient({apiKey: process.env.REKALL_API_KEY,});// 1. Health checkconst health = await rekall.health();console.log('Health:', health.status); // => ok// 2. Create a test memoryconst memory = await rekall.memories.create({type: 'episodic',content: 'Rekall installation verification test.',metadata: { test: true },});console.log('Created:', memory.id);// 3. Search for itconst results = await rekall.memories.search({query: 'installation verification',limit: 1,});console.log('Found:', results.length, 'result(s)');// 4. Clean upawait rekall.memories.delete(memory.id);console.log('Deleted test memory.');console.log('\nVerification complete! Rekall is ready to use.');}verify().catch(console.error);
Troubleshooting
If verification fails, check the following: (1) Your API key starts with rk_ and is not expired. (2) Your network can reach api.rekall.ai on port 443. (3) For self-hosted setups, ensure REKALL_BASE_URL points to the correct host and port.
