# Runnable Examples

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

Source: <https://everruns.com/docs/framework/examples/>

The [`crates/everruns/examples` catalog](https://github.com/everruns/everruns/tree/main/crates/everruns/examples) contains the maintained public examples. Each imports the `everruns` facade.

## Complete agents

The root-level [`examples`](https://github.com/everruns/everruns/tree/main/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](https://everruns.com/docs/framework/examples/support-agent/)                       | OpenAI `gpt-6.1-sol`            | Chooses between MFA recovery, lockout, and browser troubleshooting from facts and policy. |
| [Everruns Support Agent](https://everruns.com/docs/framework/examples/everruns-support-agent/)     | Anthropic `claude-opus-5-5`     | Searches and reads citable official documentation snapshots.                              |
| [Coding Review Agent](https://everruns.com/docs/framework/examples/coding-review-agent/)           | Anthropic `claude-sonnet-5`     | Reads a refund contract and executes a fixed regression before reporting a defect.        |
| [Research Agent](https://everruns.com/docs/framework/examples/research-agent/)                     | OpenRouter `z-ai/glm-5.2`       | Searches and fetches primary sources before writing a cited brief.                        |
| [Incident Commander Agent](https://everruns.com/docs/framework/examples/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`](https://github.com/everruns/everruns/tree/main/examples/agents). See [file-based agents](https://everruns.com/docs/how-to/define-agents-as-files/) for loading, importing and serving them.

## Execution runtimes

| Example                                                                                | Provider and model                                              | What it does                                                                                                                                |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [Bashkit Repo Agent](https://everruns.com/docs/framework/examples/bashkit-repo-agent/) | OpenAI `gpt-6.1-sol`                                            | Cuts a release in a real repository with the sandboxed Bashkit shell as its only tool, then verifies the result on disk.                    |
| [Host Shell Agent](https://everruns.com/docs/framework/examples/host-shell-agent/)     | OpenAI `gpt-6.1-sol`                                            | Fixes a failing Rust test suite by compiling and running it through real processes inside a kernel-enforced boundary.                       |
| [Foreman](https://everruns.com/docs/framework/examples/foreman-agent/)                 | 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. |

## Serving agents

These run agents as HTTP services with [Serve](https://everruns.com/docs/framework/serve/).

| Example                                                                              | What it does                                                                                                                                         | Command                                                                                |
| ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [`serve/hello`](https://github.com/everruns/everruns/tree/main/examples/serve/hello) | The smallest serve app: one agent, one tool                                                                                                          | `cargo run -p serve-example-hello`                                                     |
| [`serve/ag-ui`](https://github.com/everruns/everruns/tree/main/examples/serve/ag-ui) | An agent streamed to CopilotKit or any AG-UI client                                                                                                  | `cargo run -p serve-example-ag-ui`                                                     |
| [`serve/a2a`](https://github.com/everruns/everruns/tree/main/examples/serve/a2a)     | Two agents over [A2A](https://everruns.com/docs/framework/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`](https://github.com/everruns/everruns/tree/main/examples/serve/voice) | A hotel front desk people [call from the browser](https://everruns.com/docs/framework/voice/), with a greeting and a speaking style                  | `OPENAI_API_KEY=… cargo run -p serve-example-voice`                                    |

## Core crate catalog

| Example                                                                                                                              | Demonstrates                                                                                                           | Command                                                                                            |
| ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| [`capability_configuration.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/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`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/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`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/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`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/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`                                 |
| [`workspace_policy.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/workspace_policy.rs)                 | Safe workspace scopes and trusted starter files, fully offline                                                         | `cargo run -p everruns --example workspace_policy`                                                 |
| [`direct_llm.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/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`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/direct_decisions.rs)                 | Typed questions and calibrated answers with no agent, fully offline                                                    | `cargo run -p everruns --example direct_decisions`                                                 |
| [`agent_decisions.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/agent_decisions.rs)                   | An agent that classifies with its own questions, offline by default                                                    | `cargo run -p everruns --example agent_decisions`                                                  |
| [`live_session.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/live_session.rs)                         | Non-blocking send, automatic steering, and optional waiting, fully offline                                             | `cargo run -p everruns --example live_session`                                                     |
| [`hello.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/hello.rs)                                       | Small live-provider agent                                                                                              | `cargo run -p everruns --features openai --example hello`                                          |
| [`production_agent.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/production_agent.rs)                 | Tools, files, and production-style setup                                                                               | `cargo run -p everruns --features openai --example production_agent`                               |
| [`github_monitor.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/github_monitor.rs)                     | Typed tools and an offline simulation mode                                                                             | `cargo run -p everruns --features openai --example github_monitor -- --simulate`                   |
| [`session_work.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/session_work.rs)                         | Offline session work, leased delivery, and completion wakes                                                            | `cargo run -p everruns --example session_work`                                                     |
| [`session_history.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/session_history.rs)                   | Offline durable resume and bounded history pages                                                                       | `cargo run -p everruns --features local --example session_history`                                 |
| [`engine_sessions.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/engine_sessions.rs)                   | Concrete Engine ownership, isolated sessions, and engine-scoped resume                                                 | `cargo run -p everruns --example engine_sessions`                                                  |
| [`workspace_heads.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/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`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/canonical_events.rs)                 | Offline bounded recording and typed rendering of live events                                                           | `cargo run -p everruns --example canonical_events`                                                 |
| [`explicit_communication.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/explicit_communication.rs)     | Offline agent with explicit communication: sent messages apart from working notes                                      | `cargo run -p everruns --example explicit_communication`                                           |
| [`framework_observability.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/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`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/subagents.rs)                               | Public facade composition for delegated work                                                                           | `cargo run -p everruns --features openai --example subagents`                                      |
| [`observe_and_cancel.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/observe_and_cancel.rs)             | Live events and cancellation                                                                                           | `cargo run -p everruns --features openai --example observe_and_cancel`                             |
| [`advanced_capability.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/advanced_capability.rs)           | Code-defined capability through the unified `capability(...)` entrypoint                                               | `cargo run -p everruns --features openai --example advanced_capability`                            |
| [`lifecycle_hooks.rs`](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/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.1-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:

```bash
cargo run -p everruns --features openai --example github_monitor -- --simulate
```

For copyable command details and behavior notes, use the [example catalog](https://github.com/everruns/everruns/blob/main/crates/everruns/examples/README.md) next to the source. Examples that demonstrate low-level host internals remain advanced-host examples, not alternative Framework entrypoints.