MemoGraph gives Claude a graph-based memory system backed by markdown files with YAML frontmatter. It exposes 19 tools including semantic search, memory CRUD operations, graph traversal with wikilinks, and autonomous hooks that can capture context from queries and responses. You get hybrid retrieval combining keywords and optional vector embeddings, automatic entity extraction (topics, people, action items), and AI-powered tag and link suggestions. The server connects to local vault directories and supports multiple LLM providers for its auto-organization engine. Reach for this when you want Claude to maintain persistent, interconnected knowledge across sessions with smart retrieval that understands relationships between memories, not just keyword matches.
MemoGraph turns a folder of markdown notes into a queryable, AI-ready knowledge graph. It solves the LLM memory problem — your AI assistants forget last Tuesday's decision, can't find a related note across two projects, and re-derive the same insight again and again — by giving them a persistent, navigable, attribution-friendly memory layer that lives in plain markdown files you control.
You write notes the way you already do. MemoGraph indexes them, builds a graph from [[wikilinks]], ranks them by salience, and serves them back to your LLM (or your team) on demand.
pip install memograph
memograph quickstart
That's it. The quickstart command drops a small, interconnected sample vault on your disk (15 notes about Python development, with real wikilinks between them), ingests it, and runs three live demo queries so you can see the graph + hybrid retrieval working before you decide whether to commit. Try this query in particular:
memograph --vault ~/memograph-quickstart search "FastAPI dependency injection"
The vault contains a note titled FastAPI dependencies (about Depends(...)) — the words "dependency" and "injection" never appear in any note's title. MemoGraph still finds it, because hybrid retrieval understands "dependency injection" semantically and the wikilink graph stitches related notes together. That's the product, demonstrated in one query.
Re-run memograph quickstart --force any time to reset to a fresh demo. When you're ready, point MemoGraph at your real notes: memograph --vault ~/your-notes ingest.
/metrics, structured JSON logging with request IDs, and a separate /healthz / /readyz for orchestration.| You want to… | MemoGraph gives you… |
|---|---|
| Stop your AI assistant from forgetting context across conversations | Persistent vault + MCP server, plus optional auto-save hooks |
| Find a note across thousands when you only half-remember it | Hybrid retrieval (keyword + semantic + graph) with salience ranking |
| Connect related ideas without manual cross-linking | AI link suggestions, backlink graph, BFS traversal |
| Discover what's missing in your knowledge base | Gap detector + topic clustering + learning-path suggestions |
| Self-host a memory backend for a team or product | Web UI, FastAPI HTTP API, OpenAPI v1 contract, Docker compose |
| Ship MemoGraph to multiple paying customers | Multi-tenant kernel registry, OIDC, quotas (roadmap), GDPR runbook |
| Survive an SOC 2 audit conversation | Audit log with user + tenant binding, observability, security workflow, compliance roadmap doc |
[[wikilinks]] build a navigable knowledge graph automatically..md file with YAML frontmatter; no proprietary format.[[wikilinks]] to related notes; bidirectional opportunities included.MemoryKernel with sync, async, and batch variants./api/v1/, OpenAPI snapshot in CI, ready for service-to-service integration./metrics, OTLP export.bandit + pip-audit).See docs/INSTALL_ENTERPRISE.md, docs/SSO_SETUP.md, docs/GDPR_RUNBOOK.md, docs/BACKUP_RESTORE_RUNBOOK.md, docs/OBSERVABILITY_GUIDE.md, and docs/RBAC_GUIDE.md for the operator-facing details.
Hosting it yourself? docs/HOSTING_GUIDE.md covers four genuinely-free paths — Oracle Free Tier, Cloudflare Tunnel + your hardware (recommended for most), GCP always-free stitch, and GitHub-repo-as-vault. Workspace identity via OIDC and Drive-as-portability-backup are documented in docs/GOOGLE_WORKSPACE_SETUP.md.
pip install memograph
Install with optional dependencies:
# For OpenAI support
pip install memograph[openai]
# For Anthropic Claude support
pip install memograph[anthropic]
# For Ollama support
pip install memograph[ollama]
# For embedding support
pip install memograph[embeddings]
# Install everything
pip install memograph[all]
from memograph import MemoryKernel, MemoryType
# Initialize the kernel attached to your vault path
kernel = MemoryKernel("~/my-vault")
# Ingest all notes in the vault
stats = kernel.ingest()
print(f"Indexed {stats['indexed']} memories.")
# Programmatically add a new memory
kernel.remember(
title="Meeting Note",
content="Decided to use BFS graph traversal for retrieval.",
memory_type=MemoryType.EPISODIC,
tags=["design", "retrieval"]
)
# Retrieve context for an LLM query
context = kernel.context_window(
query="how does retrieval work?",
tags=["retrieval"],
depth=2,
top_k=8
)
print(context)
MemoGraph includes a full-featured MCP server for seamless integration with AI assistants like Cline and Claude Desktop.
📖 New to MemoGraph MCP? See the MCP User Guide for practical usage instructions and examples!
🚨 Having connection issues? See Setup & Troubleshooting Guide - Common fixes for "cannot connect" errors!
| Category | Tools | Description |
|---|---|---|
| Search | search_vault, query_with_context | Semantic search and context retrieval |
| Create | create_memory, import_document | Add memories and import documents |
| Read | list_memories, get_memory, get_vault_info | Browse and retrieve memories |
| Update | update_memory | Modify existing memories |
| Delete | delete_memory | Remove memories by ID |
| Analytics | get_vault_stats | Vault statistics and insights |
| Discovery | list_available_tools | List all available tools |
| Autonomous | auto_hook_query, auto_hook_response, configure_autonomous_mode, get_autonomous_config | Autonomous memory management |
| Graph | relate_memories, search_by_graph, find_path | Graph-native linking and traversal |
| Bulk | bulk_create | Create multiple memories in one call |
MemoGraph's MCP server is a stdio server — it runs alongside any MCP-compatible agentic CLI or editor. The full setup cookbook (config-file paths, format quirks, verification steps) lives in docs/MCP_CLIENTS.md:
| Client | Format | Quick reference |
|---|---|---|
| Claude Code (CLI) | mcpServers | claude_code_config.json |
| Claude Desktop | mcpServers | claude_desktop_config.json |
| Cline | mcp.servers | cline_config.json |
| Cursor | mcpServers | cursor_config.json |
| Windsurf | mcpServers | windsurf_config.json |
| Continue.dev | experimental.modelContextProtocolServers | continue_config.json |
| Zed | context_servers | zed_config.json |
| VS Code (1.99+) | servers | vscode_config.json |
| Goose (Block) | YAML extensions | goose_config.yaml |
| Roo Code | mcpServers | roo_code_config.json |
| Gemini CLI | mcpServers | gemini_cli_config.json |
| OpenAI Codex CLI | TOML mcp_servers.<name> | codex_config.toml |
| LM Studio | mcpServers | lm_studio_config.json |
| Cherry Studio | UI form | cherry_studio_config.json |
| IBM Bob Shell | mcpServers | bob_shell_config.json |
After pip install memograph (or uv tool install memograph), three launch commands are all equivalent:
memograph-mcp # console script (recommended)
python -m memograph.mcp.run_server # module form (works with any Python)
uvx --from memograph memograph-mcp # zero-install via uv
memograph-mcp and memograph are both registered as console scripts: the first starts the MCP server, the second is the CLI. They do not collide.
For shared deployments or untrusted clients, set MEMOGRAPH_READONLY=true. The server refuses every vault-writing tool — create_memory, import_document, update_memory, delete_memory, relate_memories, bulk_create, batch_update, batch_delete, import_backup_tool, and the auto-save hooks — and returns a structured {"success": false, "readonly": true, "error": "..."} payload instead. Read tools (search_vault, query_with_context, list_memories, get_memory, analytics, graph traversal) stay fully functional.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"memograph": {
"command": "memograph-mcp",
"env": {
"MEMOGRAPH_VAULT": "/path/to/your/vault"
}
}
}
}
If the memograph-mcp binary isn't on the client's PATH (common when the client launches without your shell environment), use the explicit module form instead:
{
"mcpServers": {
"memograph": {
"command": "python",
"args": ["-m", "memograph.mcp.run_server"],
"env": {
"MEMOGRAPH_VAULT": "/path/to/your/vault"
}
}
}
}
Add to your ~/.cline/mcp_settings.json:
{
"mcp": {
"servers": {
"memograph": {
"command": "memograph-mcp",
"env": {
"MEMOGRAPH_VAULT": "/path/to/your/vault"
}
}
}
}
}
For Claude Code, Cursor, Windsurf, Continue, Zed, VS Code, Goose, Gemini CLI, Codex CLI, LM Studio, Cherry Studio, and Bob Shell, see docs/MCP_CLIENTS.md.
NEW: MemoGraph is now available in the official MCP Registry! 🎉
Registry URL: https://github.com/modelcontextprotocol/servers/tree/main/src/memograph
pip install memograph
Then drop the snippet for your client into its config file (see the table above or docs/MCP_CLIENTS.md).
Benefits of MCP Registry Listing:
Note: The registry uses the PyPI package version. When you pip install memograph, you automatically get the latest registry-listed version.
See MCP_REGISTRY_GUIDE.md for complete submission and configuration guide.
Once configured, use natural language with your AI assistant:
"Search my vault for memories about Python"
"Create a memory titled 'Project Ideas' with content '...'"
"Update memory abc-123 to have salience 0.9"
"Delete memory xyz-456"
"What tools are available?"
"Get vault statistics"
See CONFIG_REFERENCE.md for complete MCP configuration guide.
MemoGraph provides autonomous hooks to save conversations automatically:
MEMOGRAPH_AUTONOMOUS_MODE=trueRead the full Autonomous Hooks User Guide →
MemoGraph comes with a powerful CLI for managing your vault and chatting with it.
Index your markdown files into the graph database:
memograph --vault ~/my-vault ingest
Force re-indexing all files:
memograph --vault ~/my-vault ingest --force
Quickly add a memory from the command line:
memograph --vault ~/my-vault remember \
--title "Team Sync" \
--content "Discussed Q3 goals." \
--tags planning q3
Generate context for a query:
memograph --vault ~/my-vault context \
--query "What did we decide about the database?" \
--tags architecture \
--depth 2 \
--top-k 5
Start an interactive chat session with your vault context:
memograph --vault ~/my-vault ask --chat --provider ollama --model llama3
Or ask a single question:
memograph --vault ~/my-vault ask \
--query "Summarize our design decisions" \
--provider claude \
--model claude-3-5-sonnet-20240620
Check your environment and connection to LLM providers:
memograph --vault ~/my-vault doctor
### Import Documents
Import documents (TXT, PDF, DOCX) and convert them to markdown:
```bash
# Import a single file
memograph --vault ~/my-vault import document.pdf --type episodic
# Import entire folder
memograph --vault ~/my-vault import ~/Documents --recursive
# Preview files without importing (dry run)
memograph --vault ~/my-vault import ~/Documents --dry-run
# Auto-ingest after import
memograph --vault ~/my-vault import document.pdf --auto-ingest
Efficiently manage multiple memories at once:
# Bulk create memories from JSON/CSV
memograph --vault ~/my-vault batch-create memories.json
# Bulk update memories by filter
memograph --vault ~/my-vault batch-update \
--filter-tags outdated \
--add-tags reviewed \
--salience 0.8
# Bulk delete with safety checks
memograph --vault ~/my-vault batch-delete \
--filter-type episodic \
--filter-max-salience 0.3 \
--dry-run
Export, backup, and restore your vault:
# Export vault to JSON/CSV/Markdown
memograph --vault ~/my-vault export --format json --output backup.json
# Create timestamped backup
memograph --vault ~/my-vault backup --output ./backups
# Restore from backup
memograph --vault ~/my-vault import-backup backup.zip
Manage settings and view vault analytics:
# View vault statistics
memograph --vault ~/my-vault stats
# Configure settings
memograph config set embedding_provider openai
memograph config get embedding_provider
memograph config list
# Manage profiles
memograph config profile create work --vault ~/work-vault
memograph config profile use work
Interactive wizard to configure MCP server for Claude Desktop or Cline:
# Run interactive setup wizard
memograph setup-mcp
# Verify MCP configuration
memograph verify-mcp
📖 Complete CLI Documentation: See CLI Usage Guide for detailed documentation with 200+ examples covering all 24 commands.
MemoGraph includes powerful AI-powered features to enhance your knowledge management workflow. See AI Features Guide for complete documentation.
Automatically suggest relevant tags using semantic analysis, content structure, and existing patterns:
# Suggest tags for a note
memograph suggest-tags note.md
# Apply high-confidence suggestions automatically
memograph suggest-tags note.md --apply
# Adjust confidence threshold and limit
memograph suggest-tags note.md --min-confidence 0.5 --max-suggestions 10
Features: Frequency-based extraction • Semantic similarity • Structure detection • Pattern learning • Confidence scoring
Intelligently recommend wikilinks to related notes using semantic similarity and graph analysis:
# Suggest links for a note
memograph suggest-links note.md
# Apply suggestions automatically
memograph suggest-links note.md --apply
# Show bidirectional link opportunities
memograph suggest-links note.md --show-bidirectional
Features: Semantic search • Keyword matching • Graph-based suggestions • Bidirectional detection • Target previews
Identify missing topics, weak coverage, and isolated notes in your vault:
# Detect all gaps
memograph detect-gaps
# Focus on high-severity gaps
memograph detect-gaps --min-severity 0.7
# Export results to JSON
memograph detect-gaps --output json > gaps.json
Gap Types: Missing Topics • Weak Coverage • Isolated Notes • Missing Links
Get comprehensive analysis of your entire knowledge base:
# Full analysis with all features
memograph analyze-knowledge
# Export detailed report to JSON
memograph analyze-knowledge --output json > analysis.json
Analysis Includes: Vault statistics • Topic clustering • Learning paths • Gap detection • Connection analysis
from memograph import MemoryKernel
from memograph.ai import AutoTagger, LinkSuggester, GapDetector
kernel = MemoryKernel("~/my-vault")
kernel.ingest()
# Get tag suggestions
tagger = AutoTagger(kernel, min_confidence=0.4)
suggestions = await tagger.suggest_tags(
content="Python is great for data science",
title="Data Science with Python"
)
# Get link suggestions
suggester = LinkSuggester(kernel, min_confidence=0.5)
links = await suggester.suggest_links(
content="Python async programming tutorial",
title="Async Python"
)
# Detect knowledge gaps
detector = GapDetector(kernel, min_severity=0.5)
gaps = await detector.detect_gaps()
# Comprehensive analysis
analysis = await detector.analyze_knowledge_base()
📖 Complete Documentation:
💡 Use Cases: Auto-organize notes • Discover connections • Identify gaps • Maintain consistency • Build learning paths
MemoGraph supports different types of memories inspired by cognitive science:
The library uses BFS (Breadth-First Search) to traverse your knowledge graph:
# Retrieve nodes with depth=2 (2 hops from seed nodes)
nodes = kernel.retrieve_nodes(
query="graph algorithms",
depth=2, # Traverse up to 2 levels deep
top_k=10 # Return top 10 relevant memories
)
Each memory has a salience score (0.0-1.0) that represents its importance:
---
title: "Critical Architecture Decision"
salience: 0.9
memory_type: semantic
---
We decided to use PostgreSQL for better ACID guarantees...
MemoGraph/
├── memograph/ # Main package
│ ├── core/ # Core functionality
│ │ ├── kernel.py # Memory kernel
│ │ ├── graph.py # Graph implementation
│ │ ├── retriever.py # Hybrid retrieval
│ │ ├── indexer.py # File indexing
│ │ └── parser.py # Markdown parsing
│ ├── adapters/ # LLM and embedding adapters
│ │ ├── embeddings/ # Embedding providers
│ │ ├── frameworks/ # Framework integrations
│ │ └── llm/ # LLM providers
│ ├── storage/ # Storage and caching
│ ├── mcp/ # MCP server implementation
│ └── cli.py # CLI implementation
├── tests/ # Test suite
├── examples/ # Example usage
└── scripts/ # Utility scripts
We welcome contributions! Please see our Contributing Guide for details.
Clone the repository:
git clone https://github.com/Indhar01/MemoGraph.git
cd MemoGraph
Install in development mode:
pip install -e ".[all,dev]"
Install pre-commit hooks:
pre-commit install
Run tests:
pytest
We maintain high code quality standards:
See our Security Policy for reporting vulnerabilities.
This project is licensed under the MIT License - see the LICENSE file for details.
Inspired by the need for better memory management in LLM applications. Built with:
We value community feedback and contributions! Here's how to get involved:
Found a bug or have a feature request? Open an issue on GitHub.
Join the conversation in GitHub Discussions:
We welcome contributions! See our Contributing Guide for details on:
Current version: 0.3.0
Single-tenant deployments are stable and recommended for production use. Multi-tenant deployments are feature-complete with end-to-end isolation tests gating the release; the public API will stabilise at v1.0.
TenantRegistry wired into the request path; non-admin routes resolve their kernel per-tenant.TenantStorage, TenantRegistry, admin routes for tenant lifecycle.Made with ❤️ for better LLM memory management
MEMOGRAPH_VAULT*Path to your MemoGraph vault directory
csoai-org/pdf-document-mcp
xt765/mcp-document-converter
io.github.xjtlumedia/markdown-formatter
io.github.ai-aviate/better-notion
suekou/mcp-notion-server
meterlong/mcp-doc