Skip to content
Docs
GitHub

Support Agent

Typed read-only tools, separating facts from policy, and choosing different answers for different inputs.

3 min readEdit on GitHub

Browse the complete example.

Diagnose a sign-in problem by combining account facts with an explicit recovery policy. The interesting decision is whether the user needs MFA recovery, must wait for a lockout, or should try a clean browser session.

Support Agent terminal demo

Typed read-only tools, separating facts from policy, and choosing different answers for different inputs.

The default customer reset their password, but has MFA enabled and neither an authenticator nor recovery codes. A password reset alone cannot solve this case.

For cust_mfa, direct the user to verified identity recovery, explicitly noting that resetting a password does not disable MFA. Never request passwords or recovery codes. For cust_locked, explain the 15-minute wait. For cust_browser, suggest a private window and an escalation if it still fails.

Install Rust/Cargo, clone the repository, and run from its root. These folders are self-contained within the workspace: their Cargo manifests reference the local Framework crates, so copying one folder alone is not sufficient.

Terminal window
git clone https://github.com/everruns/everruns.git
cd everruns
export OPENAI_API_KEY="your-key"
cargo run -p everruns-support-agent

The configured model is gpt-6.2-sol. Provider access and funded credits are required; a model identifier alone does not grant access. Keep keys in your environment, not in source control. Missing variables, provider errors, or unsuccessful turns exit nonzero.

Try a contrasting question:

Terminal window
cargo run -p everruns-support-agent -- "cust_locked reset their password but cannot sign in. What should they do?"
cargo run -p everruns-support-agent -- "cust_browser cannot sign in after a reset. What next?"

Or enter a question interactively:

Terminal window
cargo run -p everruns-support-agent -- --interactive

Tools supply evidence; the model chooses how to use it.

pub fn build(provider: impl Into<Provider>) -> Result<Agent, BuildError> {
Agent::builder()
.name("support-agent")
.instructions(include_str!("resources/instructions.md"))
.provider(provider)
.model(MODEL)
.max_iterations(12)
.tool(tools::lookup_customer())
.tool(tools::read_support_policy())
.build()
}

The shared demo helper subscribes before sending, filters events to this turn, shows bounded tool previews, waits for completion, and rejects unsuccessful turns. It changes presentation only; use session.send_and_wait(question).await? when you do not need the live tool timeline.

// OPENAI_API_KEY, declared by the OpenAI driver itself.
let agent = agent::build(everruns::OpenAI::from_env()?)?;
let engine = Engine::new();
let session = engine.create(agent);
println!("MODEL: {}", agent::MODEL);
demo::run(&session, question).await?;

This engine is in-memory. It does not demonstrate durable session storage; the Everruns Support example can explain that API, but does not itself persist its session.

lookup_customer reads one of three fictional customer records. It returns facts, not a prewritten recommendation. read_support_policy returns the bundled recovery rules. The model combines the two; no tool disables MFA or changes a real account.

Terminal window
cargo test -p everruns-support-agent
bash examples/support-agent/demo/record.sh --check

Tests cover the distinct account states and rejection of unknown IDs. They do not grade the model’s recommendation: compare a live response with the expected outcomes above.

These checks run offline without provider credentials. To check the model’s answer, run the example and compare its output with the expected outcome above.

Watch the screencast or read the captured transcript to see the tool calls and answer.

With credentials exported and VHS, ffmpeg, and a VHS-compatible browser installed:

Terminal window
bash examples/support-agent/demo/record.sh

Export OPENAI_API_KEY before recording. The script updates demo/demo.gif and demo/transcript.txt after a successful run.

Replace the fixture lookup with your authorized customer-data service. Keep policy separate from account facts, scope lookups to the authenticated customer, and return only fields needed for the support decision. Add human approval before any account mutation.

All customers, policy rules, and support.example.com URLs are fictional. This is a read-only support exercise, not a live help desk.