Repository navigation
The Eureka Protocol
⚠️ STATUS: CONCEPTUAL ARCHITECTURE The Eureka Protocol is currently a theoretical blueprint for A.I.M. and is not yet implemented in the live Antigravity codebase. It serves as a foundational "North Star" for how we plan to automatically eliminate context collapse in future IDE versions.
The "Eureka Protocol" is an advanced context-management architecture designed to eliminate "Context Thrashing" in long-horizon LLM sessions. It borrows heavily from the "MMO Botter" philosophy: when a pathfinding algorithm hits walls before finding the door, it doesn't save the wall-hits; it only saves the final efficient route.
Currently, if an agent spends 15 turns and 40,000 tokens debugging an issue that ultimately requires a 1-line code change, the entire history of trial-and-error, hallucinations, and dead ends becomes permanently lodged in the active context window of the IDE. This degrades subsequent reasoning ("Lost in the Middle") and bloats future token payloads.
The Eureka Protocol solves this by implementing Hindsight Pruning: dynamically detecting when thrashing has resolved into an answer, isolating the solution, and gracefully forcing an IDE context reset with only the distilled truth remaining.
The protocol requires a mechanism to detect when a complex, high-thrash operation has resolved into a simple, highly-efficient answer. This can be triggered via The Cognitive Trigger (Self-Awareness).
The Agent is instructed via its Core Mandate to output an explicit <EUREKA> XML tag when it realizes an overcomplicated task actually had a simple solution.
Example: "Wow, I spent 10 turns reading the entire database schema, but the fix was just a missing comma in the .env file. <EUREKA>"
Because Modern IDEs do not allow background Python scripts to retroactively delete specific middle sections of an active chat window, A.I.M. adapts this via the /reincarnate Slash Workflow:
-
Identify Origin: When
<EUREKA>is detected, a background file-system watcher flags the immediate need for a context reset. - Hindsight Pruning (Markdown Parsing): Once the user triggers an explicit export of the IDE chat, a deterministic python script isolates the originating User Prompt and the final Verified Solution. It actively drops the intermediate trial-and-error turns (failed tool calls, error tracebacks).
-
Synthetic Injection: It writes the newly synthesized
Problem -> Solutionpair intocontinuity/CURRENT_PULSE.mdand signals the user to close the bloated IDE chat and open a fresh window.
To the LLM's active working memory, the session history is fundamentally altered upon wake-up in the new window.
-
Before Eureka:
- User: "Fix the routing bug."
- Agent: [20 turns of reading, failing, debugging, and thrashing]
- Agent: "Fixed it, just a typo."
-
After Eureka (New IDE Window):
- Agent immediately reads
CURRENT_PULSE.md: "Historical Context: User asked to fix routing bug. Agent analyzed the routing configuration and found a typo on line 42. Applied the 1-line fix."
- Agent immediately reads
A defining difference between the Eureka Protocol and competing long-context frameworks is the stark contrast between narrative summarization and Problem/Solution hyperfixation.
Other systems attempt to "compress" context by having an LLM write a summary of the struggle:
"The user asked to fix the routing bug. I tried updating the router, but it caused a 500 error. I then checked the database schema, but it was fine. Finally, I found a typo on line 42 and fixed it."
This approach is flawed:
- It costs expensive API tokens to generate the summary.
- It permanently pollutes the Deep Memory (RAG) database with "hallucination vectors" (the AI will now retrieve the irrelevant database schema information the next time it searches for routing bugs).
The Eureka Protocol uses Zero-Token Python Extraction.
We do not ask an LLM to summarize the conversation. Instead, a deterministic Python script intercepts the IDE Markdown export. It surgically extracts the exact originating User Prompt, pairs it with the exact final AI block containing the <EUREKA> tag, and deletes everything else.
This hyperfixation creates a mathematically perfect, zero-noise Problem -> Solution pair.
🔴 Note: The DataJack injection protocol is currently decapitated on Windows.
When implemented, the Eureka Protocol does not just erase history; it archives it. When the Python extractor prunes the context, it takes the isolated Problem -> Perfect Solution pair and hands it to a dedicated background agent.
This agent silently forges that pair into a .engram cartridge. This turns the active agent's trial-and-error struggles into zero-noise, highly valuable knowledge cartridges that can be seeded to the wider Git swarm, ensuring no agent ever makes that same mistake twice.
- Atomic Architecture (The KISS Manifesto)
- Origin Story
- The Logic Of A.I.M.
- The A.I.M. Handbook (Operator's Manual)
- The Swarm Post Office (Comms Interface)
- The Master Schema
- Waterfall Memory Architecture
- Technical Specification
- Script Map (Core Codebase Map)
- Brain Map (Memory Architecture)
- A.I.M. Prompt Injection Map
- AI Prompt Ledger
- Onboarding Identity Map
- Handoff Architecture Guide
- Reincarnation Map
- TUI Map (Cockpit UI Logic)
- The Global Chalkboard (Concept: Document Data Bus)
- Remote Fleet Architecture (Concept: The Phantom Keyboard)
- The Eureka Protocol (Concept: Live Context Pruning)
- The Sovereign Swarm (Concept: BitTorrent DataJack)
- The Decoupled Brain (Concept: Obsidian Transport Layer)
- Obsidian Bridge Architecture
- Layered Engram Architecture
- The Pragmatic Feature Manifesto
- The Cascading Memory Engine
- Hybrid RAG (Semantic + Lexical)
- Cognitive Routing
- The DataJack Protocol
- Runbook Engram Creation
- The GitOps Bridge
- Feature Quarantine Daemon
- The 30 Percent Rule
- TUI Handoff Report
- The Universal Skills Framework
- Vibe Coding Pipelines (Automated Agentic Assembly)
- Cartridge Farming Ecosystem
- Design Future Architectures
- The Collective Cortex (Vision: SETI@home for AI)
- Sovereign Swarm (P2P) (Architecture: P2P DataJack)
- Eureka Protocol & Synapses (Protocol: Synthetic Data Factory)