engram-mcp
engram-mcp provides persistent semantic memory for AI agents, storing and retrieving memories across sessions using SQLite and local Ollama embeddings (nomic-embed-text) — no API keys or cloud services required.
Store memories
remember: Save session memory entries with automatic embedding and graph extractionremember_user: Store user-scoped memories (facts, preferences) that persist across all sessions
Retrieve memories
recall: Semantic search across session memories (falls back to keyword search); can blend in cross-session user facts viauserIdrecall_user: Search or retrieve all user-scoped memories from any session contexthistory: Get recent conversation history for a session in chronological ordergraph: Query extracted entity relationships and source memories (requiresENGRAM_GRAPH=1)
Manage memories
forget: Delete session memories — all, by ID, or before a dateforget_user: Delete user-scoped memories by ID, date, or all at onceconsolidate: Compress old working session memories into dense long-term summaries via LLM, archiving originals (supports dry-run preview)consolidate_user: Consolidate user-scoped working memories into long-term summaries
Monitor memories
stats: Session memory counts broken down by role, tier (working/long_term/archived), and graph datauser_stats: Memory statistics for a specific user across all sessions
@cartisien/engram-mcp
Persistent semantic memory for AI agents — MCP server powered by @cartisien/engram
Give any MCP-compatible AI client (Claude Desktop, Cursor, Windsurf) persistent memory that survives across sessions.
npx -y @cartisien/engram-mcpWhat it does
Exposes 5 tools to any MCP client:
Tool | Description |
| Store a memory with automatic embedding |
| Semantic search across stored memories |
| Recent conversation history |
| Delete one memory, a session, or entries before a date |
| Memory statistics for a session |
Memories are stored in SQLite. Semantic search uses local Ollama embeddings (nomic-embed-text) — no API key, no cloud. Falls back to keyword search if Ollama isn't available.
Related MCP server: Mnemo Cortex
Quick Start
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"engram": {
"command": "npx",
"args": ["-y", "@cartisien/engram-mcp"],
"env": {
"ENGRAM_DB": "~/.engram/memory.db"
}
}
}
}Restart Claude Desktop. You'll see remember, recall, history, forget, and stats available as tools.
Cursor / Windsurf
Add to your MCP config:
{
"mcpServers": {
"engram": {
"command": "npx",
"args": ["-y", "@cartisien/engram-mcp"]
}
}
}Configuration
Env Var | Default | Description |
|
| SQLite database path |
|
| Ollama base URL for embeddings |
Local Embeddings (Recommended)
Install Ollama and pull the embedding model:
ollama pull nomic-embed-textSemantic search activates automatically. Without Ollama, keyword search is used.
Example Usage
Once connected, your agent can:
remember(sessionId="myagent", content="User prefers TypeScript over JavaScript", role="user")
recall(sessionId="myagent", query="what are the user's coding preferences?", limit=5)
# Returns: [{ content: "User prefers TypeScript...", similarity: 0.82 }, ...]
history(sessionId="myagent", limit=10)
stats(sessionId="myagent")
# { total: 42, byRole: { user: 20, assistant: 22 }, withEmbeddings: 42 }Part of the Cartisien Memory Suite
@cartisien/engram— core memory SDK@cartisien/engram-mcp— this package, MCP server@cartisien/extensa— vector infrastructure (coming soon)@cartisien/cogito— agent identity & lifecycle (coming soon)
MIT © Cartisien Interactive
Available Tools
17 toolsconsolidateB
Consolidate old working memories into dense long-term summaries via LLM. Archives originals.
Inputs: sessionId (required), batch, keep, dryRun.
consolidate_userB
Consolidate user-scoped working memories into long-term summaries.
Inputs: userId (required), batch, keep, dryRun.
daily_summaryA
Returns a summary of memories for a given date (YYYY-MM-DD), or today if omitted.
Inputs: sessionId (required), date.
export_memoriesB
Export all session memories as markdown or JSON.
Inputs: sessionId (required), format.
forgetA
Delete session memories. Delete all, one by ID, or entries before a date.
Inputs: sessionId (required), id, before.
forget_userB
Delete user-scoped memories.
Inputs: userId (required), id, before.
graphA
Query the knowledge graph for an entity — returns relationships and source memories. Requires ENGRAM_GRAPH=1.
Inputs: sessionId (required), entity (required).
historyA
Get recent conversation history for a session in chronological order.
Inputs: sessionId (required), limit.
recallA
Retrieve relevant memories via semantic search (falls back to keyword). Searches working + long_term tiers. Pass userId to blend in cross-session user facts.
Inputs: sessionId (required), query (required), limit, userId, +1 more.
recall_by_timeA
Query memories using natural language time expressions like "yesterday", "last week", "this morning", "before 3pm".
Inputs: sessionId (required), expression (required), limit.
recall_recentA
Get the N most recent memories for a session — no query needed.
Inputs: sessionId (required), limit.
recall_userB
Recall user-scoped memories — works from any session context.
Inputs: userId (required), query, limit.
rememberB
Store a memory entry for a session. Embeddings and graph extraction happen automatically.
Inputs: sessionId (required), content (required), role, metadata.
remember_userA
Store a user-scoped memory that persists across all sessions. Use for preferences, identity, long-term facts.
Inputs: userId (required), content (required), role, metadata.
statsB
Memory statistics for a session — total, by role, by tier (working/long_term/archived), graph counts.
Inputs: sessionId (required).
temporal_statsB
Returns temporal statistics about when memories were created — frequency over time, most active periods.
Inputs: sessionId (required).
user_statsB
Memory statistics for a user — total, by role, by tier.
Inputs: userId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool has a clear, distinct purpose. Tools are separated by scope (session vs. user), operation (remember, recall, forget, consolidate, stats, export, graph, history), and retrieval method (semantic, time-based, recent). No overlapping functionality.
All tools follow a consistent verb_noun pattern (e.g., recall_user, forget, stats). Variations like recall_by_time, recall_recent use predictable suffixes. No mixing of naming conventions.
17 tools is appropriate for a memory management system. The number covers all necessary operations (CRUD, search, statistics, export, graph, user-scoped variants) without being excessive.
The tool set covers core memory operations: store, retrieve (multiple methods), delete, consolidate, export, and statistics. An explicit update tool is missing, but consolidation serves as an update mechanism. Minor gap, but overall comprehensive.
Maintenance
Related MCP Connectors
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Persistent memory for AI agents. Search, store, and recall across sessions.
Memory system for AI agents with semantic search. Store and recall memories with ease.
Related MCP Servers
- AlicenseAqualityAmaintenancePersistent AI memory with SQLite hybrid search (FTS5 + semantic), built-in Qwen3 embedding, and rclone sync across machines.1515 npm12Apache 2.0
- AlicenseNot gradedqualityBmaintenancePersistent semantic memory for AI agents — hybrid SQLite + FTS5 with DAG-based summaries, context compaction, and 7 MCP tools. Open source, self-hosted, zero API cost.160MIT
- AlicenseAqualityBmaintenancePersistent memory for AI agents with sectioned entries (project/user/context/etc), semantic search, CLI, and per-project scope. Local JSON, zero config, no server required.185MIT
- AlicenseNot gradedqualityDmaintenancePersistent semantic memory for AI agents, enabling storage, semantic search, knowledge graph connections, and inter-instance messaging across conversations using local models via Ollama.50MIT