Concepts

PAREL's architecture is built around a few key ideas: a tiny kernel that only dispatches, plugins that provide all capabilities, 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 know about models, tools, or memory. Every capability is a plugin.

The kernel runs a turn loop: receive a user message, call the model, execute tools, repeat until the model says it's done (or budget/step limits are hit).

# Plugins

Everything in PAREL is a plugin:

TypeWhat it doesExamples
ModelLLM provider adapteranthropic, openai
SandboxCode execution environmente2b, local
MemoryContext managementrolling-summary
BudgetCost/step limitsbudget-cap
SecurityInput/output filteringsecurity-basic
ChannelExternal I/Ochannel-api

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:

FieldDescription
idUnique session identifier (Durable Object ID)
statusrunning, completed, or failed
historyFull message history (user, assistant, tool calls/results)
stateTurn 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 lifecycle
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. The config parser supports sugar syntax that expands to plugin declarations:

sugar → expansion
# Sugar:
agent:
  model: "anthropic:claude-sonnet-4"

# Expands to:
plugins:
  - plugin: "@parel/model-anthropic"
    config:
      model: "claude-sonnet-4"
See agent.yaml reference for the full configuration format.