An RLM-native terminal coding and research harness built around a persistent IPython kernel, recursive subagents, and a multi-process local runtime.
Prime Agent is a terminal-based AI coding and research harness that takes a fundamentally different approach: instead of giving the model dozens of separate tools, it gives it one — a persistent IPython kernel — and lets it compose everything as code.
One built-in tool — ipython — replaces dozens of specialized tools. The model reads files, runs commands, edits code, and delegates work all through a persistent Python kernel.
The model can spawn child agents natively via rlm() calls. Each child gets fresh context, inherits capabilities, and runs independently — enabling true parallel work.
Python state survives across turns and compaction. Variables, imports, functions, and parsed data remain available. Sessions persist as tree-structured JSONL files.
A daemon-backed architecture isolates each session in its own process. Workers continue running after you close the terminal. Crash recovery is built-in.
Add capabilities via Agent Skills (markdown or Python-backed). MCP integrations, extensions, themes, and packages create a rich ecosystem without bloating the tool surface.
Heartbeats, scheduled prompts, persistent goals, autonomous mode, and automatic compaction make Prime Agent ideal for long-running, multi-step work.
From zero to a working Prime Agent session in under a minute.
Install on Linux or macOS with a single command:
curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh
Use your subscription or set an API key:
# Option A: Subscription login
prime-agent
/login
# Option B: API key
export ANTHROPIC_API_KEY=sk-ant-...
prime-agent
Run it in your project and just start talking:
cd /path/to/project
prime-agent
> Summarize this repo and tell me how to run its checks
The Python kernel runtime is set up automatically on first invocation. Set PRIME_AGENT_KERNEL_PYTHON to use an existing Python environment with ipykernel.
The four foundational ideas that make Prime Agent different from every other coding agent.
Prime Agent's default runtime exposes one built-in model tool: ipython. Reading files, editing code, running commands, transforming data, invoking skills, and delegating work all begin from the persistent kernel — not from dozens of separate tool calls.
This means the model doesn't waste context switching between tools. Everything is Python. The model can inspect its environment, build helper functions, compose operations, and maintain working state — exactly like a human developer would in a notebook.
from pathlib import Path
# Python state persists across turns
config_files = list(Path(".").rglob("*.toml"))
large_files = [p for p in config_files if p.stat().st_size > 10_000]
# Run project commands
%%bash
npm run check
The callable rlm object is preloaded in the kernel. Spawn a child agent with a direct Python call. It returns immediately after task admission — never the child's answer.
The TypeScript host creates a normal child AgentSession with an independent context and session directory. The child inherits the parent's model, providers, skills, tools, and retry policy.
# Spawn independent children — end turn, don't await
api_review = await rlm("Review the public API", name="api-reviewer")
test_review = await rlm("Review the test coverage", name="test-reviewer")
# Children reply via agent_message when done
# Results arrive as ordinary messages in later turns
The parent keeps its context focused while children receive only the context needed for their subtasks. This is true parallel fan-out — not sequential tool calls.
The RLM programming model assumes useful work may take many turns — or continue after the terminal UI closes:
Prime Agent supports the Agent Skills markdown format and extends it with Python-backed skills. Only skill metadata enters the startup prompt — the full SKILL.md loads on demand when a task matches.
A Python-backed skill installs a package into the kernel environment, so the model can import and call it directly — making Python-backed skills a superset of instruction-only skills.
# Call a Python-backed skill directly
report = await release_audit(repository=".", target_version="0.4.0")
Prime Agent separates terminal presentation, process coordination, agent execution, model-facing Python, and persisted state. Click each layer to explore.
Each layer in Prime Agent has clear ownership boundaries. The client owns rendering, the supervisor owns routing, workers own sessions, and IPython is the model's control environment.
Recursive Language Model (RLM) is the programming model at the heart of Prime Agent. The model works inside a persistent Python environment and composes capabilities as code.
Python skills use typed host requests for capabilities whose authoritative state belongs outside the kernel. Provider calls, session persistence, child lifecycles, scheduling, and safety policy remain in the TypeScript host. IPython is purely the model-facing programming surface.
When the model delegates work via await rlm("subtask"), the call travels through a Jupyter comm target to the TypeScript host, which creates a real child AgentSession.
Model calls rlm("subtask") in IPython
Python shim sends host.request via Jupyter comm
AgentSession checks depth, resolves model, admits child
Returns spawn handle immediately — never the answer
Child runs independently, replies via agent_message
Prime Agent's extension model keeps the tool surface minimal while enabling unlimited capabilities through skills, extensions, and MCP integrations.
Self-contained capability packages following the Agent Skills standard. Each skill provides a SKILL.md with on-demand instructions, setup steps, and reference docs.
---
name: my-skill
description: Use this skill when the user asks about X.
---
# My Skill
## Steps
1. Do this
2. Then that
A superset of markdown skills with a Python package installed into the kernel. The model can import and call documented functions directly — typed callables, scripts, and dependencies included.
# Model calls it directly:
result = await my_skill.run(
param="value"
)
help(my_skill) # inspect API
TypeScript modules that add custom tools, commands, keyboard shortcuts, event handlers, UI components, permission gates, custom compaction, and more.
export default function(api) {
api.registerTool({
name: "deploy",
...
});
}
Connect external services (Linear, Notion, ...) over the Model Context Protocol. Each integration is a Python skill — not a new model tool — keeping the single-tool design intact.
import linear
issues = await linear.list_issues(
team="Engineering"
)
~/.prime/agent/skills/ · ~/.agents/skills/.prime/agent/skills/ · .agents/skills/skills/ directories in Prime Agent packagesprime-agent (lowest precedence)Prime Agent saves conversations as tree-structured JSONL files with in-place branching, compaction, and recovery.
Every entry has an id and parentId. Navigate to any previous point, continue from there, and switch between branches — all in a single file. No data is lost.
When conversations grow too long, compaction summarizes older messages while preserving recent work. The kernel state persists through compaction.
Powerful slash commands for managing your work:
/tree Navigate session tree/fork Branch from any point/clone Duplicate active branch/compact Summarize old context/resume Browse past sessions/share Upload as gistPrime Agent combines daemon-backed workers with persistent state, scheduled prompts, direct messaging, goals, and bounded autonomous continuations.
Closing the terminal detaches the client — it doesn't stop the worker. Sessions continue running. Reconnect anytime with prime-agent attach.
Recurring instructions that re-enter a session on a schedule. User-owned /heartbeat or agent-managed rlm_heartbeat.
Durable objectives that persist across turns until complete. Track token usage, elapsed time, and continuation count.
Bounded host policy for unattended runs. Continues until quality gates pass or limits (turns, tokens, time) are reached.
The daemon routes messages between active sessions. Send from CLI: prime-agent send, or from kernel: agent_message.send().
One-time or cron-based prompts for any agent. Persisted per session, continue while detached. prime-agent schedule.
Prime Agent supports 30+ providers through subscription login or API keys. Use any model from any supported provider.
Essential commands for working with Prime Agent.
prime-agent Start interactive sessionprime-agent -c Continue most recentprime-agent -r [id] Resume or browse sessionsprime-agent -p "prompt" Print mode (one-shot)prime-agent list List active agentsprime-agent attach <agent> Attach to agentprime-agent stop <agent> Stop one agentprime-agent shutdown Stop all agents--provider <name> Select provider--model <pattern> Select model--thinking <level> off/minimal/low/medium/high/model Switch models interactively--autonomous Enable autonomous mode--autonomous-gate Quality gate command--autonomous-max-turns Turn limit/autonomous on Toggle interactivelyPrime Agent를 한국어로 더 깊이 알아볼 수 있는 추가 자료입니다.