Repository navigation
Design Future Architectures
Status: Brainstorming / Planning Phase Note: The concepts below are solid core ideas currently undergoing refinement. They represent the next logical leaps for A.I.M.'s scale and deployment mechanics.
Goal: Prevent subagent (contractor) noise from polluting the Prime Agent's long-term memory, while keeping the architecture lean and avoiding database bloat.
A.I.M. is shifting towards a "Prime Architect vs. Ephemeral Contractor" model.
- The Prime Architect (Forever Session): The main agent runs in a continuous, long-lived session. It holds the high-level context, makes architectural decisions, and relies on aggressive garbage collection (The Cascading Sieve) to keep its context window clean over time.
- The Contractors (Subagents): Highly specialized agents spun up for specific, tactical tasks (e.g., auditing Rust code, investigating a file, running a test suite). They execute the task, return a report, and are then "killed."
Currently, subagents generate their own massive JSON transcripts in the temporary CLI folder. If these transcripts are mirrored to archive/raw/, they are picked up by the Librarian (tier1_hourly_summarizer.py).
This means a subagent's frantic, trial-and-error terminal thrashing gets permanently baked into the Daily Log, polluting the Prime Architect's memory and bloating the Engram DB.
Idea: Give every subagent its own SQLite database (engram_rust_auditor.db).
Why we rejected it: Too much infrastructure overhead. It breaks the simplicity of Sovereign Sync (translating one DB to JSONL) and makes it difficult for the Prime Agent to query across domains if needed.
Idea: Add an agent_id column to the engram.db and run complex SQL DELETE commands when the subagent dies.
Why we rejected it: Leaves "ghost" fragments if the cleanup script fails. Requires constant SQL filtering to prevent cross-contamination hallucinations.
We must balance the need for absolute historical truth against the need for a lean, unpolluted Engram DB. We achieve this by separating the Storage layer from the Refinement layer.
-
The Panopticon Archive (
archive/raw/):-
session_porter.pymirrors 100% of all active sessions (Prime Architect AND all Subagents) into the raw archive. - Why: Because the Gemini CLI natively compresses and destroys raw history at 50% context capacity. The Panopticon ensures every single keystroke, tool call, and hallucination is saved permanently for forensic auditing.
-
-
The Contractor Tag:
- Whenever a subagent is dispatched, its initial prompt includes a hidden metadata tag (e.g.,
[EPHEMERAL]).
- Whenever a subagent is dispatched, its initial prompt includes a hidden metadata tag (e.g.,
-
The Bouncer (
tier1_hourly_summarizer.py):- Instead of dropping the file at the Porter level, the "Bouncer" logic is moved to the Tier 1 Librarian.
- When the Librarian wakes up to summarize the raw archive, it checks the transcript. If it sees the
[EPHEMERAL]tag, it skips the file.
-
The Result:
- The subagent's raw JSON is saved forever in
archive/raw/(The Historical Truth). - But the subagent's noise never reaches the Daily Log, the Memory Proposals, or the
engram.db(The Refined Soul).
- The subagent's raw JSON is saved forever in
Goal: Prevent maintaining two separate Git repositories (Gemini vs. Codex) while ensuring the agent environment is perfectly tuned to the specific CLI architecture.
The Gemini CLI uses real-time, streaming hooks (AfterTool), while the Codex CLI uses batch hooks (agent-turn-complete). Maintaining a branch or a completely separate repository just to handle these "Edge Adapters" creates massive code duplication and maintenance debt.
Instead of shipping both sets of instructions/hooks natively, we build one Universal Repository that acts as a chameleon.
-
The Interrogation (The Fork): When the user runs
setup.shoraim init, the installer explicitly asks:"Select your AOS environment:" 1. Gemini CLI (Streaming Hooks) 2. Codex CLI (Batch Hooks)
-
The Environment Build: Based on the selection,
aim_init.pyacts as a package manager:-
If Gemini: It generates
GEMINI.md, installs thehooks_gemini/Python scripts, and wires~/.gemini/settings.json. -
If Codex: It generates
AGENTS.md, installs thehooks_codex/Python scripts, and wires~/.codex/hooks.json.
-
If Gemini: It generates
-
The Cleanup: Once provisioned, the installer permanently deletes the unused files from the workspace (e.g., if Codex is chosen, it deletes
GEMINI.mdand the Gemini hooks directory).
- The core logic (
engram.db, Semantic Search, Distiller, TUI) remains identical and unified in one GitHub repository. - The local execution environment slims down instantly, avoiding false promises. The repository doesn't pretend to work for both simultaneously—it formally mutates itself into the chosen architecture upon installation.
- Determine the exact tagging syntax we want to enforce for subagents (Idea 1).
- Map out the exact folder structures for separating
hooks_gemini/andhooks_codex/in the universal repository (Idea 2).
- 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)