PrimeIntellect-ai/prime-agent

A self-improving RLM agent for coding workflows and long-running autonomous tasks.

Prime Agent – an open‑source self‑improving AI coding assistant

What it is

  • Prime Agent is a command‑line tool that lets a large language model act as a coding and research agent.
  • It builds on two ideas from the authors’ research:
    1. Recursive Language Model (RLM) – the model treats the prompt as a mutable set of variables and can call sub‑agents (other model instances) as if they were functions.
    2. Continual Harness – a durable store for supplemental prompts, memories, skill definitions and sub‑agent specs that can be refined over time.

Key capabilities

  • Persistent Python REPL – the agent runs inside a long‑living Python interpreter, so code, file operations, shell commands, and tool calls are executed directly.
  • Sub‑agents – rlm.spawn(...) creates child agents that work in parallel or in the background and return results programmatically.
  • Skill system – reusable workflows can be packaged as Python packages; the built‑in skill creator turns a pattern into a “skill” that the agent can import later.
  • Background daemon – sessions keep running after you detach the terminal; you can re‑attach with prime-agent attach <id>.
  • Agent‑to‑agent messaging – running agents can discover each other and exchange messages without user mediation.
  • Continual refinement – the /refine command lets the harness store small, evidence‑backed updates (new prompts, memories, skill specs) while keeping the immutable base system prompt untouched. Snapshots enable rollback.
  • Autonomous mode – /autonomous lets the agent keep working within configurable turn, token and time budgets, optionally gated by user‑defined quality checks.
  • Scheduling & heartbeats – built‑in commands (/heartbeat, prime-agent schedule) let the agent re‑enter a session on a timer or at a specific time.

Typical workflow

  1. Install with the one‑line script (Linux/macOS) or PowerShell installer (Windows).
  2. Run prime-agent inside a project directory.
  3. Log in (/login) to provide an API‑key or subscription for the underlying LLM.
  4. Issue commands such as rlm.spawn(...), /goal, /refine, or let the agent run autonomously.
  5. When you disconnect, the daemon keeps the Python state, files, and sub‑agents alive; later you can prime-agent attach to continue.

Safety notes

  • The tool executes model‑generated Python with the same permissions as the user; it is not sandboxed. Users are advised to run it only on trusted codebases or inside an external sandbox.

Installation

curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh
# Windows
irm https://app.primeintellect.ai/prime-agent/install.ps1 | iex

Main commands

  • prime-agent agents – list running/idle/saved sessions
  • prime-agent attach <agent> – re‑attach to a live session
  • prime-agent --resume [path|id] – resume a specific session
  • prime-agent status – view daemon health
  • prime-agent doctor [--fix] – diagnose/repair services
  • prime-agent update – pull the latest release
  • prime-agent shutdown – stop all agents and background services

Where to learn more

License & citation

  • MIT License.
  • Cite the work with the provided BibTeX entry if used in research.

Prime Agent is a genuine open‑source project aimed at enabling long‑running, self‑improving AI‑driven coding and research workflows.

Related

  • Dispatch
  • Project
  • Project
  • Project
  • Project