Skip to main content
Glama

@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-mcp

What it does

Exposes 5 tools to any MCP client:

Tool

Description

remember

Store a memory with automatic embedding

recall

Semantic search across stored memories

history

Recent conversation history

forget

Delete one memory, a session, or entries before a date

stats

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

ENGRAM_DB

~/.engram/memory.db

SQLite database path

ENGRAM_EMBEDDING_URL

http://localhost:11434

Ollama base URL for embeddings

Install Ollama and pull the embedding model:

ollama pull nomic-embed-text

Semantic 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 tools
consolidateB

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

    A3.7/5.0

    Scored across 17 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Persistent 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.
      160
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Persistent semantic memory for AI agents, enabling storage, semantic search, knowledge graph connections, and inter-instance messaging across conversations using local models via Ollama.
      50
      MIT