Memora

by agentic-mcp-tools

129 downloads
Not rated
GitHub

About

A lightweight MCP server for semantic memory storage, knowledge graphs, and cross-session context

Details

Author
agentic-mcp-tools
Downloads
129
Categories
Other, AI, Knowledge Base

Setup

Install Memora in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/agentic-mcp-tools/memora

Follow the installation instructions in the repository README, then restart your MCP client.

"You never truly know the value of a moment until it becomes a memory."

Give your AI agents persistent collective memory
An MCP memory layer for agents: structured storage, semantic retrieval, graph relations, and source-backed cross-session context.

Absorb agent work into durable graph memory, then usememory_digest(topic)to retrieve relevant memories, TODOs/issues, related edges, and source IDs.

Features·Preview·Install·Usage·Config·Live Graph·Cloud Graph·Chat·Semantic Search·Documents·LLM Dedup·Linking·Neovim

- 💾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- Feed facts in; an LLM classifies each against the store (duplicate / update / contradiction / related / new), skips duplicates, links relations, and consolidates related facts — withdry_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

- 🔍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

- 📄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

- ⚡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

The PyPI package ismemora-mcp(barememoraon 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 8080
{ "mcpServers": { "memora": { "command": "memora-server", "args": [], "env": { "MEMORA_DB_PATH": "~/.local/share/memora/memories.db", "MEMORA_ALLOW_ANY_TAG": "1", "MEMORA_GRAPH_PORT": "8765" } } } }
{ "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-graphto disable the local visualization server. Instead, use the hosted graph at your Cloudflare Pages URL (seeCloud Graph).

{ "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" } } } }
[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", }

Memora supports three embedding backends:

Embeddings and the LLM are configured separately.

A partial split (only oneMEMORA_EMBEDDING_*set) isrejectedso 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). Donotpoint the embedding path at OpenRouter viaOPENAI_BASE_URL(or a MEMORA base URL). That combination 404s every embed call; withoutMEMORA_EMBEDDING_STRICT=1Memora falls back to TF-IDF and keeps answering, so the store fills with keyword bags while looking healthy. OpenRouter remains fine for theLLMonly.

Worked example (LLM via OpenRouter, embeddings via Cloudflare Workers AI):

@cf/baai/bge-m3is 1024-dimensional. Token needs Workers AI permission. Endpoint shape:

https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/v1

{ "env": { "MEMORA_EMBEDDING_MODEL": "openai", "OPENAI_API_KEY": "<openrouter-key>", "OPENAI_BASE_URL": "https://openrouter.ai/api/v1", "MEMORA_LLM_MODEL": "deepseek/deepseek-chat", "MEMORA_EMBEDDING_API_KEY": "<cloudflare-api-token-with-workers-ai>", "MEMORA_EMBEDDING_BASE_URL": "https://api.cloudflare.com/client/v4/accounts/<account_id>/ai/v1", "OPENAI_EMBEDDING_MODEL": "@cf/baai/bge-m3", "MEMORA_EMBEDDING_STRICT": "1" } }

What this fix does (no oversell): embeddings and LLM can use different providers; a partial split is rejected; strict mode turns silent degradation into a hard, named failure.

Automatic:Embeddings and cross-references are computed automatically when youmemory_create,memory_update, ormemory_create_batch.

Manual rebuild requiredwhen the store fingerprint changes — not onlyMEMORA_EMBEDDING_MODEL, but also:

- Embeddingendpoint(MEMORA_EMBEDDING_BASE_URL/ host)
- Actual model id (OPENAI_EMBEDDING_MODEL, e.g. switching to@cf/baai/bge-m3)
- Vectorkind or dimensions(word-key TF-IDF bags vs dense 1024-d; or 384 vs 1024)
- Mixed store (some rows dense, some sparse) — cosine similarity only shares keys, so mixed kinds yield0.0recall for old rows

Fingerprint form:backend|model|repr(e.g.openai|@cf/baai/bge-m3|dense:1024). Legacy meta valueopenaialone is treated as a mismatch.

# After changing embedding model/endpoint, rebuild all embeddings memory_rebuild_embeddings # Then rebuild cross-references to update the knowledge graph memory_rebuild_crossrefs

A built-in HTTP server starts automatically with the MCP server, serving an interactive knowledge graph visualization.

ssh -L 8765:localhost:8765 user@remote # Then open http://localhost:8765/graph in your browser
{ "env": { "MEMORA_GRAPH_PORT": "8765" } }

To disable: add"--no-graph"to args in your MCP config.

- Details Panel- View memory content, metadata, tags, and related memories
- Timeline Panel- Browse memories chronologically, click to highlight in graph
- History Panel- Action log of all operations with grouped consecutive entries and clickable memory references (deleted memories shown as strikethrough)
- Chat Panel- Ask questions about your memories using RAG-powered LLM chat with streaming responses and clickable[Memory #ID]references
- Time Slider- Filter memories by date range, drag to explore history
- Real-time Updates- Graph, timeline, and history update via SSE when memories change
- Filters- Tag/section dropdowns, zoom controls
- Mermaid Rendering- Code blocks render as diagrams

- 🟣Tags- Purple shades by tag
- 🔴Issues- Red (open), Orange (in progress), Green (resolved), Gray (won't fix)
- 🔵TODOs- Blue (open), Orange (in progress), Green (completed), Red (blocked)

When using Cloudflare D1 as your database, the graph visualization is hosted on Cloudflare Pages - no local server needed.

- Access from anywhere (no SSH tunneling)
- Real-time updates via WebSocket
- Multi-database support via?db=parameter
- Secure access with Cloudflare Zero Trust

npx wrangler d1 create memora-graph npx wrangler d1 execute memora-graph --file=memora-graph/schema.sql
cd memora-graph npx wrangler pages deploy ./public --project-name=memora-graph

Configure bindingsin Cloudflare Dashboard:

- Pages → memora-graph → Settings → Bindings
- Add D1:DB_MEMORA→ your database
- Add R2:R2_MEMORA→ your bucket (for images)

{ "env": { "MEMORA_STORAGE_URI": "d1://<account-id>/<database-id>", "CLOUDFLARE_API_TOKEN": "<your-token>" } }

- Cloudflare Dashboard → Zero Trust → Access → Applications
- Add application formemora-graph.pages.dev
- Create policy with allowed emails
- Pages → Settings → Enable Access Policy

Seememora-graph/for detailed setup and multi-database configuration.

Ask questions about your knowledge base directly from the graph UI. The chat panel uses RAG (Retrieval-Augmented Generation) to search relevant memories and stream LLM responses with tool calling support.

- Togglevia the floating chat icon at bottom-right
- Semantic searchfinds the most relevant memories as context
- Streaming responseswith clickable
[Memory #ID]references that focus the graph node
- Tool calling— the LLM can create, update, and delete memories directly from chat (e.g., "save this as a memory", "delete memory #42", "update memory #10 with...")
- Works on both the local server and Cloudflare Pages deployment

Requires an OpenAI-compatible API (OPENAI_API_KEY+OPENAI_BASE_URLfor local,OPENROUTER_API_KEYsecret for Cloudflare). The chat model must support tool use (function calling).

Find and merge duplicate memories using AI-powered semantic comparison:

# Find potential duplicates (uses cross-refs + optional LLM analysis) memory_find_duplicates(min_similarity=0.7, max_similarity=0.95, limit=10, use_llm=True) # Merge duplicates (append, prepend, or replace strategies) memory_merge(source_id=123, target_id=456, merge_strategy="append")

LLM Comparisonanalyzes memory pairs and returns:

- verdict: "duplicate", "similar", or "different"
- confidence: 0.0-1.0 score
- reasoning: Brief explanation
- suggested_action: "merge", "keep_both", or "review"

Works with any OpenAI-compatiblechatAPI (OpenAI, OpenRouter, Azure, etc.) viaOPENAI_BASE_URL. OpenRouter is fine for this LLM path; it doesnotprovide embeddings — configure embeddings separately (see Semantic Search & Embeddings).

Store structured documents (research reports, architecture decisions, post-mortems) as searchable fragment trees:

# Store a markdown document — auto-parsed into typed fragments memory_store_document( content="# Research Report\n\n## Evidence Table\n| Claim | Confidence |\n...", document_key="research/memora-enhancements-2026-04-08", tags=["memora/research"] ) # Returns: {root_id: 230, fragment_count: 100, node_map: {claim: [...], plan_item: [...], ...}} # Retrieve the full document or specific fragment types memory_get_document(document_key="research/memora-enhancements-2026-04-08") memory_get_document(document_key="...", node_kinds=["claim"], content_mode="full") # Delete a document and all its fragments memory_delete_document(document_key="research/memora-enhancements-2026-04-08")

How it works:The parser splits markdown by structure — tables become individual claims, numbered lists become plan items, URL lists become references, and risk sections become risk fragments. Each fragment is independently searchable viamemory_semantic_searchwhile the full document is retrievable as a unit.

Fragment types:claim,plan_item,reference,section_chunk,risk

Integrity guards:Document fragments are protected from accidental modification:

- memory_deleterequiresforce=Truefor fragments
- memory_mergerefuses to merge fragments
- memory_absorbexcludes fragments from similarity matching
- memory_find_duplicatesandmemory_detect_supersessionsskip fragments
- Graph UI hides fragments, shows only the document root node

Structured tools for common memory types:

# Create a TODO with status and priority memory_create_todo(content="Implement feature X", status="open", priority="high", category="backend") # Create an issue with severity memory_create_issue(content="Bug in login flow", status="open", severity="major", component="auth") # Create a section placeholder (hidden from graph) memory_create_section(content="Architecture", section="docs", subsection="api")

Analyze stored memories and surface actionable insights:

# Full analysis with LLM-powered pattern detection memory_insights(period="7d", include_llm_analysis=True) # Quick summary without LLM (faster, no API key needed) memory_insights(period="1m", include_llm_analysis=False)

- Activity summary— memories created in the period, grouped by type and tag
- Open items— open TODOs and issues with stale detection (configurable viaMEMORA_STALE_DAYS, default 14)
- Consolidation candidates— similar memory pairs that could be merged
- LLM analysis— themes, focus areas, knowledge gaps, and a summary (requiresOPENAI_API_KEY)

# Create typed edges between memories memory_link(from_id=1, to_id=2, edge_type="implements", bidirectional=True) # Edge types: references, implements, supersedes, extends, contradicts, related_to # Remove links memory_unlink(from_id=1, to_id=2) # Boost memory importance for ranking memory_boost(memory_id=42, boost_amount=0.5) # Detect clusters of related memories memory_clusters(min_cluster_size=2, min_score=0.3)

For offline viewing, export memories as a static HTML file:

memory_export_graph(output_path="~/memories_graph.html", min_score=0.25)

This is optional - the Live Graph Server provides the same visualization with real-time updates.

Browse memories directly in Neovim with Telescope. Copy the plugin to your config:

# For kickstart.nvim / lazy.nvim cp nvim/memora.lua ~/.config/nvim/lua/kickstart/plugins/

Usage:Press<leader>smto open the memory browser with fuzzy search and preview.

Requires:telescope.nvim,plenary.nvim, andmemorainstalled in your Python environment.

Adaptive MCP memory system for AI applications. Learns which retrieval strategies work for your data, scores results using cognitive science models, builds a knowledge graph automatically, and validates every parameter change against real query history before adopting it. Patent pending.

Persistent memory for AI agents. Single SQLite file, 192 MCP tools. FTS5 search, knowledge graph, session handoffs, write gate. No server, no API keys, no LLM calls.

Highly efficient context management for agentic AI: MCP code search, evidence packs, graph context, and memory for large projects.

Self-hosted Rust-based MCP server for AI agent memory — persistent, queryable memory with hybrid search, knowledge graphs, built-in embeddings, and 14 core tools (expandable to 86+ with profile-based tiering).

Authenticated MCP and agent gateway for Forge Cascade private AI memory, provenance, graph search, and capsule lineage.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.