Concepts
PAREL's architecture is built around a few key ideas: a tiny kernel that only dispatches, a first-class model provider layer, runtime plugins, and durable sessions that survive crashes.
# Kernel
The kernel is the scheduler at the center of PAREL. It does nothing but dispatch — it doesn't implement model APIs, tools, or memory. Model providers are selected by the top-level config; runtime capabilities are loaded as plugins.
The kernel runs a turn loop: receive a user message, call the model, execute tools, repeat until the model says it's done (or cost or step limits are hit).
# Plugins
Model providers and runtime plugins are separate extension points:
| Type | What it does | Examples |
|---|---|---|
| Model provider | LLM API adapter | anthropic, openai, openai-responses |
| Sandbox | Code execution environment | e2b |
| Memory | Context management | rolling-summary |
| Budget | Cost and step limits | budget-cap |
| Security | Input/output filtering | security-basic |
Runtime plugins declare lifecycle hooks (before/after model calls, tool execution, context building) and the kernel dispatches to them in order.
# Sessions
A session is a single conversation with an agent. It has:
| Field | Description |
|---|---|
| id | Unique session identifier (Durable Object ID) |
| status | running, completed, or failed |
| messages | Structured transcript with text, reasoning, tool calls, and tool results |
| state | Turn count, step count, token usage, cost |
Sessions run inside Cloudflare Durable Objects — each session gets its own SQLite database for state, with automatic crash recovery via the Workflow API.
# Turns and Steps
A turn starts when the user sends a message and ends when the agent finishes responding. Each turn contains multiple steps:
Turn #1 Step 1: model call → "I'll search for that" + tool_call(bash) Step 2: tool execution → bash result Step 3: model call → "Here's what I found: ..." [turn complete]
Steps auto-checkpoint between executions. If the Worker crashes mid-step, the Workflow resumes from the last checkpoint.
# Configuration
Agents are declared in agent.yaml. Model providers are configured separately from runtime plugins:
version: "1"
agent:
name: research-bot
model:
provider: anthropic
model: claude-sonnet-4-20250514
plugins:
- system-static:
prompt: "You are a research assistant."
- sandbox-e2b