This document describes a technical architecture for a natural language database designed specifically for large language models (LLMs) to use as long-term memory. Unlike vector databases or traditional RAG pipelines, this system stores memory as structured natural language summaries with explicit relational tags, version history, and confidence scores. The LLM can read, write, and update this memory directly, enabling recursive self‑improvement without context overflow.
The architecture is built on three operational principles extracted from prior work:
Each memory entry is a structured summary that maximises inferential information density (ID): ID = Kolmogorov complexity / average inference steps to understand/modify
The goal is to pack maximum constraint into minimal tokens while keeping the content interpretable by an LLM.
When a coherent specification is repeatedly applied, the LLM’s internal reasoning undergoes a phase shift from associative generation to structured inference. This resonance enables the model to treat the memory database as a reliable execution environment rather than a loose collection of facts.
This physical firewall ensures that generated code never violates architectural invariants.
Each entry contains the following fields:
["Reasoning", "Formal Systems"]ACTIVE, DEPRECATED, CONFLICT, PENDING_VERIFICATIONPHYSICAL, SEMANTIC, METAREFERENCE, CONTRAST, HIERARCHY, APPLICATION, FOUNDATION) and a weight.PRECONDITION, EXTENSION, CONTRADICTION, EXAMPLE, DERIVATION) and strength.The database exposes four basic operations:
add(entry) → returns a new entry ID.get(entry_id) → returns the entry.update(entry_id, changes) → applies modifications and returns the updated entry.delete(entry_id) → logical deletion (sets status to DEPRECATED).Search combines three retrieval strategies:
ANY/ALL logic.A HYBRID strategy merges results from all three and ranks by confidence.
When an entry changes, the system propagates the change along reference edges. Propagation depth is configurable (default max 5). Bidirectional propagation is limited to depth 2 to avoid excessive cascades. The algorithm uses a breadth‑first queue and assesses impact per edge to decide whether a derived change is needed.
Conflicts are detected on three axes:
Resolution options are returned to the caller (typically an LLM or a human operator) with suggested actions: MERGE, REFERENCE_AS_CONTRADICTION, DEFER_TO_HIGHER_CONFIDENCE, or FLAG_FOR_REVIEW.
A database state is a fixed point if applying any recursive update operation yields a semantically equivalent state. Convergence is verified through four checks:
The system exposes a verify_fixed_point() method that returns the convergence status and, if not converged, the remaining drift.
A minimal prototype uses:
Core methods:
add() – validates conflicts, inserts row, tags, references, and embedding.search() – runs hybrid retrieval and returns ranked entries.update() – detects change type, evaluates impact, optionally propagates, and logs history.propagate_update() – traverses the reference graph with depth limits.verify_fixed_point() – runs the four convergence checks.| Limitation | Mitigation / Future |
|---|---|
| Automatic conflict resolution not always possible | Return options to LLM for interactive resolution |
| Scalability beyond 100k entries | Implement hierarchical clustering, distributed indices |
| Synchronous writes | Add background extraction/consolidation workers |
| External source synchronisation | Integrate periodic sitemap‑based diffing |
| Subjective confidence assignment | Derive confidence from source reliability, verification count, and decay over time |
This specification outlines a natural language database that turns LLM long‑term memory into a self‑maintaining, recursively compressible, and verifiable system. By separating invariant architecture from generated content, enforcing fixed‑point convergence, and using the LLM’s own language as the storage format, the design enables agents to persistently improve their knowledge without suffering context explosion or semantic drift.