engram

MCP Tools

All 11 engram MCP tools reference

MCP Tools

Engram provides 11 MCP tools through a TypeScript server. The server translates calls into JSON requests to the Rust core via Unix socket.

memory_store

Saves a new memory record. When cosine similarity > 0.95 with an existing record, updates it instead of creating a duplicate.

{
  "context": "Situation where the action occurred",
  "action": "Decision or action taken",
  "result": "Result or outcome",
  "memory_type": "decision",
  "tags": "auth,refactor",
  "project": "my-project"
}
ParameterTypeRequiredDescription
contextstringyesSituation context
actionstringyesAction or decision
resultstringyesResult
memory_typeenumnodecision (default), pattern, bugfix, context, antipattern
tagsstringnoComma-separated tags
projectstringnoProject identifier

Finds relevant records using hybrid search: 70% vector (HNSW cosine) + 30% full-text (BM25 FTS5).

{
  "query": "authentication middleware architecture",
  "limit": 10,
  "project": "my-project"
}
ParameterTypeRequiredDescription
querystringyesSearch query
limitnumbernoMaximum results (default 10)
projectstringnoFilter by project

memory_judge

Rates a memory's quality. Feeds the Q-Learning router to improve future searches.

{
  "memory_id": "uuid",
  "query": "the query that found this memory",
  "score": 0.8
}
ParameterTypeRequiredDescription
memory_idstringyesMemory UUID
querystringnoSearch context
scorenumbernoScore from 0.0 to 1.0

Scoring guide:

  • 0.8-1.0 — directly solved the problem
  • 0.5-0.7 — useful context, partially relevant
  • 0.1-0.4 — tangentially related, not very helpful

memory_status

Returns system status: memory count, index size, pending judgments.

{}

memory_config

Reads current configuration. Writing config via MCP is not supported (error code 6008).

{
  "action": "get"
}
ParameterTypeRequiredDescription
actionenumnoget (default) or set

memory_export

Exports all active memories as portable JSON. Binary fields (embeddings, indexed, superseded_by) are excluded.

{}

memory_import

Imports memories from exported JSON. Merge mode: skips duplicates by ID. Imported memories get indexed=false and require reindexing.

{
  "version": 1,
  "memories": [
    {
      "id": "uuid",
      "memory_type": "decision",
      "context": "...",
      "action": "...",
      "result": "...",
      "score": 0.0,
      "tags": "tag1,tag2",
      "project": "my-project",
      "created_at": "2025-01-01T00:00:00Z",
      "updated_at": "2025-01-01T00:00:00Z",
      "used_count": 0
    }
  ]
}
ParameterTypeRequiredDescription
versionnumberyesExport format version (must be 1)
memoriesarrayyesArray of memory objects

memory_consolidate_preview

Finds deduplication candidates without applying changes. Does not call LLM.

{
  "stale_days": 30,
  "min_score": 0.3
}
ParameterTypeRequiredDescription
stale_daysnumbernoStale threshold (days)
min_scorenumbernoMinimum score

memory_consolidate

Analyzes candidates with LLM. Returns merge/keep recommendations.

{
  "stale_days": 30,
  "min_score": 0.3
}

memory_consolidate_apply

Applies consolidation recommendations: merge, delete, archive.

{
  "stale_days": 30,
  "min_score": 0.3
}

memory_insights

Manages derived knowledge (insights) generated by the trainer.

{
  "action": "list"
}
ParameterTypeRequiredDescription
actionenumnolist (default), generate, delete
idstringnoInsight UUID (for delete action)

Actions:

  • list — show all active insights
  • generate — run trainer to analyze patterns
  • delete — delete insight by ID (verifies memory_type = 'insight')