This document is the design outline for the repo-graph, intent-native memory, resource-ingestion, retention-supervision, and privacy-receipt additions introduced with schema version 3.
flowchart LR
Agent["Agent / host LLM"] --> Intent["remember · link · recall"]
CLI["engraphis-graph CLI"] --> Service["MemoryService"]
MCP["27 MCP tools"] --> Service
HTTP["Dashboard + read-only graph HTTP"] --> Service
Import["Local resources / PostgreSQL catalog"] --> Extractors["Optional local extractors"]
Extractors --> Service
Service --> Engine["MemoryEngine"]
Engine --> Recall["Hybrid recall\nvector + lexical + layered graph"]
Engine --> Resolver["ADD · NOOP · INVALIDATE"]
Engine --> Code["Incremental code index\nAST + regex fallback"]
Engine --> Retention["Optional retention supervisor"]
Recall --> SQLite[("One SQLite file")]
Resolver --> SQLite
Code --> SQLite
Retention --> SQLite
SQLite --> Layers["Temporal · Entity · Causal · Semantic"]
SQLite --> Bridge["Code ↔ Memory links"]
SQLite --> Receipts["Hashed receipt chain"]
SQLite --> History["Bi-temporal history"]
- One service contract. MCP, REST, the dashboard, the CLI, and the read-only server call
MemoryService; none implements independent memory semantics. - One database, logical graph overlays.
edges,mem_links, andcode_edgescarry alayertag (temporal,entity,causal, orsemantic). Filters select overlays without creating separate stores. - Structural and experiential knowledge stay normalized. Code symbols remain in
symbols/code_edges; memories remain inmemories;code_memory_linksconnects them. Re-indexing can replace a changed file without copying memory text or losing history. - Incremental code indexing.
code_filesrecords content hashes. Unchanged files are skipped, changed files are transactionally replaced, deleted files are removed only after a complete scan, and bounded/truncated scans never delete unseen state. - Offline community analysis. Weighted label propagation identifies structural communities without adding an igraph/Leiden dependency to the core. Degree, cross-file degree, god-node flags, and surprising cross-file relationships feed impact analysis.
- Intent-native recall.
intent_recallmaps cognitive intents such asexplain,summarize history, andlocate codeonto layered graph traversal plus normal vector/lexical recall. Existingengraphis_remember,engraphis_link, andengraphis_recallremain the canonical MCP primitives, avoiding duplicate APIs. - Local resource adapters. Text, code, HTML, and DOCX use the standard library. PDF, image OCR, audio/video transcription, and PostgreSQL introspection are optional backends. Missing tools fail actionably; nothing uploads implicitly.
- Advisory retention supervision. A host or configured LLM may classify a write as
ephemeral,normal, orcritical. The engine clamps importance/stability and records the decision; it never silently discards or hard-deletes a memory. - Privacy-safe receipts. Remember/link/recall and indexing operations append content-free, SHA-256-chained receipts with an independently maintained local head/count anchor. Raw memory/query text, workspace names, IDs, and actor identities are excluded from the exported payload. A previously exported head/count can be supplied during verification to anchor the chain outside the database.
- Team-safe exposure. The full dashboard retains its existing auth/role controls. The
optional
engraphis-graph-serverexposes only read operations and refuses a non-loopback bind without a bearer token.
- Layer columns on
edges,mem_links, andcode_edges; durable rationale onmem_links. code_filesfor incremental indexing.code_memory_linksfor code/experience traversal.operation_receiptsplusreceipt_chain_headsfor the privacy-safe hash chain and tail anchor.symbols.docstringfor extracted documentation.
Migration is additive and idempotent. Pre-v3 edge layers are inferred exactly once; explicitly selected layers are never reclassified when a database is reopened.
engraphis-graph index -w acme -r api --root .
engraphis-graph search -w acme -r api "UserService"
engraphis-graph query -w acme -r api "where is token rotation implemented?"
engraphis-graph explain -w acme -r api "why does deploy depend on approval?"
engraphis-graph path -w acme -r api UserService DatabasePool
engraphis-graph impact -w acme -r api --root . --git-range origin/main...HEAD
engraphis-graph prs -w acme -r api --base main --head HEAD
engraphis-graph export -w acme -r api -o engraphis-graph-outexport writes graph.json, graph.html, and GRAPH_REPORT.md. A local union merge driver can
be installed with:
engraphis-graph install-merge-driver --root .pip install "engraphis[documents]" # PDF + image OCR bindings
pip install "engraphis[transcription]" # faster-whisper
pip install "engraphis[postgres]" # psycopgFor transcription, set ENGRAPHIS_WHISPER_MODEL to a local model path or an explicitly chosen
model name. For PostgreSQL CLI ingestion, set ENGRAPHIS_POSTGRES_DSN; the value is never stored.