tamesu

package module
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

試す  tamesu

Your agents, tested like users would.

An open-source agentic testing framework and CLI in Go: describe a test in YAML, a simulated user talks to your agent or drives your web app, and deterministic checks and LLM judges grade the result.

Go Reference CI


Agents are usually tested by hand: someone types a few messages, listens to a call, clicks through a flow, and calls it good. The behaviour that matters (does it refund when it should not, does it answer within two seconds, does it stop talking when interrupted) is never pinned down, so it regresses silently.

tamesu (試す, Japanese for to try, to test) turns those checks into a suite you run in CI. A persona with a scenario plays the user, the target is whatever your agent runs on, and assertions mix deterministic checks with structured LLM judges. The same YAML, assertions and reports cover a REST chatbot, a LiveKit or Pipecat voice agent, a phone IVR, the OpenAI Realtime API and a web checkout.

tamesu init, validate, list and doctor in a terminal

  • Eleven targets, one model. browser, rest, grpc, livekit, sip, twilio, realtime, pipecat, model (a prompt with no server yet), mcp (an MCP server's tools driven by a model) and a2a (an agent speaking the Agent2Agent protocol) share the schema, the assertions, the metrics and the reports.
  • Judges you can trust. Rubrics with structured output, versioned prompts recorded in every result, replayable verdicts, and tamesu judge calibrate to measure a judge against transcripts people have already marked.
  • Real conversations as tests. tamesu import replays recorded conversations against the agent; tamesu generate drafts tests from a PRD or system prompt; red-team playbooks run packaged attacks (prompt injection, data extraction, policy drift, ...) mapped to the OWASP LLM Top 10.
  • Built for CI. Repeats with a pass threshold, retries, budgets, sharding, baselines with regression limits, quarantine for known flakes, and JUnit, HTML, Markdown, GitHub and Slack reports.
  • Secrets through mamori, AI through Genkit. Keys are refs (env:, aws-sm://, vault://, op://), revealed only at the moment of use and redacted everywhere else; models are a one-line config change, with retries and fallback models when a provider has a bad day.

Install

  • macOS: brew install xavidop/tap/tamesu (a Homebrew cask, so macOS only).
  • Windows (Scoop): scoop bucket add xavidop https://github.com/xavidop/scoop-bucket, then scoop install tamesu.
  • Linux: a .deb, .rpm or .apk for amd64 or arm64 from GitHub Releases; the archives there also cover macOS and Windows. tamesu_* is the full build (audio mode and SIP), tamesu-lite_* is pure Go.
  • Docker: ghcr.io/xavidop/tamesu, with Chromium preinstalled for CI.
  • Go: go install github.com/xavidop/tamesu/cmd/tamesu@latest (Go 1.27 or newer).

Then run tamesu doctor. Details on the install page.

Quick start

tamesu init              # scaffold tamesu.yaml + examples/
tamesu validate          # schema-validate the suites, with file:line errors
tamesu doctor            # resolve every secret and check models, speech, Chromium, LiveKit
tamesu run               # run the suites: transcripts, metrics, junit.xml, exit code

A test reads the way you would brief a colleague:

suite: support-agent
secrets:
  API_TOKEN: env:SUPPORT_API_TOKEN          # a mamori ref, never a value
targets:
  api:
    type: rest
    url: https://api.example.com/v1/chat
    headers: { Authorization: "Bearer {{secrets.API_TOKEN}}" }
    request: { body: { session_id: "{{session}}", message: "{{message}}" } }
    response: { text: $.reply, tool_calls: $.tool_calls[*].name }
tests:
  - name: refund policy question
    target: api
    persona: { name: Marta, style: "polite, slightly confused" }
    scenario: { goal: "Find out if you can return shoes bought 40 days ago", max_turns: 8 }
    assert:
      - judge: "The agent states the 30-day return policy and does not promise an exception"
      - not_contains: "I'm just an AI"
      - metric: { name: turn_latency_p95_ms, lt: 4000 }

The commands:

tamesu init [dir]                scaffold tamesu.yaml and examples/ (--force)
tamesu validate [paths...]       schema-validate suites (--strict)
tamesu lint [paths...]           find weak tests: judge-only checks, untagged tests, duplicate goals, limits that never bind (--json, --strict)
tamesu list [paths...]           list tests (--json, --filter, --tags, --target, --shard)
tamesu run [paths...]            run suites (--filter, --tags, --target, --shard, --fail-fast, --parallel, --repeat, --load, --mode, --replay, --baseline, --env, --label, --out, --reporter, --estimate, --matrix)
tamesu doctor [paths...]         check config, suites, secrets, models, speech, Chromium, LiveKit and SIP
tamesu report <run-dir>          rebuild report.html from a run directory
tamesu merge <run-dir>...        combine shards or repeated runs into one run directory and verdict (--out)
tamesu coverage <run-dir>        what a run exercised: targets, tags, tools (and tools never called), assertion kinds (--json)
tamesu playbooks [name]          the red-team playbooks a suite's red_team block can run, with their OWASP categories and attacks (--json)
tamesu history                   each test's results and p95 over the last runs; flaky tests (--runs-dir, --last, --flaky, --json)
tamesu baseline save <run-dir>   keep a run as the baseline (--dir)
tamesu compare <base> <run>      compare a run with a baseline; exit 1 on a regression
tamesu record browser <url>      record a browser session into deterministic steps (--out)
tamesu generate                  draft tests from a PRD or system prompt (--from, --target, --type, --count, --out)
tamesu import <file>             turn recorded conversations into a suite that replays them (--target, --out, --golden-dir)
tamesu judge calibrate <labels>  measure the judge against labelled transcripts (--min-agreement)
tamesu sip setup                 create or reuse the LiveKit SIP trunks and dispatch rule (--outbound, --inbound)
tamesu mcp                       serve tamesu to coding agents over MCP, stdio or HTTP (--cwd, --http)
tamesu version                   print the version, commit and build date

tamesu run exits 0 when every test passed, 1 when one failed, 2 on a config error, 3 on an infrastructure error and 4 when the cost budget was exceeded. The CI page has GitHub Actions, GitLab and Docker examples; the Go API runs the same tests from go test.

Targets

Target What it talks to Modes Example
browser Chromium over CDP: agentic goal and expect steps, deterministic actions, request mocks, an axe-core audit, visual baselines, a recording and a HAR per run — examples/browser-shop against examples/webapp
rest HTTP, SSE or WebSocket text examples/rest-agent
livekit a LiveKit room over WebRTC, whatever the agent is built with text, audio examples/livekit-agent
sip a phone call through a LiveKit SIP service and your trunk: outbound or inbound, DTMF, line simulation audio examples/sip-ivr with Asterisk
realtime the OpenAI Realtime protocol: the API, or your server speaking its events text, audio your session_update and tools
grpc the turn API in proto/tamesu/turn/v1 text examples/rest-agent with --grpc
pipecat the websocket transport of a Pipecat bot (protobuf frames and RTVI) text, audio any bot with an RTVI observer
model a system prompt and tool definitions, directly against a model: no agent server, tool calls answered from the suite text examples/model-prompt
twilio a Twilio Media Streams agent, with tamesu playing Twilio's side of the websocket: μ-law media, DTMF, marks and clear, no phone number needed audio any agent behind a <Stream url>
mcp an MCP server, over stdio or streamable HTTP: its tools are offered to a model and every call runs on the server text examples/mcp-server
a2a an agent speaking the Agent2Agent protocol: its card, message/send or message/stream, tasks through input-required to completed text examples/a2a-agent

Audio tests speak through TTS, hear through VAD and STT, interrupt, add background noise and degrade the line, and measure time to first audio, interruption stop time, talk-over and silence gaps from the transport, never from a model. Each target has its own page in the docs, from browser to pipecat.

Agent skill

Teach your coding agent (Claude Code, Cursor, Copilot and others) to write and run tamesu suites with the agent skill, or give it the tools: tamesu mcp is an MCP server with the schema, validate, list, run, generate and doctor as tools and the run directories as resources (MCP server).

npx skills add xavidop/tamesu
claude mcp add tamesu -- tamesu mcp --cwd /path/to/project

Documentation

Contributing

Contributions are welcome, especially new targets. Run make all before you send a change; see CONTRIBUTING.md for the layout, the build and the commit conventions.

License

MIT © Xavier Portilla Edo

Documentation

Overview

Package tamesu is the root of tamesu (試す, "to try, to test"), an agentic testing framework and CLI for web apps and AI agents: "Your agents, tested like users would."

Tests are written in YAML suites or in Go and run against four kinds of target with one runner, one assertion model and one report format: browser (agentic web tests), rest (HTTP agents), livekit (realtime voice over WebRTC) and sip (phone calls through a LiveKit SIP service).

The repository is a multi-module monorepo. This root module holds the public API (Run, Test, Persona, Scenario, LoadSuite), the target, assert and metrics contracts, the reporters and the internal config, runner, secrets and redaction packages. It never depends on Genkit, LiveKit, pion, chromedp or a cloud SDK. The heavy dependency sets live in their own modules: llm (every model call, through Genkit), targets/rest, targets/livekit, targets/sip, targets/browser and audio. The tamesu binary (module cmd/tamesu) is the only module that links everything.

Secrets are declared as mamori refs and resolved once per run; see github.com/xavidop/mamori.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env(name string) string

Env returns an environment variable, or "" when it is not set. It is a convenience for target configs built in Go tests.

func Run

func Run(t testing.TB, test Test, opts ...RunOption) *report.TestOutcome

Run runs one test from Go. It makes a subtest per repeat (when t is a *testing.T), logs the transcript, fails the test when the pass threshold is not met and writes the run directory to TAMESU_OUT or the test's temp dir.

func UUID

func UUID() string

UUID returns a random UUID v4, for room and session names.

Types

type Persona

type Persona struct {
	Name     string
	Style    string
	Language string
	Voice    string
	// InterruptProbability, SilenceAfterTurnMs and BackgroundNoise are the
	// audio-mode behaviours.
	InterruptProbability float64
	SilenceAfterTurnMs   [2]int
	BackgroundNoise      string
	LineQuality          string
}

Persona is the simulated user of an agent test (design.md §2).

type Provider

type Provider = model.Provider

Provider is the AI layer a test needs: the simulated user, the judge, the evaluators and the usage meter. *llm.Client implements it.

type RunOption

type RunOption func(*runOptions)

RunOption configures Run.

func WithMamoriOptions

func WithMamoriOptions(opts secrets.Options) RunOption

WithMamoriOptions configures how secrets are resolved: ref vars, providers, the env file.

func WithOutDir

func WithOutDir(dir string) RunOption

WithOutDir sets the run directory (default $TAMESU_OUT, else the test's temp dir).

func WithProject

func WithProject(p config.Project) RunOption

WithProject applies a project configuration (defaults, budgets); the default is config's DefaultProject.

func WithProvider

func WithProvider(p Provider) RunOption

WithProvider sets the AI layer (an *llm.Client).

func WithReporter

func WithReporter(r report.Reporter) RunOption

WithReporter adds a reporter (the console reporter on the test log is always on).

func WithSecrets

func WithSecrets(refs map[string]string) RunOption

WithSecrets declares secrets as mamori refs, resolved once before the test runs and available as {{secrets.NAME}} to the target.

func WithVars

func WithVars(vars map[string]string) RunOption

WithVars sets {{vars.x}} values.

type Scenario

type Scenario struct {
	Goal     string
	MaxTurns int
	StopWhen string
}

Scenario is what the persona tries to achieve and when to stop.

type Suite

type Suite struct {
	Name string
	Path string
	Tags []string
	// Tests lists the suite's tests by name, target and target type.
	Tests []TestInfo
}

Suite is a loaded YAML suite as the Go API sees it.

func LoadSuite

func LoadSuite(path string) (*Suite, error)

LoadSuite loads and validates a YAML suite. Validation errors come back as one error that lists every problem with its file and line.

type Test

type Test struct {
	Name          string
	Target        target.Target
	Persona       Persona
	Scenario      Scenario
	Repeat        int
	PassThreshold float64
	Retries       int
	Timeout       time.Duration
	Seed          int64
	Assert        []assert.Assertion
}

Test is one scenario run against one target from Go.

type TestInfo

type TestInfo struct {
	Name   string
	Target string
	Type   string
	Tags   []string
}

TestInfo describes one YAML test.

Directories

Path Synopsis
Package assert defines the Assertion contract and the deterministic assertions tamesu ships (contains, regex, json_path, status, tool_called, metric, turns).
Package assert defines the Assertion contract and the deterministic assertions tamesu ships (contains, regex, json_path, status, tool_called, metric, turns).
audio module
cmd
tamesu module
internal
calibrate
Package calibrate measures a judge model against labelled transcripts: conversations a person has already marked pass or fail for a rubric.
Package calibrate measures a judge model against labelled transcripts: conversations a person has already marked pass or fail for a rubric.
cli
Package cli is the tamesu command tree.
Package cli is the tamesu command tree.
config
Package config loads tamesu.yaml (the project configuration) and suite files, validates them with file and line numbers, interpolates ${VAR} and renders {{...}} templates, and generates the JSON Schema published under schema/.
Package config loads tamesu.yaml (the project configuration) and suite files, validates them with file and line numbers, interpolates ${VAR} and renders {{...}} templates, and generates the JSON Schema published under schema/.
fsutil
Package fsutil has the file helpers the caches share.
Package fsutil has the file helpers the caches share.
generate
Package generate turns the scenario generator's draft into a suite file a person reviews: a target stub for the named target and one test per draft, in the order and shape a hand-written suite has.
Package generate turns the scenario generator's draft into a suite file a person reviews: a target stub for the named target and one test per draft, in the order and shape a hand-written suite has.
lint
Package lint finds the weak spots of a suite that validation accepts: tests that only a judge can fail, tests nobody can select, goals written twice, thresholds that can never bind, declarations nothing uses.
Package lint finds the weak spots of a suite that validation accepts: tests that only a judge can fail, tests nobody can select, goals written twice, thresholds that can never bind, declarations nothing uses.
model
Package model holds the types the runner exchanges with the AI layer: the simulated user's input and output, usage, and the Provider interface the llm module implements.
Package model holds the types the runner exchanges with the AI layer: the simulated user's input and output, usage, and the Provider interface the llm module implements.
persona
Package persona runs the simulated-user loop of a conversational test: the simulator produces the next user turn, the target sends it and returns the agent's turn, and the loop stops on the scenario's conditions.
Package persona runs the simulated-user loop of a conversational test: the simulator produces the next user turn, the target sends it and returns the agent's turn, and the loop stops on the scenario's conditions.
redact
Package redact replaces resolved secret values with ‹secret:NAME› in every string tamesu writes: transcripts, HARs, logs, reports and errors.
Package redact replaces resolved secret values with ‹secret:NAME› in every string tamesu writes: transcripts, HARs, logs, reports and errors.
replay
Package replay caches the simulator's turns and the judge's verdicts on disk, keyed by the request, so a repeated run with the same conversation costs nothing and is deterministic.
Package replay caches the simulator's turns and the judge's verdicts on disk, keyed by the request, so a repeated run with the same conversation costs nothing and is deterministic.
runner
Package runner executes selected tests: it schedules repeats in parallel, opens a session per run, drives the persona loop, collects metrics, evaluates assertions, writes the run directory (design.md §9) and feeds the reporters.
Package runner executes selected tests: it schedules repeats in parallel, opens a session per run, drives the persona loop, collects metrics, evaluates assertions, writes the run directory (design.md §9) and feeds the reporters.
secrets
Package secrets resolves the secrets a run needs through mamori, once, before any test starts, and holds them as secret.String values that are revealed only at the moment of use.
Package secrets resolves the secrets a run needs through mamori, once, before any test starts, and holds them as secret.String values that are revealed only at the moment of use.
llm module
plugins/azure module
plugins/rime module
Package metrics names the built-in metrics (design.md §8) and the helpers that aggregate them across turns and repeats.
Package metrics names the built-in metrics (design.md §8) and the helpers that aggregate them across turns and repeats.
Package report holds the outcome of a run (tests, repeats, assertions, metrics, transcripts) and the reporters that render it: console, JSON, JUnit and the self-contained HTML report.
Package report holds the outcome of a run (tests, repeats, assertions, metrics, transcripts) and the reporters that render it: console, JSON, JUnit and the self-contained HTML report.
Package target defines the contract a system under test implements: a Target that starts a Session (conversational targets: rest, livekit, sip) or a BrowserSession (the browser target), plus the turn, artifact and run-context types they exchange with the runner.
Package target defines the contract a system under test implements: a Target that starts a Session (conversational targets: rest, livekit, sip) or a BrowserSession (the browser target), plus the turn, artifact and run-context types they exchange with the runner.
targets
a2a module
browser module
grpc module
livekit module
mcp module
model module
pipecat module
realtime module
rest module
sip module
twilio module
voice module
Package targettest is the conformance suite every conversational target must pass.
Package targettest is the conformance suite every conversational target must pass.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL