Skip to content
Docs
GitHub

Runnable Examples

Complete Framework programs, maintained and compiled with the everruns crate.

8 min readEdit on GitHub

The crates/everruns/examples catalog contains the maintained public examples. Each imports the everruns facade.

The root-level examples catalog contains eight Framework walkthroughs. Each folder includes the program, instructions, fixtures where applicable, and recording scripts. Run them from a repository checkout: their dependencies point to the workspace crates.

cargo run uses a real provider and can incur charges. CI tests offline tool behavior and recording logic; it does not establish the quality of a live model’s answer.

Example Provider and model What it does
Support Agent OpenAI gpt-6.2-sol Chooses between MFA recovery, lockout, and browser troubleshooting from facts and policy.
Everruns Support Agent Anthropic claude-opus-5-5 Searches and reads citable official documentation snapshots.
Coding Review Agent Anthropic claude-sonnet-5 Reads a refund contract and executes a fixed regression before reporting a defect.
Research Agent OpenRouter z-ai/glm-5.2 Searches and fetches primary sources before writing a cited brief.
Incident Commander Agent Meta Model API muse-spark-1.3 Investigates fixture telemetry and persists an evidence-backed incident update.

Start with Support for typed tools, Research for reusable capabilities, or Code Review for restricted execution. Each walkthrough shows the agent builder and session loop, explains expected behavior, and documents what remains a fixture.

These are in-memory sessions. For durability itself, use the session-history and workspace examples below. Importable hosted Platform definitions live separately as TOML folders in examples/agents. See file-based agents for loading, importing and serving them.

Example Provider and model What it does
Bashkit Repo Agent OpenAI gpt-6.2-sol Cuts a release in a real repository with the sandboxed Bashkit shell as its only tool, then verifies the result on disk.
Code Mode MCP Agent OpenAI gpt-6.2-sol (or through OpenRouter) Answers a question over a 1,000-tool MCP server by calling its tools from Bashkit scripts, with none of their schemas in the prompt.
Host Shell Agent OpenAI gpt-6.2-sol Fixes a failing Rust test suite by compiling and running it through real processes inside a kernel-enforced boundary.
Foreman TypeSafe jev-latest over an Everruns session, Codex, or yolop Supervises a live coding session with nine decision questions per reading, and stops, verifies, or finishes it from a deterministic policy.
Example Provider and model What it does
attached-cli OpenAI gpt-6.2-sol Serves a running session to a second terminal, which lists, watches, sends to and cancels it through attached control.
Example Provider and model What it does
poppy-personal-agent OpenAI gpt-6.2-sol Acts as a person’s own agent over the Personal Agent Protocol: finds a company by its domain, asks its agent about an order, and reports the answer.

These run agents as HTTP services with Serve.

Example What it does Command
serve/hello The smallest serve app: one agent, one tool cargo run -p serve-example-hello
serve/ag-ui An agent streamed to CopilotKit or any AG-UI client cargo run -p serve-example-ag-ui
serve/a2a Two agents over A2A: a researcher served by serve, and a writer that delegates to it. Offline by default cargo run -p serve-example-a2a --bin researcher, then --bin writer -- "tide pools"
serve/voice A hotel front desk people call from the browser, with a greeting and a speaking style OPENAI_API_KEY=… cargo run -p serve-example-voice

Durable multiplayer chat on Cloudflare runs the portable kernel inside a SQLite-backed Durable Object, with shared rooms, forks, scheduled follow-ups, and a recoverable history-search child. This is an experimental advanced host example.

Example Demonstrates Command
capability_configuration.rs Typed Compaction and ToolSearch, a code-defined Definition, and a dynamic third-party reference through one entrypoint cargo run -p everruns --example capability_configuration
model_catalog.rs Listing a provider’s models, reading their metadata, and running the selection cargo run -p everruns --example model_catalog
ask_user.rs Structured questions answered by a host responder, and the unattended defaults path, fully offline cargo run -p everruns --example ask_user
ag_ui_axum.rs An AG-UI 1.0 run served over axum cargo run -p everruns --features ag-ui-axum --example ag_ui_axum
image_generation.rs An agent on GPT-6.2 Sol that draws an animated GIF with GPT Image 2.6 Flare and saves it next to you OPENAI_API_KEY=… cargo run -p everruns --features openai,images,local --example image_generation
workspace_policy.rs Safe workspace scopes and trusted starter files, fully offline cargo run -p everruns --example workspace_policy
direct_llm.rs One-shot, builder, and streamed model calls with no agent, fully offline cargo run -p everruns --example direct_llm
direct_decisions.rs Typed questions and calibrated answers with no agent, fully offline cargo run -p everruns --example direct_decisions
agent_decisions.rs An agent that classifies with its own questions, offline by default cargo run -p everruns --example agent_decisions
live_session.rs Non-blocking send, automatic steering, and optional waiting, fully offline cargo run -p everruns --example live_session
hello.rs Small live-provider agent cargo run -p everruns --features openai --example hello
production_agent.rs Tools, files, and production-style setup cargo run -p everruns --features openai --example production_agent
github_monitor.rs Typed tools and an offline simulation mode cargo run -p everruns --features openai --example github_monitor -- --simulate
session_work.rs Offline session work, leased delivery, and completion wakes cargo run -p everruns --example session_work
session_history.rs Offline durable resume and bounded history pages cargo run -p everruns --features local --example session_history
engine_sessions.rs Concrete Engine ownership, isolated sessions, and engine-scoped resume cargo run -p everruns --example engine_sessions
workspace_heads.rs Isolated Git workspace heads, Environment binding, and durable reopening cargo run -p everruns --features local --example workspace_heads -- /path/to/repo /path/to/state
canonical_events.rs Offline bounded recording and typed rendering of live events cargo run -p everruns --example canonical_events
explicit_communication.rs Offline agent with explicit communication: sent messages apart from working notes cargo run -p everruns --example explicit_communication
framework_observability.rs Engine-wide OpenTelemetry and optional Braintrust export with explicit shutdown flushing cargo run -p everruns --features otel,braintrust --example framework_observability
subagents.rs Public facade composition for delegated work cargo run -p everruns --features openai --example subagents
observe_and_cancel.rs Live events and cancellation cargo run -p everruns --features openai --example observe_and_cancel
advanced_capability.rs Code-defined capability through the unified capability(...) entrypoint cargo run -p everruns --features openai --example advanced_capability
lifecycle_hooks.rs Awaited agent, turn, tool, and completion handlers cargo run -p everruns --features openai --example lifecycle_hooks

Live-provider modes use gpt-6.2-sol and require OPENAI_API_KEY. capability_configuration, canonical_events, direct_llm, engine_sessions, explicit_communication, live_session, session_work, workspace_heads, workspace_policy, and session_history are fully offline; the GitHub monitor also offers a simulated GitHub flow:

Terminal window
cargo run -p everruns --features openai --example github_monitor -- --simulate

For copyable command details and behavior notes, use the example catalog next to the source. Examples that demonstrate low-level host internals remain advanced-host examples, not alternative Framework entrypoints.

The batch guide shows offline work through Anthropic, OpenAI, Gemini, Mistral, Groq and Fireworks. Set BATCH_PROVIDER to the provider name, enable its Cargo feature and configure its API key. Both examples can incur charges.

Example Behavior Run
batch_classification.rs Persist submission intent and ticket; resume classification, collect or cancel where supported cargo run -p everruns --features anthropic --example batch_classification -- submit /tmp/reviews-001
batch_eval.rs Submit typed message lists, poll and score three eval cases cargo run -p everruns --features anthropic --example batch_eval

The Custom Data Agent Worker packages a Framework agent with private SQLite tools behind the restricted Platform worker protocol. Its complete smoke runner uses a real model, the ordinary session APIs and SSE, and checks replica replacement and credential rotation. This advanced host example needs a self-hosted CP; its shared history lives there.

The batch examples also accept BATCH_PROVIDER=mistral, groq or fireworks with the matching Cargo feature. Fireworks requires account and artifact-origin configuration; see Batch Model Requests.

github_review.rs reads a real PR with the native GitHub capability and prints an evidence-based review. It requires OPENAI_API_KEY and GITHUB_TOKEN and does not write to GitHub. See GitHub tools.

Terminal window
cargo run -p everruns --features github,openai --example github_review -- OWNER/REPO NUMBER
Example Required features What it runs
OAuth MCP openai,mcp-auth Browser login, callback validation, authenticated MCP tool use
Slack actions openai,slack-actions React and upload into one authorized thread
Data services openai,sql-database,knowledge Retrieve policy, retain a SQL decision and write named memory
Native services openai,cursor,browserless,e2b Use one selected vendor with explicit credentials and resource cleanup
Event triggers openai,local,triggers Recoverable event dispatch and duplicate suppression across restarts
Evaluation and traces openai,evaluation Run real cases, print scores and project canonical trace events

Every example uses a real model and reports failed turns. See Application services for configuration and host responsibilities.