FidelityMem — Adaptive Hybrid Memory
AI Research
A recall-constrained hybrid memory layer that controls active context, long-term storage, compression and evidence restoration for LLM agents.
Repository overview
Module Role --- --- window.py Adaptive working window: per-message retention score, boundary triggers (token pressure, topic shift, task completion, inactivity), eviction into extraction. extraction.py Candidate memories with types (semantic / episodic / procedural / relational), entities, numbers, dates, negations, relations. validation.py Stage 1 source & consistency (trust, contradiction, supersede-not-delete, untrusted-instruction guard). Stage 2 relevance & utility (durability score, fact-aware dedupe). compression.py Four-level compression ladder and the fidelity gate : probes built from the raw source must survive, or the level backs off. Stage 3. stores/ Immutable archival store (JSONL-persistable), BM25, dense index with a hermetic hashing embedder, relation graph with relation-following expansion and hub penalty, trie for exact/prefix identifiers. retrieval/ Query classification, per-type plans, RRF fusion + ranking function, relation chaining for multi-hop, sufficiency check and raw-source expansion, token-budgeted context. controller.py Recall-constrained policy search over (compression level, top-k, expansion budget, routes) with tuning/hold-out split, promotion, rejec
Project features
- FidelityMem
- What is in the box
- Benchmark
- LLM-judged evaluation (Phase 6)
- needs ANTHROPIC API KEY (or ANTHROPIC AUTH TOKEN / ant auth login )
- plumbing check without a credential
- Status
Architecture inferred from repository structure
The implementation is centered on Python, LLM Agents, Hybrid Retrieval, BM25, RRF. The repository is organized into docs, fidelitymem, scripts areas. Delivery and dependency evidence includes Python project manifest.
Technology
Python · Hybrid retrieval · BM25 · RRF
Repository snapshot
Python · 0 stars · 0 forks · updated 2026-10-22T03:34:17Z
Demos and evidence
- Source and implementation — repository