Repository navigation
Technical Specification
This document provides the literal, metaphor-free engineering specifications for the A.I.M. exoskeleton.
The core memory layer is a local SQLite database utilizing parameterized queries to prevent SQL injection. It implements Hybrid Retrieval (Semantic Cosine Similarity + FTS5 BM25).
Tracks ingestion sources and provides chronological metadata.
-
id(TEXT PRIMARY KEY) -
filename(TEXT NOT NULL) -
mtime(REAL NOT NULL) -
indexed_at(TIMESTAMP DEFAULT CURRENT_TIMESTAMP)
Stores the actual semantic chunks.
-
id(INTEGER PRIMARY KEY AUTOINCREMENT) -
session_id(TEXT NOT NULL) - Foreign Key tosessions(id)ON DELETE CASCADE -
type(TEXT NOT NULL) - e.g., 'foundation_knowledge', 'expert_knowledge', 'user_prompt', 'model_response' -
content(TEXT NOT NULL) -
timestamp(TEXT) -
embedding(BLOB) - 768-dimensional float array packed viastruct(Nomic standard). -
metadata(TEXT) - JSON string containing tool call arguments or routing data.
An FTS5 virtual table synchronized via 3 SQLite triggers (AFTER INSERT, AFTER DELETE, AFTER UPDATE) on the fragments table to provide zero-latency exact-match keyword search (BM25 algorithm).
The distillation pipeline operates to drastically reduce token payload before semantic embedding.
The extract_signal.py script targets massive raw JSON session files generated by the CLI. It physically strips out all ANSI color codes, verbatim stdout dumps, and system metadata, leaving only the "Signal Skeleton" (Intents, Tool Calls, and Outputs).
Compression ratios vary based on the ratio of "terminal noise" to "architectural logic" in a given session.
-
Sample A (Heavy Terminal Execution - 50+ Turns):
- Raw Payload: 8.76 MB
- Signal Skeleton: 1.39 MB
- Result: 6.44x Compression
-
Sample B (Standard Debugging Session):
- Raw Payload: 270.70 KB
- Signal Skeleton: 62.98 KB
- Result: 4.30x Compression
- Conclusion: The pipeline reliably achieves between a 4.3x and 8.5x reduction in token weight depending on task verbosity, allowing secondary distillation models (e.g., Gemini Flash, Ollama) to process long-term memory for fractions of a cent.
Zero-Token Filtering:
-
extract_signal.pyparses.gemini/tmp/.../chats/*.json. - It strips all conversational filler, tool arguments, tool results, and massive JSON structures.
-
The Signal Skeleton: Leaves only the high-level intent (
role: user) and the technical output (role: model/gemini). This reduces context weight by up to 85% before the LLM ever sees it.
3.1 Cartridge Format (.engram)
Standard ZIP archives containing:
-
metadata.json(Title, Author, Target Tiers, Hash) -
chunks/*.jsonl(Pre-embedded text fragments and FTS5 data)
3.2 Injection Pipeline
When aim jack-in <file> is executed:
-
Security Sandbox: A.I.M. parses the
.jsonlfiles natively. It does not execute raw SQL scripts. -
Parameterized Insertion: Fragments are loaded via
sqlite3using explicit parameterization to prevent SQL injection:INSERT INTO fragments (session_id, type, content, timestamp, embedding, metadata) VALUES (?, ?, ?, ?, ?, ?) -
Operator Consent: The operator is presented with the
metadata.jsondetails and must explicitly typeyto execute the database write.
A.I.M. uses Timestamped Archive Branching (archive-<branch>-<datetime>) instead of Git Tags during the Phase Protocol. This is a deliberate, non-standard design choice. AI CLI agents struggle to navigate detached HEAD states and git reflog recovery. Explicit archival branches provide safe, verifiable "Save States" that an AI can easily list, checkout, and restore from without breaking the local git tree.
- 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)