This directory contains working examples demonstrating AgentV's evaluation capabilities.
For the authored eval contract behind these examples, start with the Eval files reference. The Promptfoo parity matrix calls out which fields align with Promptfoo-style evals and which AgentV fields are repo-native extensions.
Examples are self-contained packages with their own dependencies. Before running any example, install dependencies from the repository root:
# From repository root
bun run examples:installThis installs dependencies for all examples. Alternatively, install individually:
cd examples/features/execution-metrics
bun installExamples are organized into two categories:
examples/
├── features/ # Feature demonstrations (graders, metrics, SDK)
└── showcase/ # Real-world use cases and end-to-end demos
Focused demonstrations of specific AgentV capabilities. Each example includes its own README with details.
- basic - Core schema features
- rubric - Rubric-based evaluation
- trajectory-assertions-simple - Promptfoo trajectory assertion validation
- trajectory-assertions-advanced - Advanced trajectory assertions with expected_output
- assert-set - Assertion grouping patterns
- weighted-graders - Weighted graders
- execution-metrics - Metrics tracking (tokens, cost, latency)
- script-grader-with-llm-calls - script graders with provider proxy for LLM calls
- provider-owned-batching - CLI adapter-owned request batching behind normal per-case provider calls
- document-extraction - Document data extraction
- local-cli - Local CLI providers
- compare - Baseline comparison
- deterministic-graders - Deterministic assertions (contains, regex, JSON validation)
- vitest-workspace-grader - Vitest-style deterministic workspace verifiers
- workspace-setup-script - Multi-step environment setup with a
beforeAlllifecycle extension
- script-grader-sdk - TypeScript SDK for script graders using
defineScriptGrader() - vitest-workspace-grader - Built-in AgentV adapter for Vitest workspace verifier files
- sdk-custom-assertion - Custom assertion types using
defineAssertion() - sdk-programmatic-api - Programmatic evaluation using
evaluate() - sdk-eval-authoring - TypeScript
*.eval.tsauthoring usingEvalConfig - sdk-config-file - Typed configuration with
defineConfig() - prompt-template-sdk - Custom LLM grader prompts using
definePromptTemplate()
Real-world evaluation scenarios. Each example includes its own README with setup instructions.
- export-screening - Export control risk classification
- tool-evaluation-plugins - Tool selection and efficiency patterns
- cw-incident-triage - Incident triage classification
- psychotherapy - Therapeutic dialogue evaluation
Each example follows this structure:
example-name/
├── evals/
│ ├── suite.yaml # Primary eval file
│ ├── *.eval.ts # TypeScript eval config (optional)
│ ├── *.ts or *.py # script graders and helper code (optional)
│ └── *.md # LLM grader prompts (optional)
├── scripts/ # Helper scripts (optional)
├── .agentv/
│ └── providers.yaml # Provider configuration (optional)
├── package.json # Dependencies (if using agentv)
└── README.md # Example documentation
For TypeScript script graders, add a package.json:
{
"name": "my-example",
"private": true,
"type": "module",
"dependencies": {
"agentv": "file:../../../apps/cli"
}
}Then write type-safe script graders:
#!/usr/bin/env bun import { defineScriptGrader } from 'agentv'; export default defineScriptGrader(({ output }) => ({ pass: (output ?? '').includes('expected'), score: (output ?? '').includes('expected') ? 1.0 : 0.0, reason: (output ?? '').includes('expected') ? 'Found expected content' : 'Missing expected content', }));