r3 Documentation
MCP server for persistent AI memory. Local Redis storage with optional cloud sync.
Start building
How r3 works
r3 is an MCP server that gives AI applications persistent memory. By default, it uses an embedded Redis server for local storage. No setup required. Optionally add cloud sync with Mem0.
json// MCP client config (e.g. .gemini/settings.json){"mcpServers": {"r3": {"command": "npx","args": ["@n3wth/r3"]}}}
Once configured, your AI assistant can remember context across conversations:
textYou: Remember that I prefer TypeScript over JavaScriptAI: I'll remember your preference for TypeScript.[New conversation]You: What language should I use for this project?AI: Based on your preferences, I'd recommend TypeScript.
Architecture
Antigravity CLI
MCP Protocol
r3 Server
Redis(L1 Cache)
Mem0 Cloud(L2 Storage)
<5ms
Cache Hit
~200ms
Cache Miss
~10ms
First Store
Core concepts
Memories
Each memory contains:
- Content: The information to remember
- User ID: Who it belongs to
- Priority: How important it is (affects caching)
- Metadata: Additional context
Caching layers
- L1 (Redis): Hot data, 24-hour TTL
- L2 (Cloud): Permanent storage with vector search
MCP tools
r3 provides these tools to MCP clients:
add_memory: Store new informationsearch_memory: Find relevant contextget_all_memories: List all memoriesdelete_memory: Remove specific memorycache_stats: Monitor performance
When to use r3
Good for:
- User preferences and settings
- Conversation history
- Facts about users or projects
- Context that should persist
Not for:
- Sensitive data (use encryption)
- Large files (use object storage)
- Real-time data (use streaming)