How sdidsa/engram works
ENGRAM is a continual-knowledge system: constrained-language input is executed as deterministic plans over a persistent bitemporal knowledge base, with retrieval and evidence-based verification producing answers. Documents can be acquired into staging, corroborated, and committed; knowledge and procedures also have separate induction and lifecycle management paths. The graph retains the major documented capabilities, but many edges rely on imports named in the SOURCE INDEX or README descriptions rather than inspected call sites; uncertain wiring is omitted.
Main entry points: executor.py Plan executor · sqlite_store.py Bitemporal store · pipeline.py Document acquisition · service.py Procedure proposals
Components 25
Language interface
- Constrained grammar
src/engram/interface/grammar.py - Model interface
src/engram/interface/llama.py
Execution and knowledge
- Plan executor
src/engram/engine/executor.py - Typed plans
src/engram/engine/plans.py - Multi-step programs
src/engram/engine/program.py - Datalog inference
src/engram/engine/inference.py - Belief revision
src/engram/knowledge/revision.py - Truth maintenance
src/engram/knowledge/dependencies.py - Bitemporal store
src/engram/store/sqlite_store.py - Version models
src/engram/store/models.py
Acquisition and evidence
- Document acquisition
src/engram/acquisition/pipeline.py - Fact corroboration
src/engram/acquisition/corroborate.py - Evidence retrieval
src/engram/retrieval/service.py - Answer verification
src/engram/verification/service.py - Faithfulness checks
src/engram/verification/faithfulness.py
Learning and lifecycle
- Knowledge induction
src/engram/induction/stage.py - Procedure proposals
src/engram/procedure/service.py - Procedure runner
src/engram/procedure/runner.py - Procedure candidates
src/engram/procedure/candidates.py - Procedure staging
src/engram/procedure/stage.py - Knowledge lifecycle
src/engram/lifecycle/service.py - Warm archive
src/engram/store/archive.py - Raw content store
src/engram/store/rawstore.py
Other components
- User
- Language model
Connections 35
- User → Model interface: provides query
README.md - Model interface → Constrained grammar: constrained decoding
README.md - Model interface → Plan executor: submits plans
- Plan executor → Typed plans: executes plans
src/engram/engine/executor.py - Plan executor → Multi-step programs: dispatches programs
src/engram/engine/executor.py - Plan executor → Datalog inference: invokes inference
src/engram/engine/executor.py - Plan executor → Belief revision: uses knowledge services
src/engram/engine/executor.py - Plan executor → Truth maintenance: uses dependency graph
src/engram/engine/executor.py - Plan executor → Document acquisition: dispatches imports
src/engram/engine/executor.py - Plan executor → Evidence retrieval: dispatches retrieval
src/engram/engine/executor.py - Plan executor → Answer verification: dispatches verification
src/engram/engine/executor.py - Plan executor → Procedure proposals: dispatches proposals
src/engram/engine/executor.py - Plan executor → Knowledge lifecycle: dispatches lifecycle
src/engram/engine/executor.py - Datalog inference → Bitemporal store: queries recursive CTE
src/engram/engine/inference.py - Datalog inference → Typed plans: compiles plan atoms
src/engram/engine/inference.py - Document acquisition → Fact corroboration: corroborates facts
src/engram/acquisition/pipeline.py - Document acquisition → Evidence retrieval: indexes facts
src/engram/acquisition/pipeline.py - Document acquisition → Bitemporal store: stages and commits
src/engram/acquisition/pipeline.py - Document acquisition → Raw content store: stores source content
src/engram/acquisition/pipeline.py - Evidence retrieval → Bitemporal store: reads facts
src/engram/retrieval/service.py - Evidence retrieval → Answer verification: supplies evidence
- Answer verification → Faithfulness checks: checks grounding
src/engram/verification/service.py - Answer verification → Evidence retrieval: uses evidence access
src/engram/verification/service.py - Answer verification → Bitemporal store: reads fact versions
src/engram/verification/service.py - Datalog inference → Truth maintenance: records support
- Procedure proposals → Procedure runner: runs procedures
src/engram/procedure/service.py - Procedure proposals → Procedure candidates: generates candidates
src/engram/procedure/service.py - Procedure proposals → Procedure staging: stages proposals
src/engram/procedure/service.py - Procedure proposals → Bitemporal store: reads and writes
src/engram/procedure/service.py - Procedure runner → Datalog inference: evaluates rules
src/engram/procedure/runner.py - Procedure runner → Bitemporal store: reads current view
src/engram/procedure/runner.py - Knowledge induction → Bitemporal store: stages knowledge
- Knowledge lifecycle → Bitemporal store: manages persisted state
- Knowledge lifecycle → Warm archive: archives history
- Bitemporal store → Version models: materializes versions
src/engram/store/sqlite_store.py