Prime Agent is a next-generation open-source AI agent designed for automating development, research, and long-horizon autonomous tasks. The project is built on top of the Recursive Language Models (RLM) architecture and the Continual Harness self-learning framework.
Unlike traditional coding assistants and simple CLI wrappers, Prime Agent completely reimagines how LLMs interact with code and local environments:
-
Unified IPython REPL Kernel Instead of Hundreds of JSON Tools:
- The model no longer needs to execute dozens of separate CLI tools (Grep, Edit, Bash, FileRead).
- The agent writes and runs live Python code inside a persistent IPython console. Context, data, and variables persist across execution steps without bloating the LLM's context window.
-
Continual Harness (Cross-Session Memory and Adaptability):
- Conventional AI agents "forget" your project's specific conventions once the terminal session closes.
- Prime Agent stores its instructions, skills, and sub-agent definitions on disk as persistent state. Running
/refinetriggers a self-analysis process: the agent reviews completed work, extracts learnings, and updates its rules to align with your coding style.
-
Recursive Sub-Agents and Direct A2A Communication:
- The agent can spawn sub-agents by executing the built-in
rlm("subtask")function directly inside Python code. - Sub-agents can communicate directly (Agent-to-Agent / A2A), run parallel tasks in the background, and report back to the primary kernel.
- The agent can spawn sub-agents by executing the built-in
-
Background Daemon and Connection Resiliency:
- The architecture is driven by a background daemon. If you close your terminal, disconnect an SSH session, or restart the UI, the agent continues executing the task. You can reconnect to the active session at any time.
-
Record-Breaking Autonomy (Long-Horizon Execution):
- Native support for autonomous mode (
/autonomous), periodic background checks (/heartbeat), scheduled tasks, and persistent objectives (/goal). - On abstract reasoning and complex coding benchmarks (e.g., ARC-AGI-3 and EmulatorBench), Prime Agent achieves above-human expert-level results through recursive subtask decomposition.
- Native support for autonomous mode (
-
Complete Model & Provider Freedom (BYOK & Subscriptions):
- Zero vendor lock-in. Connect your own API keys or subscriptions for Anthropic (Claude), OpenAI (GPT-4o/o3), DeepSeek, Google Gemini, or local models via Ollama/vLLM.
-
Session Tree and Isolation:
- Execution history is continuously saved in a transparent
JSONLformat. The/treecommand allows you to visualize the conversation graph, roll back to any previous state, or fork new execution branches without losing progress.
- Execution history is continuously saved in a transparent
-
100% Open Source & Hackable:
- Fully open-source under the MIT license. Easily extensible using custom TypeScript modules, Python packages, and Model Context Protocol (MCP) tools.
For a seamless GUI experience, prebuilt desktop releases are available for Windows and macOS.
- Go to the Releases section of this repository.
- Download the latest installer:
Prime-Agent-x64.7z. - Run the
.exefile and follow the setup wizard prompts. - Launch Prime Agent from your Desktop shortcut or Start menu.
- (Recommended) Ensure Python 3.10+ is installed on your system and added to your system
PATHfor proper IPython kernel operation.
- Go to the Releases section.
- Download
Prime-Agent.dmg(available for both Apple Siliconarm64and Intelx64). - Open the
.dmgfile and drag the Prime Agent icon into your Applications folder. - On first launch on macOS (if prompted with a security warning):
- Go to System Settings ➔ Privacy & Security.
- Scroll down and click "Open Anyway".
| Command | Description |
|---|---|
/login |
Configure API keys, subscriptions, and select LLM providers |
/goal <text> |
Define a global session goal that the agent continuously tracks |
/refine |
Analyze current session history and persist learned rules/skills to disk |
/tree |
Navigate the conversation tree, inspect branches, and roll back to past states |
/autonomous |
Enable autonomous execution mode with defined time and token budgets |
/heartbeat |
Configure periodic status checks for long-running background tasks |
/compact |
Force context compression while retaining the IPython kernel state |
┌──────────────────────────────────────────────────────────────────┐
│ Prime Agent Daemon │
│ │
│ ┌─────────────────────────┐ ┌─────────────────────────┐ │
│ │ Desktop GUI / CLI TUI │ ◄────► │ IPython REPL Kernel │ │
│ └─────────────────────────┘ └─────────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────────┐ ┌─────────────────────────┐ │
│ │ Continual Harness │ │ Sub-Agents (rlm calls) │ │
│ │ (Skills / Memory State) │ │ & Direct A2A Messaging │ │
│ └─────────────────────────┘ └─────────────────────────┘ │
└──────────────────────────────────────────────────────────────────┘
⚠️ Important: Prime Agent executes model-generated Python code and system commands with the privileges of your local OS user.
- Avoid running the agent with administrative /
rootprivileges.- When working with untrusted or unvetted codebases, run Prime Agent inside isolated environments (Docker, WSL, or DevContainers).
This project is licensed under the MIT License. See the LICENSE file for details.