Features
Core Storage
- 💾 Persistent Storage - SQLite with optional cloud sync (S3, R2, D1)
- 📂 Hierarchical Organization - Section/subsection structure with auto-hierarchy assignment
- 📦 Export/Import - Backup and restore with merge strategies
Absorb & Lineage
- 🧬 Absorb - Feed facts in; an LLM classifies each against the store (duplicate / update / contradiction / related / new), skips duplicates, links relations, and consolidates related facts — with
dry_runpreview - 🌱 Supersession Lineage - Updates supersede old knowledge instead of deleting it; retrieval follows the chain to the current version by default (
followmodes:active,latest,full_history) - 🗞️ Topic Digest -
memory_digest(topic)bundles relevant memories, open TODOs/issues, related edges, and source IDs into one retrieval
Search & Intelligence
- 🔍 Semantic Search - Vector embeddings (TF-IDF, sentence-transformers, OpenAI)
- 🎯 Advanced Queries - Full-text, date ranges, tag filters (AND/OR/NOT), hybrid search
- 🔀 Cross-references - Auto-linked related memories based on similarity
- 🤖 LLM Deduplication - Find and merge duplicates with AI-powered comparison
- 🔗 Memory Linking - Typed edges, importance boosting, and cluster detection
Document Storage
- 📄 Structured Documents - Store markdown documents as searchable fragment trees (claims, plan items, references, risks)
- 🔒 Fragment Integrity - Guards against accidental delete/merge/absorb of document fragments
- 🔍 Granular Search - Individual claims and findings are semantically searchable while the full document remains retrievable as a unit
Tools & Visualization
- ⚡ Memory Automation - Structured tools for TODOs, issues, and sections
- 🕸️ Knowledge Graph - Interactive visualization with Mermaid rendering and cluster overlays
- 🌐 Live Graph Server - Built-in HTTP server with cloud-hosted option (D1/Pages)
- 💬 Chat with Memories - RAG-powered chat panel with LLM tool calling to search, create, update, and delete memories via streaming chat
- 📡 Event Notifications - Poll-based system for inter-agent communication
- 📊 Statistics & Analytics - Tag usage, trends, and connection insights
- 🧠 Memory Insights - Activity summary, stale detection, consolidation suggestions, and LLM-powered pattern analysis
- 📜 Action History - Track all memory operations (create, update, delete, merge, boost, link) with grouped timeline view
Preview
<p align="center"> <img src="media/demo.gif" alt="Memora memory graph demo" width="320"> <img src="media/demo2.gif" alt="Memora memory interaction demo" width="320"> </p>Install
pip install memora-mcpThe PyPI package is memora-mcp (bare memora on PyPI is an unrelated project). Includes cloud storage (S3/R2) and OpenAI embeddings out of the box.
# Optional: local embeddings (offline, ~2GB for PyTorch)
pip install "memora-mcp[local]"
# Latest development version straight from git
pip install "git+https://github.com/agentic-box/memora.git"The server runs automatically when configured in Claude Code. Manual invocation:
# Default (stdio mode for MCP)
memora-server
# With graph visualization server
memora-server --graph-port 8765
# HTTP transport (alternative to stdio)
memora-server --transport streamable-http --host 127.0.0.1 --port 8080Claude Code
Add to .mcp.json in your project root:
Local DB:
{
"mcpServers": {
"memora": {
"command": "memora-server",
"args": [],
"env": {
"MEMORA_DB_PATH": "~/.local/share/memora/memories.db",
"MEMORA_ALLOW_ANY_TAG": "1",
"MEMORA_GRAPH_PORT": "8765"
}
}
}
}Cloud DB (Cloudflare D1) - Recommended:
{
"mcpServers": {
"memora": {
"command": "memora-server",
"args": ["--no-graph"],
"env": {
"MEMORA_STORAGE_URI": "d1://<account-id>/<database-id>",
"CLOUDFLARE_API_TOKEN": "<your-api-token>",
"MEMORA_ALLOW_ANY_TAG": "1"
}
}
}
}With D1, use --no-graph to disable the local visualization server. Instead, use the hosted graph at your Cloudflare Pages URL (see Cloud Graph).
Cloud DB (S3/R2) - Sync mode:
{
"mcpServers": {
"memora": {
"command": "memora-server",
"args": [],
"env": {
"AWS_PROFILE": "memora",
"AWS_ENDPOINT_URL": "https://<account-id>.r2.cloudflarestorage.com",
"MEMORA_STORAGE_URI": "s3://memories/memories.db",
"MEMORA_CLOUD_ENCRYPT": "true",
"MEMORA_ALLOW_ANY_TAG": "1",
"MEMORA_GRAPH_PORT": "8765"
}
}
}
}Codex CLI
Add to ~/.codex/config.toml:
[mcp_servers.memora]
command = "memora-server" # or full path: /path/to/bin/memora-server
args = ["--no-graph"]
env = {
AWS_PROFILE = "memora",
AWS_ENDPOINT_URL = "https://<account-id>.r2.cloudflarestorage.com",
MEMORA_STORAGE_URI = "s3://memories/memories.db",
MEMORA_CLOUD_ENCRYPT = "true",
MEMORA_ALLOW_ANY_TAG = "1",
}| Variable | Description |
|---|---|
MEMORA_DB_PATH | Local SQLite database path (default: ~/.local/share/memora/memories.db) |
MEMORA_STORAGE_URI | Storage URI: d1://<account>/<db-id> (D1) or s3://bucket/memories.db (S3/R2) |
CLOUDFLARE_API_TOKEN | API token for D1 database access (required for d1:// URI) |
MEMORA_CLOUD_ENCRYPT | Encrypt database before uploading to cloud (true/false) |
MEMORA_CLOUD_COMPRESS | Compress database before uploading to cloud (true/false) |
MEMORA_CACHE_DIR | Local cache directory for cloud-synced database |
MEMORA_ALLOW_ANY_TAG | Allow any tag without validation against allowlist (1 to enable) |
MEMORA_TAG_FILE | Path to a JSON file containing an array of allowed tags, e.g. ["plan", "memora/issues"] |
MEMORA_TAGS | Comma-separated list of allowed tags |
MEMORA_GRAPH_PORT | Port for the knowledge graph visualization server (default: 8765) |
MEMORA_STALE_DAYS | Days before an open TODO/issue counts as stale in memory_insights (default: 14) |
MEMORA_EMBEDDING_MODEL | Embedding backend: openai (default), sentence-transformers, or tfidf |
SENTENCE_TRANSFORMERS_MODEL | Model for sentence-transformers (default: all-MiniLM-L6-v2) |
MEMORA_EMBEDDING_API_KEY | Embedding provider API key (atomic with base URL — see below) |
MEMORA_EMBEDDING_BASE_URL | Embedding provider base URL (atomic with API key — see below) |
MEMORA_EMBEDDING_STRICT | Recommend 1. Fail hard on embedding errors instead of silent TF-IDF. Without it a broken endpoint keeps answering while every vector becomes a keyword bag (how 756 memories degraded unnoticed). |
OPENAI_API_KEY | LLM only (dedup/chat) when MEMORA_EMBEDDING_* is set. Embeddings fall back to this key only if both MEMORA_EMBEDDING_API_KEY and MEMORA_EMBEDDING_BASE_URL are unset |
OPENAI_BASE_URL | LLM base URL (OpenRouter, Azure, etc.). Same atomic fallback rule as the key — not an embeddings URL when you use a split config |
OPENAI_EMBEDDING_MODEL | Model id for the openai embedding backend. Must exist on the embedding host (default text-embedding-3-small is OpenAI-only; Cloudflare needs e.g. @cf/baai/bge-m3) |
MEMORA_LLM_ENABLED | Enable LLM-powered deduplication comparison (true/false, default: true) |
MEMORA_LLM_MODEL | Model for deduplication comparison (default: gpt-4o-mini) |
CHAT_MODEL | Model for the chat panel (default: deepseek/deepseek-chat, falls back to MEMORA_LLM_MODEL) |
AWS_PROFILE | AWS credentials profile from ~/.aws/credentials (useful for R2) |
AWS_ENDPOINT_URL | S3-compatible endpoint for R2/MinIO |
R2_PUBLIC_DOMAIN | Public domain for R2 image URLs |
Memora supports three embedding backends:
| Backend | Install | Quality | Speed |
|---|---|---|---|
openai (default) | Included | High quality | API latency |
sentence-transformers | pip install memora[local] | Good, runs offline | Medium |
tfidf | Included | Basic keyword matching | Fast |
Embeddings and the LLM are configured separately.
| Role | Variables |
|---|---|
| LLM (dedup, chat) | OPENAI_API_KEY + OPENAI_BASE_URL |
| Embeddings | MEMORA_EMBEDDING_API_KEY + MEMORA_EMBEDDING_BASE_URL (both or neither — atomic pair) |
| Fallback | If both MEMORA_EMBEDDING_* are unset, embeddings use the full OPENAI_* pair |
A partial split (only one MEMORA_EMBEDDING_* set) is rejected so one provider’s secret is never sent to another host.
Trap — OpenRouter has no embeddings endpoint. OpenRouter’s catalogue is chat/multimodal only (no embedding models). Do not point the embedding path at OpenRouter via OPENAI_BASE_URL (or a MEMORA base URL). That combination 404s every embed call; without MEMORA_EMBEDDING_STRICT=1 Memora falls back to TF-IDF and keeps answering, so the store fills with keyword bags while looking healthy. OpenRouter remains fine for the LLM
…