Engram

v0.5.0
io.github.devinmlowe/engram Checked 4 days ago Published 2 months ago

Cognitive memory for coding agents: hybrid recall, remember/forget, knowledge graph, nightly dreams.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

recall

Retrieve relevant memories from past Claude Code conversations and extracted knowledge. Uses hybrid semantic + keyword search with token-budgeted output across episodic and semantic memory stores. Search BEFORE every task to recover decisions, solutions, and context. Time-scope with after/before (YYYY-MM-DD) or a natural-language dateHint ("last week", "in March", "this day last year", "on this day"); dateBasis picks whether dates mean when a memory was filed or when the events it describes happened. The applied window is echoed in <date_filter>. Retrieval records access bookkeeping on the ret…

ParameterTypeDescription
query *string
afterstringOnly results after this date (YYYY-MM-DD)
beforestringOnly results before this date (YYYY-MM-DD; that day is excluded)
budgetintegerMax tokens in response
dateBasisstringWhat the dates refer to: 'filed' = when the memory was recorded (memories IN March); 'event' = when the described events happened, via source-exchange timestamps (memories ABOUT March). Episodic resul…
dateHintstringNatural-language date window, resolved in UTC: today, yesterday, this/last week|month|year, N days|weeks|months ago, this day last year, in <month>, <month> <year>, since <phrase>, before <phrase>, on…
depthstring
read_scopesarrayExplicit scopes to read from (e.g. ["global", "hermes:career"]). Overrides ENGRAM_READ_SCOPES for this call only.
reinforcebooleanReinforce the semantic memories this call returns (FSRS: bumps access_count/last_accessed and grows stability). Set false for read-only or diagnostic callers that must not mutate the store.
scopestringTenant identity for this call (e.g. "hermes:career"); reads default to global + this scope. Overrides ENGRAM_SCOPE for this call only.
sourcesarrayWhich memory stores to search. Defaults to episodic and semantic.

remember

Store a fact, preference, decision, or other knowledge as a semantic memory. Use this to explicitly record important information that should persist across conversations. Automatically deduplicates against existing memories.

ParameterTypeDescription
content *stringThe fact, preference, or knowledge to remember
contextstringProvenance note stored alongside the memory (e.g. what produced this write)
importancenumberImportance score (0-1)
scopestringTenant scope to stamp on this write (e.g. "hermes:career"). Overrides the ENGRAM_SCOPE env default for this call only.
sourcestringSource of this memory (user, dream, rlm, import, hermes-mirror)
typestringType of memory

remember_batch

Store multiple facts, preferences, decisions, or other knowledge items as semantic memories in a single call. Supports up to 50 items per batch. Automatically deduplicates against existing memories and within the batch. Use for bulk ingestion from RLM agents or dream pipeline. Optionally link each memory to existing graph entities via relates_to_entities.

ParameterTypeDescription
memories *arrayArray of memories to store (max 50)
scopestringTenant scope to stamp on this write (e.g. "hermes:career"). Overrides the ENGRAM_SCOPE env default for this call only.

show

Read full conversations to extract detailed context after finding relevant results with recall. Use startLine/endLine pagination for large conversations.

ParameterTypeDescription
path *string
endLineinteger
startLineinteger

explore

Explore connections in the knowledge graph starting from an entity. Shows what a concept, tool, project, or technology is connected to. Use after recall to understand how things relate to each other.

ParameterTypeDescription
entity *stringEntity name to explore (e.g., 'TypeScript', 'engram', 'SQLite')
budgetintegerMax tokens in response
depthintegerNumber of hops to traverse (1-3)
limitintegerMax neighbors to return, sorted by weight (1-50)
read_scopesarrayExplicit scopes to read from (e.g. ["global", "hermes:career"]). Overrides ENGRAM_READ_SCOPES for this call only (#25).
relationship_typesarrayFilter by relationship types
scopestringTenant identity for this call (e.g. "hermes:career"); derives the read default global + own

reflect

View emergent patterns and structure in the knowledge graph. Shows topic communities with meaningful names, bridge entities connecting different domains, temporal patterns, and graph health. Use after working on a topic to understand how it connects to other knowledge domains.

ParameterTypeDescription
modestringWhat to reflect on.
refreshbooleanForce a fresh analysis instead of using cached results.

recall_session

Create or continue an iterative search session for multi-step memory exploration. Omit session_id to start a new session; provide session_id to refine with a new query. Sessions track accumulated results and remaining token budget. Use recall_drill to expand individual results. Retrieval records access bookkeeping on the returned memories (access_count, last_accessed, stability); pass reinforce: false to opt out.

ParameterTypeDescription
query *stringSearch query
budgetintegerMax total token budget for this session
read_scopesarrayExplicit scopes to read from (e.g. ["global", "hermes:career"]). Overrides ENGRAM_READ_SCOPES for this call only.
reinforcebooleanReinforce the semantic memories this call returns (FSRS: bumps access_count/last_accessed and grows stability). Set false for read-only or diagnostic callers that must not mutate the store.
scopestringTenant identity for this call (e.g. "hermes:career"); reads default to global + this scope. Overrides ENGRAM_SCOPE for this call only.
session_idstringExisting session ID to refine (omit to create new)
sourcesarrayWhich memory stores to search

recall_drill

Drill into a specific result from a recall session to get expanded context. For episodic results: shows surrounding conversation exchanges. For semantic results: shows source conversation segments. For graph results: shows entity with full relationship neighborhood. Retrieval records access bookkeeping on the returned memories (access_count, last_accessed, stability); pass reinforce: false to opt out.

ParameterTypeDescription
result_index *integer0-based index into session results
session_id *stringSession ID from recall_session
reinforcebooleanReinforce the semantic memories this call returns (FSRS: bumps access_count/last_accessed and grows stability). Set false for read-only or diagnostic callers that must not mutate the store.

explore_selective

Explore the knowledge graph selectively by expanding only branches relevant to specified criteria. Unlike explore (fixed-depth BFS), this uses embedding similarity to prune irrelevant neighbors and recursively follows only relevant paths. Use when you want to find connections related to a specific topic or question.

ParameterTypeDescription
criteria *stringWhat makes a neighbor relevant (e.g., 'build tooling', 'performance optimization')
entity *stringStarting entity name (e.g., 'TypeScript', 'engram', 'SQLite')
max_depthintegerMaximum traversal depth (1-5)
max_nodesintegerSafety cap on total nodes returned (1-50)
read_scopesarrayExplicit scopes to read from (e.g. ["global", "hermes:career"]). Overrides ENGRAM_READ_SCOPES for this call only (#25).
relationship_typesarrayFilter by relationship types
scopestringTenant identity for this call (e.g. "hermes:career"); derives the read default global + own

fetch_snippets

Fetch multiple line ranges from a single file in one call. Ranges are merged when overlapping, padded with optional context lines, and joined with gap markers. More efficient than multiple show calls for targeted code reading.

ParameterTypeDescription
path *string
ranges *arrayLine ranges to fetch (max 20)
contextintegerNumber of padding lines around each range (0-50)
session_idstringOptional session ID for token budget tracking

scan_file

Scan a file server-side with regex patterns and return structured matches with surrounding context. The file is read on the server and never loaded into conversation context. Supports multiple patterns, context windows, overlap deduplication, and function context detection.

ParameterTypeDescription
path *stringAbsolute path to the file to scan
patterns *arrayRegex patterns to search for (max 10)
context_linesintegerLines of context before and after each match (0-10)
deduplicate_overlapsbooleanMerge overlapping context windows to avoid duplicate lines
group_bystringOrder results by file location or grouped by pattern
max_matchesintegerMaximum matches to return (1-500)
session_idstringOptional session ID for token budget tracking

index_file_structure

Parse a source file to extract function, class, and module definitions, then index them as entities in the knowledge graph with 'contains' relationships. Enables RLM to discover file contents without reading the full file.

ParameterTypeDescription
path *stringAbsolute path to the source file to index

commitments

List tracked commitments — first-person promises, intentions and follow-ups owed by others, extracted nightly from conversations ("mention once, never dropped"). Default: pending items, overdue first, then by due date, then newest. Use include_due_within_days to surface only what is due soon or overdue.

ParameterTypeDescription
budgetintegerToken budget for the XML response
include_due_within_daysnumberOnly items with a due date within this many days (overdue items included)
limitintegerMax items
read_scopesarrayExplicit scopes to read from (e.g. ["global", "hermes:career"]). Overrides ENGRAM_READ_SCOPES for this call only (#25).
scopestringTenant identity for this call (e.g. "hermes:career"); derives the read default global + own
statusstringLifecycle state to list

commitments_update

Resolve a tracked commitment once the user confirms it is handled: mark it done, dropped, or superseded by another commitment. Accepts the full id or a unique prefix (6+ characters).

ParameterTypeDescription
id *stringCommitment id (from the commitments tool) or a unique prefix
status *stringResolution
superseded_bystringId of the commitment that replaces this one (required when status is superseded)

ingest_turn

Record one user/assistant turn of an external agent conversation (e.g. a Hermes profile) in engram's episodic layer so it becomes searchable and feeds the nightly dream extraction. Idempotent: re-sending the same session_id + turn_index updates the turn in place. The conversation carries the given tenant scope, and every memory later extracted from it inherits that scope. An optional author {id, name, is_bot} is stored on the turn.

ParameterTypeDescription
assistant_text *stringThe assistant's reply for this turn
scope *stringTenant scope of the conversation (e.g. "hermes:career")
session_id *stringCaller's conversation/session identifier (stable across turns)
turn_index *integer0-based position of this turn within the session
user_text *stringThe user's message for this turn
authorobjectWho authored the user side of the turn (stored as JSON on the exchange)
sourcestringPlatform/source label; part of the conversation key (default "hermes")
timestampstringISO-8601 time of the turn (default: now)
tool_callsarrayTools invoked during the turn (input/output are truncated to 1000 chars)

forget

Remove a memory the user says is wrong or stale. Pass the memory_id from a recall result (<semantic id="…">) to forget it in one call. Pass query instead to search for candidates: the tool returns matching memories with their ids and forgets nothing unless confirm is true AND exactly one memory matches (a single result, or a single result whose content equals the query). The memory is soft-deleted (kept for ENGRAM_FORGET_RETENTION_DAYS, then purged by the dream pipeline), drops out of every recall path immediately, is logged in the change log with this client's name, and will not be re-extra…

ParameterTypeDescription
confirmbooleanIn query mode: forget the match when exactly one memory matches
hardbooleanDelete the row outright instead of the soft delete + retention purge
memory_idstringId of the memory to forget (from recall's <semantic id>), or a unique prefix of 6+ characters
querystringFind candidate memories instead of naming one; returns ids, deletes nothing unless confirm + a single match
read_scopesarrayScopes this call may act on (e.g. ["global", "hermes:career"]). Overrides ENGRAM_READ_SCOPES for this call only.
scopestringTenant identity for this call (e.g. "hermes:career"); reads default to global + this scope. "global" acts on a memory in any scope.