Purpose: True Memory Fragments (TMF) is used to prevent AI coding agents from acting on old context after the code has changed. It binds declarations such as functions, classes, calls, reads and writes, inheritance, and API relationships to source-code fingerprints. During retrieval, it first performs a work-tree freshness check. Expired or unknown edges stop graph expansion and return an explicit re-read signal, rather than silently reusing old memory.
Main capabilities: source-bound declaration storage and work-tree freshness checks; conservative Python function/class/declaration/configuration/API nodes and partial call, read, and write relationships; optional Java tree-sitter syntax nodes and conservative inheritance edges; bounded fragment queries (4 hops/64 nodes/128 edges) with four stop semantics: boundary, asynchronous, expired, and limit; explicit refresh_path and warm maintenance operations; local metrics and exact-blob-only rename detection.
Usage: Requires Python 3.10+ and Git. Run the demo from a source checkout: python3 scripts/demo_stale_gate.py, which creates a temporary Git repository, derives declarations, modifies bound source code, and demonstrates expired omission, source fallback, and re-read guidance. Install the preview version: pip install true-memory-fragments==0.1.0rc6; Java parsing support is optional: pip install "true-memory-fragments[java]==0.1.0rc6". MCP registration, warm index, and agent usage rules do not automatically register Claude Code's PreToolUse hook; the reflex diagnostic command must be run according to the documentation.
Applicable scenarios: AI coding agents working across sessions on changing repositories; developers who need source-aware memory rather than stale cached facts; tool authors who want conservative graph expansion and explicit handling of expired/unknown results.
Limitations: Freshness only means that bindings match the current source code; it does not mean correctness. Correctness still comes from the source code and verification. Enforcement interception depends on the host, configuration, and the action being intercepted, and does not automatically block all writes. General token savings and production readiness have not yet been proven. Conservative parsing only connects what can be parsed; unknown, dynamic, or ambiguous facts are omitted or marked unresolved. The repository contains Java qualification suites 46/46 and 731/731 checks; the historical audit baseline of 478/478 tests is not the current total. The current version is 0.1.0rc6 release candidate.version selection.