SuperAPI AI Directory

Prime Agent - Prime Intellect's open-source long-horizon AI Agent runtime framework

Author: AI小集 · Original source: AI工具集

What is Prime Agent

Prime Agent is an open-source long-horizon AI Agent runtime framework from Prime Intellect. Through RLM (Recursive Language Model), it turns context into variables and sub-agents into functions, and with the Continual Harness it enables continuous accumulation of task experience and self-evolution. Prime Agent supports persistent IPython, resuming after disconnection, and parallel scheduling of multiple Agents. It improved performance on ARC-AGI-3 from 30% to 95.5%, and is open-sourced under the MIT license.

Prime Agent

Prime Agent's main features

  • Persistent IPython environment: Using the IPython REPL as the only built-in tool, file operations, Shell commands, and data processing are all performed through code. Variables and state persist across rounds, avoiding repeated serialization of large amounts of raw text.
  • Parallel scheduling of multiple sub-agents: Through the rlm() function, it dynamically generates sub-agents with independent contexts and kernels, supporting asynchronous parallel execution and result return, making it suitable for multi-dimensional analysis of large code repositories.
  • Task experience accumulation and self-iteration: With the /refine instruction to review task trajectories, it saves proven effective processing logic as prompt supplements, memory fragments, reusable skills, or sub-agent configurations. It supports reuse within a session or globally across sessions, and provides snapshot rollback capability.
  • Autonomous task mode with resume after disconnection: A background Daemon process hosts all sessions. After the terminal is closed, tasks, IPython state, and sub-agent processes continue running, and reconnecting lets you check progress. It supports persistent goals, heartbeat detection, and scheduled inspections.
  • Rich model ecosystem compatibility: It supports one-click installation on macOS and Linux, is compatible with subscription services such as ChatGPT, Claude, and GitHub Copilot, and can also connect to various third-party large models via API Key.

Prime Agent's technical principles

  • Recursive Language Model (RLM): The abstraction treats context as a programmable variable (prompt-as-a-variable), and treats tool calls and the generation of recursive sub-agents as function calls. The model stores intermediate results in variables and calls them directly. Sub-agents are asynchronously generated through rlm() and return a stable handle, allowing the parent Agent to continue local computation, mitigating context bloat under long tasks at the architectural level.
  • Continual Harness: As a revisable persistent state layer, it stores supplementary prompts, memories, skill descriptions, and sub-agent specifications. The Agent uses /refine to make small, versioned updates to these states based on trajectory evidence. All improvements act on the mutable Harness state in the form of incremental patches, never modifying the immutable underlying system prompt, while also supporting version-based rollback to prevent erroneous experience from being固化.
  • Four-layer information hierarchy (L0–L3): Model weights (L0) are updated through fine-tuning; active Token context (L1) is compressed and rewritten through Compaction; persistent REPL and sub-agents (L2) are managed through Agentic GC for creation, retention, and cleanup; historical, memory, and skill data stored on disk (L3) are updated with versioning through Refinement. This hierarchy gives the system von Neumann-like architectural characteristics, enabling the model to read, write, transform, and persist addressable state beyond its own weights.
  • Direct Agent-to-Agent communication: The Daemon maintains an asynchronous message queue. Agents can send messages directly to parent nodes, child nodes, and sibling nodes without all messages having to be relayed through the user. The decentralized communication mechanism enables multi-agent collectives to coordinate dynamically rather than following a fixed workflow graph, while also allowing humans to inspect, attach to, and intervene in any session node through the Agents View.
  • Daemon background process hosting: All sessions are owned by a Daemon process independent of the client. Session state, including event history, kernel snapshots, the session tree, the message queue, and versioned Harness state, is persisted to disk. Client disconnection does not affect task execution and supports re-attach, branch fork, and fault recovery, fundamentally breaking the binding between the Agent lifecycle and the chat window.
Dig into GitHub

Follow WeChat and reply “Open Source” to join theAI Open Source Project Exchange Group

How to use Prime Agent

  • Install: In a macOS or Linux terminal, run curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh for one-click installation.
  • Start: After entering the target project directory, run prime-agent. On first use, run /login to select a subscription service such as ChatGPT or Claude, or enter an API Key to complete authentication.
  • Interact: In the persistent IPython REPL, directly enter natural language instructions or Python code. The Agent will execute commands in the current directory, read and write files, and preserve variable state.
  • Parallel subtasks: Call the rlm() function to dynamically generate child Agents with independent contexts, asynchronously dispatch subtasks such as code review and information retrieval in parallel, and wait for results to be returned.
  • Experience consolidation: After a task is completed, execute the /refine instruction. The Agent automatically reviews the trajectory and saves validated logic as reusable skills, memories, or child Agent configurations.
  • Resume after disconnection: Press Ctrl+D at any time or close the terminal to detach the session. The background Daemon keeps the task running, and you can later reconnect through prime-agent attach <agent> to check progress.
  • Autonomous operation: Enter /autonomous and set a budget for turns, tokens, or time. The Agent autonomously loops within the budget until it passes the quality gate or reaches the limit.
  • Goal tracking: Use /goal to set a persistent goal. The goal and its progress remain active across multiple rounds of dialogue until the Agent marks it complete.
  • Scheduled execution: Through /heartbeat or prime-agent schedule , configure Cron expressions or scheduled triggers so the Agent automatically enters the session periodically to perform inspection tasks.

Core advantages of Prime Agent

  • Long-duration persistent operation: The background Daemon hosts the session. After the terminal is closed, the task and IPython state continue running, and you can reconnect and resume at any time.
  • Context variableization management: Through RLM, context is treated as programmable variables, avoiding repeatedly stuffing massive raw text into the chat window and fundamentally alleviating Token bloat under long tasks.
  • Dynamic parallel child Agents:rlm() The function can asynchronously generate multiple child Agents with independent kernels, enabling decoupling and parallel acceleration of large tasks.
  • Framework-level self-evolution:/refine Distill effective logic from task trajectories into reusable skills and memory, with support for version snapshot rollback, enabling continuous improvement without modifying model weights.
  • Exceptional test-time scalability: On ARC-AGI-3, performance was increased from 30% to 95.5%, proving that additional compute can be efficiently converted into verified task progress.
  • Harness decoupled from the model: Standardized execution, recovery, and resource statistics ensure that task failures stem from the model's capability ceiling rather than the framework losing state or terminating early.
  • Decentralized Agent communication: Sub-agents exchange messages directly through Daemon queues, without all of them having to be relayed by the user, supporting dynamic swarm coordination.

Project address of Prime Agent

  • GitHub repository:https://github.com/PrimeIntellect-ai/prime-agent
  • arXiv technical paper:https://arxiv.org/pdf/2608.23552

Comparison of Prime Agent with similar competing products

Comparison dimension Prime Agent Claude Code
Lifecycle Daemon-hosted in the background; tasks continue running after the terminal is closed, with support for reconnecting after disconnection Bound to the terminal/chat window; terminated when the window is closed
Context management RLM variable-based storage; intermediate results are stored in callable variables to avoid context bloat All information is stuffed into the chat context, making long tasks prone to overflow
Sub-agent scheduling rlm() Dynamically generates independent sub-agents, supporting asynchronous parallelism and direct communication No native sub-agent mechanism; tasks are executed serially
Experience accumulation /refine Saves trajectory experience as reusable skills/memory, effective across sessions No cross-session memory; starts from scratch each time
Autonomous operation Supports /autonomous autonomous looping within budget, including heartbeats and scheduled execution Requires continuous user interaction; no background autonomous mode
Architectural positioning Standardized long-horizon evaluation Harness, open source and extensible Closed-source product, deeply integrated with the Anthropic ecosystem
Information hierarchy Four-level state hierarchy L0–L3 (weights/context/REPL/disk) Only L0 (model) + L1 (context), with no persistent L2/L3
Applicable scenarios Multi-day long-horizon scientific research, large-scale refactoring, parallel analysis Fast coding, debugging, and Q&A within a single session

Application scenarios of Prime Agent

  • Large-scale codebase refactoring and cross-module migration: Uses a persistent REPL and parallel sub-agents to perform multi-dimensional analysis, batch refactoring, and cross-language migration on million-line codebases; tasks can last for days and recover after disconnection.
  • Automation of multi-step scientific research experiments: In machine learning or systems research, automatically performs hyperparameter search, model training, result recording, and paper figure generation, distilling the experimental workflow into reusable skills through /refine .
  • Continuous operations and intelligent inspection of complex systems: Combined with /heartbeat and /goal to set persistent monitoring goals; the Agent automatically logs in to servers, reads logs, detects anomalies, and generates reports on a periodic basis, running in the background 24/7.
  • Long-horizon autonomous exploration in games and simulation environments: In complex sandbox games such as Factorio, multiple sub-agents are respectively responsible for resource gathering, infrastructure planning, and technology research, coordinating through direct communication to advance in parallel and run continuously for dozens of hours.
  • Multi-dimensional code review and parallel test verification: Generate multiple sub-agents for a large PR to respectively perform static analysis, unit testing, integration testing, and security auditing, then aggregate the results after asynchronous parallel completion, significantly improving review efficiency.