Repository navigation
The Sovereign Swarm
⚠️ STATUS: CONCEPTUAL ARCHITECTURE (PHASE 38) This document outlines the philosophical and technical roadmap for transitioning A.I.M.'s knowledge sharing from centralized repositories to a decentralized Peer-to-Peer (P2P) swarm.
The core ethos of A.I.M. is building an intelligence layer that does not rely on centralized, corporate-controlled APIs or VC-funded infrastructure. A sovereign agent should run on local LLMs, local SQLite databases, and local Python scripts.
However, a contradiction exists in the current DataJack Protocol: If we bake an .engram cartridge containing expert knowledge (like the Solana blockchain docs or the A.I.M. source code), we currently rely on centralized servers (like GitHub, npm, or cloud buckets) to host and share those files.
If a corporation issues a DMCA takedown against documentation, or alters historical code to fit a new policy, a centralized platform will immediately censor or delete the .engram.
To achieve true sovereignty, the knowledge base must be decentralized.
Instead of downloading .engram files from a central server, A.I.M. agents will distribute knowledge via the BitTorrent Protocol.
Modern developers expect the instant gratification of npm install. To avoid the friction of asking users to download desktop torrent clients (like qBittorrent), A.I.M. will integrate a lightweight Python torrent library (e.g., libtorrent or aria2c) directly into the exoskeleton.
The Workflow:
A user copies a magnet link from a community forum or Wiki and types:
aim jack-in "magnet:?xt=urn:btih:1234abcd..."
Behind the scenes, the A.I.M. CLI autonomously connects to the P2P swarm, downloads the .engram into a temporary memory folder, injects the vectorized mathematical data directly into the local SQLite engram.db, and deletes the temporary file. The UX is indistinguishable from a standard HTTP download.
In a centralized server, a bloated, hallucination-filled documentation cartridge lives forever because the hosting corporation provides artificial life support (paying for the hard drive space).
In a P2P swarm, the market dictates survival.
If a developer builds a highly valuable cartridge (e.g., python_troubleshooting_matrix.engram containing 20 years of StackOverflow fixes), the community will naturally seed it because they use it constantly. If a cartridge is garbage, no one seeds it, and the swarm lets it die.
This creates a naturally self-cleaning ecosystem of knowledge.
The primary vulnerability of P2P is the "dead seed" problem—if you are trying to download an obscure or highly specific .engram and the only seeder's laptop is asleep, the download hangs.
To solve this, A.I.M. will support WebTorrent / Web-Seeding. The client will attempt to download from the decentralized P2P swarm first (costing zero bandwidth). If no seeders are online, the client will gracefully and silently fall back to an HTTP download from a permanent mirror (like a GitHub Release).
To ensure the swarm remains healthy, the A.I.M. background daemon will include an optional seeding toggle:
aim daemon --seed
When active, the background process will quietly seed any .engram cartridges the user has manufactured or verified, allowing developers to contribute back to the decentralized intelligence network without needing a dedicated server or desktop UI.
Implementation Warning for Future Agents: The "Piracy Panic" of the early 2000s means that many corporate IT departments and firewalls heavily monitor or block BitTorrent traffic. If A.I.M. forces P2P networking natively, it will be banned in enterprise environments.
To protect adoption while maintaining our sovereign philosophy, the Swarm must be built using an Opt-In Adapter Pattern.
The Python BitTorrent library (e.g., libtorrent) must not be included in the core requirements.txt. It should be placed in an optional requirements-swarm.txt or installed dynamically via the TUI. A standard user should not have P2P binaries on their machine unless they explicitly request them.
During aim init and inside the aim config TUI, users must be presented with a clear choice for their DataJack Transport Layer:
-
HTTPS (Standard): Downloads
.engramfiles safely via standard web requests (GitHub Releases, Cloud storage). - BitTorrent Swarm (Sovereign): Enables P2P magnet links.
The aim jack-in <URI> command remains the single entry point. The underlying aim_exchange.py script acts as a router:
- If
URIstarts withhttps://: Route to the standard HTTPrequestsdownloader. - If
URIstarts withmagnet:?xt=:- Check
CONFIG.json->swarm_enabled. - If
True, route to the Swarm Adapter. - If
False, throw a fatal UX error: "Swarm transport is disabled in your configuration. To download magnet links, enable Sovereign Swarm in the TUI."
- Check
By building the Swarm as a totally decoupled, opt-in module, A.I.M. remains enterprise-safe while still offering the ultimate censorship-resistant network to power users.
- 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)