The most advanced autonomous AI agent for Termux.
Single file. Twelve systems. Zero required dependencies. Runs on your phone.
No existing agent -- OpenClaw, Hermes, CODEY-V2, Kimi K2.6, Hyperagents, MiroThinker -- has all of these in a single file:
| # | Feature | What It Does |
|---|---|---|
| 1 | MARS Meta-Cognitive Reflection | Abstracts principles from mistakes, derives procedures from successes -- improves without online feedback |
| 2 | Hyperagent Architecture | Meta Agent improves Task Agent AND rewrites its own improvement logic -- self-accelerating compound gains |
| 3 | Four-Layer Memory | L1 Core (frozen context ~800 tokens), L2 User Profile (~500 tokens), L3 SQLite FTS5 (searchable history), L4 Skills Library (near-zero token cost) |
| 4 | Closed Skill Extraction | Auto-evaluates every task: >5 tool calls, self-corrected, user corrected, found better path -- extracts as portable agentskills.io markdown |
| 5 | NEXUS Multi-Agent Hiring | Talent Scout (5-signal gap detection), 8-phase Recruiter, Bayesian trust ledger, Shadow Mind parallel intuition |
| 6 | Android Hardware | Camera, screenshot, location, sensors, battery, notifications, clipboard via Termux API |
| 7 | Multi-Model Routing | Routes to optimal Ollama model: phi4-mini (fast), qwen2.5-coder:7b (code), llama3.1 (reason), llava (vision), nomic-embed-text (embed), stable-zephyr:3b (trivial) |
| 8 | Sandboxed Skill Forge | LLM writes Python scripts, tests in sandbox, auto-installs on pass |
| 9 | Simulation Mode | Freezes state, simulates bash commands via LLM prediction, reverts instantly -- zero risk |
| 10 | Pantheon Tools | bash, file read/write, web search, web get, Telegram -- GPTSwarm/Hermes/MothBot/Coreon/OpenClaw integrated |
| 11 | Offline First | Runs entirely on phone via Ollama + Whisper STT + Edge TTS -- cloud is optional fallback |
| 12 | Single File | zeus_prime.py -- 2,677 lines, zero required external deps |
# Install Python
pkg install python
# Install Ollama (required for LLM)
curl -fsSL https://ollama.com/install.sh | sh
# Pull your models
ollama pull phi4-mini
ollama pull qwen2.5-coder:7b
ollama pull llama3.1
ollama pull llava
ollama pull nomic-embed-text
ollama pull stable-zephyr:3b
# Run ZeusPrime
python zeus_prime.py# Make sure Ollama is running
ollama serve &
# Run
python3 zeus_prime.py# For better HTTP (recommended)
pip install httpx
# For voice mode
pip install edge-tts faster-whisper
# For Termux hardware features
pkg install termux-apipython zeus_prime.py # Interactive CLI
python zeus_prime.py --voice # Voice mode (Whisper + Edge TTS)
python zeus_prime.py --simulate # Start in simulation mode
python zeus_prime.py --status # Show agent status & memory stats
python zeus_prime.py --forge "desc" # Create a skill in the Forge
python zeus_prime.py --hire # Run NEXUS talent scout
python zeus_prime.py --config file.json # Custom config| Command | Description |
|---|---|
/status |
System status & stats |
/memory [query] |
Browse or search memory |
/skills |
List extracted skills |
/skill <name> |
Show skill details |
/forge <desc> |
Create a new skill in the Forge |
/sim [on|off] |
Toggle Simulation Mode |
/sim history |
Show simulation history |
/hire |
Run NEXUS talent scout & hire |
/agents |
List hired agents |
/reflect |
Show MARS reflections |
/mars |
MARS engine status |
/voice <text> |
Text-to-speech |
/photo |
Take & analyze photo (Termux) |
/screenshot |
Screenshot & analyze (Termux) |
/location |
GPS location (Termux) |
/battery |
Battery status (Termux) |
/clipboard [txt] |
Get/set clipboard (Termux) |
/config |
Show configuration |
/correct <text> |
Record a correction for learning |
/bash <cmd> |
Execute bash command |
/search <query> |
Web search |
/help |
Help |
+---------------------------------------------------------------+
| ZeusPrime |
+---------------------------------------------------------------+
| MetaAgent (self-rewriting improvement engine) |
| +- MARS Engine (principle + procedural reflection) |
| +- Skill Extractor (closed-loop auto-extraction) |
| +- NEXUS Hiring (talent scout + recruiter + trust ledger) |
| +- Shadow Mind (parallel pattern-based intuition) |
| +- Meta Improvement Log (self-accelerating gains) |
+---------------------------------------------------------------+
| TaskAgent (execution engine) |
| +- OllamaRouter (6-model intelligent routing) |
| +- Pantheon Tools (bash, file, web, telegram) |
| +- Termux Hardware (camera, GPS, sensors, clipboard) |
+---------------------------------------------------------------+
| FourLayerMemory |
| +- L1 Core Memory (frozen project context, ~800 tokens) |
| +- L2 User Profile (preferences, style, corrections) |
| +- L3 Long-term (SQLite FTS5, searchable history) |
| +- L4 Skills Library (markdown, near-zero token cost) |
+---------------------------------------------------------------+
| SkillForge | SimulationMode | OfflineVoice |
| (sandbox + install) | (freeze/revert) | (Whisper + TTS) |
+---------------------------------------------------------------+
- You speak or type a request
- OllamaRouter classifies complexity and routes to the best model
- TaskAgent checks L4 skills for a match, builds context from all 4 memory layers, executes
- After every task, MetaAgent runs 4 improvement strategies:
- MARS reflects (principle from failure, procedure from success)
- Skill Extractor evaluates extraction triggers
- NEXUS scans for coverage gaps, hires specialists if needed
- Self-improvement engine optimizes the improvement process itself
- Gains compound -- each improvement makes future improvements better
ZeusPrime auto-creates ~/.zeus_prime/config.json on first run. Key settings:
{
"ollama_host": "http://localhost:11434",
"model_fast": "phi4-mini",
"model_code": "qwen2.5-coder:7b",
"model_reason": "llama3.1",
"model_vision": "llava",
"model_embed": "nomic-embed-text",
"model_trivial": "stable-zephyr:3b",
"openai_api_key": "",
"whisper_model_size": "base",
"tts_voice": "en-US-GuyNeural",
"wake_words": ["zeus", "hey zeus"],
"max_agents": 8,
"trust_threshold": 0.6,
"forge_timeout": 30
}All persistent data is stored under ~/.zeus_prime/:
| Path | Contents |
|---|---|
memory.db |
SQLite database (L3 memories, task history, reflections) |
skills/ |
Extracted skill documents (L4) |
forge/ |
Skill Forge sandbox scripts |
agents/ |
NEXUS hired agent data |
config.json |
Configuration |
user_profile.json |
L2 user preferences |
trust_ledger.json |
Bayesian trust scores per agent |
mars_reflections.json |
MARS principles & procedures |
meta_improvements.json |
Meta-level improvement log |
zeus.log |
Runtime logs |
MIT