PARELdocs

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:

TypeWhat it doesExamples
Model providerLLM API adapteranthropic, openai, openai-responses
SandboxCode execution environmente2b
MemoryContext managementrolling-summary
BudgetCost and step limitsbudget-cap
SecurityInput/output filteringsecurity-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:

FieldDescription
idUnique session identifier (Durable Object ID)
statusrunning, completed, or failed
messagesStructured transcript with text, reasoning, tool calls, and tool 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. Model providers are configured separately from runtime plugins:

agent.yaml
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
See agent.yaml reference for the full configuration format.