XNews

OpenWiki Self-Correcting Memory System

OpenWiki Self-Correcting Memory System

OpenWiki, a project by LangChain, has developed a self-correcting memory system that addresses the problem of knowledge becoming outdated when source code changes. The system structures wiki content as claims bound to versioned evidence from code. Its three-layer design includes: grounding (every factual claim is linked to supporting code with version tracking), staleness detection (comparing stored evidence versions against current versions to flag potentially outdated claims), and a correction loop (stale claims are re-verified and either refreshed or corrected). Staleness detection runs deterministically without model calls, making it fast even with thousands of claims. The correction loop is integrated into normal wiki updates—agents encounter stale claims when reading pages and handle them as part of regular work, creating a cost model that scales with code changes rather than total claims. In evaluation, the system reduced stale claims from 80 to 9 and eliminated all hallucinated claims (15 to 0).

Key insights

Long-Term Memory Requires Knowing When to Forget

The critical capability in memory systems is not just storing information but knowing when information is no longer trustworthy. Current agent memory discussions focus on creation and retrieval, but neglect the problem of memory drift and contamination as source facts change. OpenWiki addresses this by making uncertainty persistent—stale claims remain flagged until verified, rather than being silently discarded.

Deterministic Staleness Detection Enables Scalable Verification

The staleness detection mechanism compares stored evidence versions against current versions without calling any model, making it fast and deterministic. Staleness is derived in real-time rather than stored as state, meaning uncertainty persists naturally until verification occurs. This design ensures that even with thousands of claims, the system can quickly identify which knowledge needs re-examination.

Correction Costs Scale with Code Changes, Not Knowledge Volume

The system's elegant cost model means agents only spend effort on claims affected by actual code changes. Stale claims are presented alongside page content during normal updates, and agents handle re-verification as part of their regular workflow. This avoids the expensive approach of regenerating entire wikis from scratch and instead focuses effort precisely where it's needed.

Source posts