Shared Memory for Local AI: The Codacus LLM Wiki + OKF System Breakdown
Traditional vector databases (RAG) are notoriously fragile for personal agents: embeddings lose temporal context, chunk retrieval is probabilistic, and running vector indexes adds compute overhead. In his landmark investigation "Every Local AI I Run Now Shares ONE Memory", engineer Codacus introduced the LLM Wiki + OKF (Open Knowledge Format). It stores structured human-readable Markdown files as an interconnected graph on the local filesystem, letting multiple independent agents read, cross-reference, and update one unified memory in real time.
The Problem: The "Amnesia Silo" in Local AI
If you run a local AI stack, you likely use multiple models and interfaces:
- Claude Code / Cline: Writing code in your IDE.
- Ollama / Open WebUI: Brainstorming and technical chat.
- Voice Assistant: A local whisper-based agent on your desktop.
- Background Automation: An n8n agent categorizing emails.
Each of these tools lives in total isolation. If your coding assistant refactors your database schema, your voice assistant has no idea. If you tell your chat model about an upcoming project deadline, your IDE agent is completely blind to it.
How Codacus Solved It: The LLM Wiki Architecture
Instead of injecting millions of dense vector floats into a ChromaDB or Milvus collection, Codacus constructed a deterministic, file-system-native Wiki structure:
~/.local-ai-memory/
βββ index.md # Master entity index & tag map
βββ entities/
β βββ projects.md # Active projects, stack decisions, milestones
β βββ people.md # Collaborators, contacts, communication rules
β βββ infrastructure.md # Server IPs, GPU specs, local ports, paths
βββ daily/
β βββ 2026-09-15.md # Raw conversational append-log
β βββ 2026-09-16.md # Incremental diffs and updates
βββ graph.json # Lightweight entity-relationship cache
The 3-Step OKF Synchronization Engine
The brilliance of the Open Knowledge Format (OKF) is that any LLMβfrom a lightweight 7B model to Qwen 27Bβcan read and write to it with standard tool calls:
1. The "Read-Before-Act" Hook
When any agent starts a task, a lightweight bash or Python hook passes index.md and relevant entity files directly into the system prompt. Because Markdown is token-efficient, the memory load rarely exceeds 600β900 tokens.
2. Structured Write Diffs (No Hallucinatory Overwriting)
Agents do not overwrite the master files directly. Instead, when an agent learns a new fact (e.g., "Akshat migrated to swappiness=25"), it emits a structured OKF diff to the daily log:
```okf:update
entity: infrastructure.md
target_section: Kernel & Memory Tweaks
action: append
payload: - 2026-09-16: Swappiness set to 25 and page-cluster to 0. Verified stable.
```
3. Nightly Compaction Loop
At 2:00 AM, a cron job spins up a local model for 90 seconds. It processes the daily append-logs, resolves conflicts, and consolidates the knowledge graph into the primary entity files.
Empirical Results: RAG vs. LLM Wiki
- Recall Accuracy: 99.4% on exact personal facts (vs 74.2% on standard cosine-similarity vector RAG).
- Query Latency: 0ms vector lookup overhead (direct file read into prompt context).
- Portability: 100% human-readable Markdown. You can open, edit, or git-sync your memory in Obsidian, VS Code, or GitHub.