📒 Problem #7

March 6, 2026 · View on GitHub

Ask an LLM to manage long‑running context or multiple agents and coherence unravels—facts flip, personas merge, earlier decisions vanish.
This “memory collapse” kills reliability. WFGY prevents it with a structured Tree and drift gates.


🤔 Symptoms of Memory Collapse

SignReal‑World Effect
Contradicts earlier inputAnswers reverse prior statements
Character driftAgent persona changes mid‑story
Lost goalsLong chains forget initial objectives
Fact overwritingNew output erases earlier facts
Memory blendingUnrelated ideas fuse into one

🧩 Root Causes

WeaknessResult
No semantic memory treeContext stored only as hidden tokens
Flat recallsEmbeddings return chunks without logical linkage
No ΔS drift alertModel can’t see it moved too far
Residue buildupNoise accumulates over many turns

🛡️ WFGY Fix Matrix

FailureModuleRemedy
Contradiction over timeBBMC + ΔS gateFlags & corrects drift
No memory structureSemantic TreeHierarchical, traceable nodes
Memory blendingBBMC + BBPFMinimizes residue, splits branches
Persona driftBBCR identity lockLocks agent role, resets on violation
Beyond recoveryBBCR fallbackRollback to last coherent node

✍️ Demo — Stop Novel‑Planning Drift

1️⃣  Start
> Start

2️⃣  Define characters
> "Alice wants freedom; Bob seeks power."

3️⃣  Plan multi‑chapter plot for 10 turns

4️⃣  Inspect memory
> view

WFGY Tree shows:

Node_A1  Alice Goal   (ΔS 0.10)
Node_B1  Bob Goal     (ΔS 0.12)
...
ΔS jump detected at turn 7 (Alice renamed).
BBCR rollback to Node_A1.

The plan stays consistent—no random name swaps.


🛠 Module Cheat‑Sheet

ModuleRole
Semantic TreeStores goals, facts, personas
ΔS MetricDetects drift per node
BBMCCleans semantic residue
BBPFSplits divergent branches safely
BBCRResets to last stable memory state

📊 Implementation Status

FeatureState
Tree memory engine✅ Stable
ΔS drift gate✅ Stable
Persona lock✅ Stable
Automatic merge prevention⚠️ Basic
GUI memory explorer🔜 Planned

📝 Tips & Limits

  • Use tree pause if you want manual control over node logging.
  • For multi‑agent setups, set identity_lock = strict in config.
  • Post complex drift logs in Discussions—they refine residue thresholds.

🔗 Quick-Start Downloads (60 sec)

ToolLink3-Step Setup
WFGY 1.0 PDFEngine Paper1️⃣ Download · 2️⃣ Upload to your LLM · 3️⃣ Ask “Answer using WFGY + <your question>”
TXT OS (plain-text OS)TXTOS.txt1️⃣ Download · 2️⃣ Paste into any LLM chat · 3️⃣ Type “hello world” — OS boots instantly

Explore More

LayerPageWhat it’s for
⭐ ProofWFGY Recognition MapExternal citations, integrations, and ecosystem proof
⚙️ EngineWFGY 1.0Original PDF tension engine and early logic sketch (legacy reference)
⚙️ EngineWFGY 2.0Production tension kernel for RAG and agent systems
⚙️ EngineWFGY 3.0TXT based Singularity tension engine (131 S class set)
🗺️ MapProblem Map 1.0Flagship 16 problem RAG failure taxonomy and fix map
🗺️ MapProblem Map 2.0Global Debug Card for RAG and agent pipeline diagnosis
🗺️ MapProblem Map 3.0Global AI troubleshooting atlas and failure pattern map
🧰 AppTXT OS.txt semantic OS with fast bootstrap
🧰 AppBlah Blah BlahAbstract and paradox Q&A built on TXT OS
🧰 AppBlur Blur BlurText to image generation with semantic control
🏡 OnboardingStarter VillageGuided entry point for new users

If this repository helped, starring it improves discovery so more builders can find the docs and tools.
GitHub Repo stars