Memgram
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Memgram — AI Memory Graph
A persistent memory layer for AI assistants, built as an MCP server. Memgram gives any MCP-compatible AI (Copilot CLI, Claude Desktop, Claude Code, Cursor, etc.) the ability to remember thoughts, rules, decisions, and errors across sessions.
Features
24 MCP tools for storing/retrieving knowledge
Session management — track what was done, when, by which AI/model
Two-dimensional scoping — filter by
projectand/orbranchName normalization —
oxide-os,oxide_os,OxideOSall match asoxideosCompaction-aware — save/restore state at context window boundaries
Rules engine — learned do/don't patterns with severity and reinforcement
Error patterns — failure knowledge that prevents repeated mistakes
FTS5 full-text search with relevance scoring (recency + access + severity + pinned)
sqlite-vec vector search for RAG-style semantic retrieval
Health diagnostics — WAL/foreign-key checks, vector availability, table counts
Thought groups — cluster related items together
Project summaries — living overviews that auto-update
Three export formats — markdown (linked
.mdfiles), web (navigable HTML site), and PDF (dark-themed report with full content, markdown rendering, and mermaid diagrams)Project cleanup — list, merge, or rename projects to fix typos
Abstracted DB layer — SQLite now, PostgreSQL/pgvector ready
Related MCP server: Jatobá Brain
Quick Start
# Install
uv add memgram
# Run as MCP server (stdio) — default subcommand
memgram serve
# Or just:
memgram
# With custom DB path
memgram --db-path /path/to/memgram.db serve
# With custom embedding dimensions (default: 384)
memgram serve --embedding-dim 1536
# Export database as markdown
memgram export -o memgram-export
# Export as PDF report
memgram export-pdf -o report.pdf --project myappCLI Subcommands
Command | Description |
| Run the MCP server over stdio (default when no subcommand given) |
| Export the database as a tree of linked markdown files (slug filenames) |
| Export as a navigable Jekyll HTML website |
| Export as a styled dark-themed PDF report |
| Rename legacy ID-based export files to slugs and fix links |
| List all projects with counts (even if no summary exists) |
| Merge all data from one project into another (typo cleanup) |
| Rename a project (merges if the target already exists) |
Global flags (--db-path) go before the subcommand; subcommand-specific flags go after.
MCP Configuration
Copilot CLI / VS Code
Add to your MCP settings (.vscode/mcp.json or global config):
{
"servers": {
"memgram": {
"command": "uv",
"args": ["run", "--directory", "/path/to/memgram", "memgram"],
"env": {
"MEMGRAM_DB_PATH": "~/.memgram/memgram.db"
}
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"memgram": {
"command": "uv",
"args": ["run", "--directory", "/path/to/memgram", "memgram"],
"env": {
"MEMGRAM_DB_PATH": "~/.memgram/memgram.db"
}
}
}
}Claude Code
Add to .claude/settings.json or project-level .mcp.json:
{
"mcpServers": {
"memgram": {
"command": "uv",
"args": ["run", "--directory", "/path/to/memgram", "memgram"],
"env": {
"MEMGRAM_DB_PATH": "~/.memgram/memgram.db"
}
}
}
}Scoping Model
Memgram uses a two-dimensional scoping system: project + branch.
Dimension | Purpose | Example |
| Isolates knowledge per codebase/repo |
|
| Isolates knowledge per feature branch |
|
Both are optional and normalized (lowercased, non-alphanumeric stripped): feature/auth-flow becomes featureauthflow.
How scoping works:
No project, no branch — item is fully global
Project only — item scoped to that project, visible on all branches
Project + branch — item scoped to that specific branch
Retrieval behavior:
get_rulesandget_resume_contextuse NULL-inclusive matching: when you passbranch="featureauth", you get items wherebranch='featureauth'plus items wherebranch IS NULL(branch-global items). This means project-wide rules always surface regardless of which branch you're on.searchandlist_sessionsuse exact matching: only items matching the specified branch are returned.
Guidance:
Use
branchfor feature-specific decisions, temporary workarounds, and branch-only contextOmit
branchfor project-wide truths (coding standards, architecture decisions, persistent rules)When a branch merges, its branch-scoped knowledge stays in the DB but stops surfacing (since no one queries that branch anymore)
Tools
Session Management
Tool | Branch | Description |
| yes | Begin a session. Returns resume context (last snapshot, pinned items, rules). |
| — | Close with structured summary (decisions, files, next hints). |
| — | Compaction checkpoint — goal, progress, blockers, next steps. |
| yes | Everything needed to resume: session, snapshot, rules, project summary. |
Knowledge Management
Tool | Branch | Description |
| yes | Store a thought (observation, decision, idea, pattern, note). |
| yes | Modify an existing thought. |
| yes | Learned pattern — do/don't/context-dependent with severity. |
| — | Bump a rule's confidence when re-confirmed. |
| yes | Log a failure: what broke, why, how to fix. |
| — | Connect items (informs, contradicts, supersedes, related, caused_by). |
Search & Retrieval
Tool | Branch | Description |
| yes | FTS5 full-text search across all tables with relevance scoring. |
| yes | RAG-style vector similarity search (requires stored embeddings). |
| — | Store a vector embedding for an item. |
| yes | Get active rules for a context (project, branch, severity, keywords). |
| yes | Past sessions with summaries. |
| — | Items linked via the thought graph. |
| — | Living project overview. |
| — | Update project overview, tech stack, patterns, goals. |
Groups & Maintenance
Tool | Branch | Description |
| yes | Create a named cluster (e.g., "authentication system"). |
| — | Add items to a group. |
| — | Remove item from group. |
| yes | Get group with all member details. |
| — | Pin/unpin — pinned items always load in resume context. |
| — | Archive — excluded from search by default. |
Architecture
src/memgram/
├── server.py # MCP server entry point (stdio) + CLI subcommands
├── models.py # Data models
├── utils.py # ID generation, timestamps, name normalization
├── export.py # Export engine (markdown, web, PDF)
├── db/
│ ├── __init__.py # create_db() factory
│ ├── base.py # DatabaseBackend ABC + MemgramDB business logic
│ └── sqlite.py # SQLite + FTS5 + sqlite-vec backend
└── tools/
├── __init__.py # Tool registration & dispatch (normalization choke point)
├── sessions.py # Session management tool definitions
├── knowledge.py # Knowledge management tool definitions
└── search.py # Search/retrieval/groups/maintenance tool definitionsDatabase
Default location: ~/.memgram/memgram.db
12 tables: sessions, thoughts, rules, compaction_snapshots, thought_links, error_patterns, project_summaries, session_summaries, thought_groups, group_members, embedding_meta + a sqlite-vec virtual table for vector search.
Existing databases are auto-migrated: the branch column is added to the 7 relevant tables on startup (idempotent). Existing rows get branch=NULL, which works seamlessly.
Environment Variables
Variable | Default | Description |
|
| SQLite database path |
|
| Embedding vector dimensions |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Persistent memory for AI assistants. Save once; recall from Claude, ChatGPT, or any MCP client.
Persistent personal memory for AI assistants — save, search, and recall across every MCP client.
Hosted memory for AI agents over MCP. One memory shared by all your agents.
Related MCP Servers
- AlicenseCqualityBmaintenanceProvides persistent, local-first AI memory across sessions via MCP tools for storing, searching, and retrieving context from past interactions.3175 PyPI1MIT
- AlicenseNot gradedqualityCmaintenanceProvides persistent, multi-project memory for AI agents via MCP, enabling them to store and retrieve tasks, decisions, errors, checkpoints, and documentation while keeping context isolated by project.2MIT
- AlicenseBqualityCmaintenanceProvides AI agents with durable, searchable project memory, session notes, skills, and bounded context packs over MCP while leaving orchestration to the client.15MIT
- AlicenseNot gradedqualityBmaintenanceProvides persistent memory for AI coding agents, enabling them to save, search (hybrid vector/BM25/concept graph), list sessions, and forget memories via MCP tools.11 npmApache 2.0