Agent Royale is a local runner for testing whether an AI search, RAG, browser, or agent stack returns exact source-specific values.
python -m agent_royale validate task-packs/static-smoke.yaml
python -m agent_royale validate task-packs/github/example.yamlInstall locally:
pip install -e .
agent-royale --versionpython -m agent_royale run task-packs/static-smoke.yaml \
--target examples/echo_agent.py:answer \
--report reports/smoke.htmlRun a preflight check before a full eval:
python -m agent_royale doctor task-packs/static-smoke.yaml \
--target examples/echo_agent.py:answerRun an intentionally failing demo:
python -m agent_royale run task-packs/static-smoke.yaml \
--target examples/flaky_agent.py:answer \
--report reports/failure-demo.htmlOr run the same smoke pack against a local HTTP endpoint:
uvicorn examples.local_agent:app --host 127.0.0.1 --port 3000
python -m agent_royale run task-packs/static-smoke.yaml \
--target http://localhost:3000/api/agent \
--report reports/local-agent.htmlThe target can be:
http://localhost:3000/api/agentfor a local/prod endpoint.openrouter:provider/modelfor an OpenRouter model adapter, if configured.examples/echo_agent.py:answerfor a local Python function.
Agent Royale sends:
{
"question": "Using GitHub, how many stars does the vercel/next.js repository currently have?",
"task": {
"id": "github_nextjs_stars",
"required_source": "github.com/vercel/next.js",
"answer_type": "number"
}
}Your stack should return:
{
"answer": "129000",
"citations": [
{
"url": "https://github.com/vercel/next.js",
"quote": "129k stars"
}
],
"trace": {
"search_queries": ["vercel next.js GitHub stars"],
"tools_used": ["web.search"],
"latency_ms": 4210,
"cost_usd": 0.012
}
}name: my-task-pack
tasks:
- id: github_nextjs_stars
question: "Using GitHub, how many stars does the vercel/next.js repository currently have?"
required_source: "github.com/vercel/next.js"
answer_type: number
tolerance: 0
labels: [github, devtools]
ground_truth:
method: http_json
url: "https://api.github.com/repos/vercel/next.js"
field: "stargazers_count"
source_url: "github.com/vercel/next.js"Supported ground-truth methods:
static: fixed value for smoke tests or manual snapshots.http_json: fetch JSON and read a dotted field path.http_regex: fetch text/HTML and capture a value with a regex.bright_data: optional Bright Data oracle for messy live-web sources.
Supported answer types:
stringnumbercurrencypercentagedateenum
Create a starter task pack:
python -m agent_royale init task-pack cloud-pricingdoctor validates task packs, summarizes ground-truth methods and answer types, checks whether optional integration keys are present, and can probe a target with the first loaded task.
python -m agent_royale doctor task-packs/github/example.yaml \
--target http://localhost:3000/api/agentBy default, doctor does not fetch live oracles. Add --check-ground-truth when you want to verify the source parser or API calls before a benchmark run:
python -m agent_royale doctor task-packs/github/example.yaml --check-ground-truthpython -m agent_royale run task-packs/github/example.yaml \
--target http://localhost:3000/api/agent \
--fail-under-exact 0.8The command exits with status 2 when exact accuracy is below the threshold.
task-packs/github/example.yaml: repository counts, releases, raw file fields, default branches, and licenses.task-packs/npm/example.yaml: package versions, license metadata, downloads, repository URLs, package size, and engine constraints.task-packs/finance/yahoo-quotes.yaml: Yahoo Finance regular-market quote fields.task-packs/mobile-apps/apple-app-store.yaml: Apple App Store rating and version fields.task-packs/subscription-pricing/example.yaml: official pricing-page examples with explicit parser notes.task-packs/bright-data/rapid-web.yaml: Bright Data Rapid-mode search, docs, and release checks withsearch_engineandscrape_as_markdown.
examples/dev_research_agent.py calls public GitHub and npm APIs. It intentionally has a few realistic retrieval bugs, such as using npm package metadata when the task asks for a GitHub release.
python -m agent_royale run task-packs/devtools/dependency-research.yaml \
--target examples/dev_research_agent.py:answer \
--report reports/dev-agent.htmlThe README report preview is generated from this kind of real run.
See Realistic dev-agent eval for the full walkthrough.