ashita-ai/engram
A memory system for AI applications that preserves ground truth, tracks confidence, and prevents hallucinations.
What's novel
A memory system for AI applications that preserves ground truth, tracks confidence, and prevents hallucinations.
Code Analysis
9 files read · 3 roundsA layered AI memory system that stores immutable verbatim episodes, extracts structured data via regex and LLM, consolidates into semantic summaries with bidirectional links, and provides multi-type recall with negation filtering, Bayesian confidence scoring, and contradiction detection.
Strengths
Genuinely well-architected with clean separation (encode/recall/consolidation/contradiction as distinct concerns), real algorithmic depth (Beta-Bernoulli Bayesian confidence, map-reduce consolidation with checkpointing, MMR diversity reranking, surprise-based importance scoring), and a thoughtful memory hierarchy (episodic → structured → semantic → procedural) grounded in cognitive science literature. The code is consistently well-documented with docstrings, type hints, and meaningful naming thr
Weaknesses
The consolidation workflow is extremely long (59KB single file) and the storage CRUD layer is 70KB, suggesting some modules could be decomposed further. The LLM-dependent features (contradiction detection, enrichment, consolidation) are tightly coupled to Pydantic AI agents, making it harder to swap providers or test without mocking. Some features like the propagation algorithms and full storage layer couldn't be fully verified due to size.
Score Breakdown
Signal breakdown
Innovation
Craft
Traction
Scope
Evidence
Commits
202
Contributors
1
Files
166
Active weeks
7
Repository
Language
Python
Stars
5
Forks
1
License
MIT