Introduction to r3
r3 is an open-source local Redis memory MCP server that gives AI assistants persistent memory. Install with npx @n3wth/r3 to add context that survives across sessions.
What is r3?
r3 is an open-source MCP server designed specifically for AI applications, particularly Large Language Models (LLMs) and agents. It provides a local memory layer that combines:
- Embedded Redis for lightning-fast memory retrieval (sub-millisecond response times)
- Local vector search for semantic memory queries
- Knowledge graphs for automatic entity extraction and relationship mapping
- Optional cloud sync via Mem0 for persistence across machines
Key Features
Open Source and Local-First
r3 runs entirely on your machine with zero external dependencies. No API keys required to get started.
Embedded Redis
Automatically starts an embedded Redis server for fast local caching. No separate Redis installation needed.
Simple Integration
Works with Antigravity CLI. One command to install: npx @n3wth/r3.
AI Intelligence Built-In
Real vector embeddings, entity extraction, and knowledge graphs all running locally.
Why r3?
The Problem
Traditional AI memory systems force you to choose between:
- Speed: Local storage is fast but volatile and doesn't scale
- Persistence: Cloud storage is reliable but adds latency
- Privacy: Cloud solutions require sending your data to third parties
The Solution
r3 provides an open-source, local-first memory layer that:
- Serves memories from embedded Redis in under 5ms
- Runs 100% locally with no external API calls required
- Optionally syncs to cloud for cross-machine persistence
- Handles failures gracefully with automatic fallback
Core Concepts
Memory
A memory is a piece of information stored with metadata including:
- Content (text, structured data, embeddings)
- User association
- Priority level (low, medium, high, critical)
- Timestamps and access patterns
- Custom metadata
Cache Layers
Recall uses a multi-tier caching strategy:
- Hot Cache: Most frequently accessed memories (Redis)
- Warm Storage: Recent or important memories (Mem0)
- Cold Storage: All historical memories (Cloud)
Synchronization
Automatic bi-directional sync ensures:
- New memories are cached and persisted
- Cache misses are filled from cloud
- Updates propagate to all layers
- Consistency is maintained
Use Cases
AI Assistants
Give your AI assistants long-term memory about user preferences, conversation history, and learned behaviors.
Customer Support Bots
Remember customer issues, preferences, and resolution history across all interactions.
Personalization Engines
Build recommendation systems that remember and learn from every user interaction.
Knowledge Management
Create intelligent knowledge bases that remember facts, relationships, and context.
Architecture Overview
Quick Example
pythonfrom recall import RecallClient# Initialize with simple configurationclient = RecallClient(redis_url="redis://localhost:6379",mem0_api_key="your-api-key")# Store a memoryclient.add("User prefers dark mode interfaces",user_id="user123",priority="high")# Retrieve memories (served from cache if available)memories = client.search("user interface preferences",user_id="user123")# Memories are automatically cached for fast access# and persisted to cloud for reliability
Next Steps
- Quick Start Guide - Get up and running in 5 minutes
- Installation - Detailed setup instructions
- API Reference - Complete API documentation
- Examples - Real-world implementation examples