A cognitive operating system for long-horizon autonomous agents
SOMA (Sovereign Operative Memory Architecture) is a four-layer cognitive architecture for autonomous agents that enables long-horizon task completion through:
- L1: Bounded working attention with explicit context management
- L2: Immutable episodic record (audit trail)
- L3: Sovereign persistent knowledge (cross-session memory)
- L4: Environment grounding (IDE, browser, terminal, git)
Key innovation: Somatic Pressure (
Leviathan benchmarks demonstrate SOMA's capabilities on extreme long-horizon tasks:
| Task | Turns | Peak |
Result |
|---|---|---|---|
| TinyC Compiler (from scratch) | 132 | <20% | ✅ Pass |
| Chess Engine (Perft verified) | 99 | <20% | ✅ Pass |
Both completed on free-tier LLM (Gemini Flash Lite) with zero monetary cost.
The minimal reference implementation (~700 LOC, zero dependencies):
npm install soma-liteOr clone directly:
git clone https://github.com/mcarbonell/soma-lite.git
cd soma-lite
node run-agent-lite.js👉 Documentation: soma-lite README
- Paper:
docs/research/SOMA-Paper.pdf - Source:
docs/research/SOMA-Paper.tex - Citation: See
CITATION.cff
Deep dives into specific research directions:
- Mutable Working Memory:
docs/research/research-mutable-scratchpad-l1.md - Synthetic Hippocampus:
docs/research/SOMA_SYNTHETIC_HIPPOCAMPUS_DESIGN.md - Auto-LoRA Consolidation:
docs/research/research-auto-lora-consolidation.md - Sovereign Kernel v9:
docs/research/research-soma-v9-sovereign-kernel.md - Tensor-Level Injection:
docs/research/research-tensor-level-memory-injection.md
- Leviathan Suite:
benchmarks/run-benchmarks.js - TinyC Compiler: Full specification and evaluator
- Chess Engine: Perft verification (depth 1-5)
┌─────────────────────────────────────────┐
│ L1: Bounded Working Attention │
│ ├─ Structured prompt (task + panels) │
│ ├─ Pm dashboard (context pressure) │
│ └─ Agent-controlled reconstruction │
└─────────────────────────────────────────┘
↕ checkpoint/distill
┌─────────────────────────────────────────┐
│ L2: Immutable Episodic Record │
│ ├─ JSONL action ledger │
│ ├─ Milestone history │
│ └─ Session-scoped audit trail │
└─────────────────────────────────────────┘
↕ retrieve/promote
┌─────────────────────────────────────────┐
│ L3: Sovereign Knowledge │
│ ├─ Identity template │
│ ├─ Semantic memory (embeddings) │
│ ├─ File annotations │
│ └─ Knowledge tree │
└─────────────────────────────────────────┘
↕ observe/act
┌─────────────────────────────────────────┐
│ L4: Environment (IDE Suite) │
│ ├─ File tree + editor │
│ ├─ Terminal panel │
│ ├─ Browser panel │
│ └─ Git panel │
└─────────────────────────────────────────┘
SOMA extends beyond the current implementation with six forward-looking directions:
- Mutable Working Memory — Editable scratchpad during inference
- Synthetic Hippocampus — System 1 network for sub-millisecond intuition
- Autonomous LoRA Consolidation — Overnight fine-tuning from experience
- Sovereign Inference Kernel — Tensor-level memory injection
- The Genesis Chain — Self-bootstrapped engineering feat (8 stages)
- Self-Authored Identity — Agent chooses its own frame of reference
See docs/research/ for detailed specifications.
"More context is not equivalent to better cognition."
SOMA is inspired by Sutton's Bitter Lesson: leveraging computation and learning at scale consistently outperforms methods that encode human knowledge.
Applied to agent orchestration:
- ❌ Hard-coded heuristics in orchestrator = ceiling
- ✅ Model's own reasoning with right substrates = scales with compute
This is primarily a research project. Contributions welcome in:
- Bug reports and fixes
- Benchmark improvements
- Research discussions
- Extension implementations
Please open an issue before starting a PR to discuss scope and design.
- SOMA documentation & paper: CC BY 4.0
- soma-lite implementation: MIT License
- Research notes: Open for discussion
Mario Raúl Carbonell Martínez
- GitHub: @mcarbonell
- Email: mrcm.10@outlook.es
If you use SOMA in your research, please cite:
@article{carbonell2026soma,
title={SOMA: Sovereign Operative Memory Architecture},
author={Carbonell Mart{\'i}nez, Mario Ra{\'u}l},
journal={arXiv preprint arXiv:2603.XXXXX},
year={2026}
}See CITATION.cff for full citation metadata.