Sounding

Sounding

A simulated market panel. Build a reusable panel of grounded personas for your market, show them two or three versions of an email, a price or a pitch, and get a ranking with confidence intervals, objection themes with real quotes from the simulated answers, and a verdict that says plainly when the difference is not significant.

Simulations rank options. They do not forecast rates. Sounding can tell you which of three emails to send first and what ranchers will object to. It cannot tell you that 7% of them will reply. Every report carries a trust level that comes from comparing past simulated rankings with real results you log.

Quickstart

Needs Python 3.11+ and uv. The default backend is the Claude Code CLI in headless mode, so if claude is installed and logged in there is nothing else to configure.

git clone <this repo> sounding && cd sounding
uv sync
uv run pytest -q                    # 40 tests, offline, using the fake backend
uv run sounding demo                # tiny panel + two-variant study on the fake backend, no model calls
uv run sounding serve               # web UI at http://127.0.0.1:8321

A real run with the Claude CLI (about 10 calls for the panel, about 36 for the study):

uv run sounding panel build examples/vitals/panel.toml
uv run sounding panel list                                   # copy the panel id
uv run sounding study create examples/vitals/emails.toml --panel <panel_id> --run
uv run sounding study report <study_id> -f html -o report.html

After you send the real emails, log what happened and the trust level updates:

uv run sounding outcome add <study_id> --variant A --successes 3 --trials 40
uv run sounding calibration

What it does

Panels. A panel is built from a market description, segments with relative shares, and optional grounding sources: a CSV of statistics, interview notes, pasted text, or URLs (fetched once and saved as files). Each segment is filled to an exact quota by largest-remainder allocation. A CSV with columns attribute,value,weight[,segment,source] sets attribute quotas too, so if 46% of beef cows are in herds of 20 to 199, 46% of the cow-calf personas get that herd size, marked as grounded in that row. The model writes the remaining attributes (role, budget authority, constraints, tech comfort, current tools, typical objections, decision process) and must say for each one which source supports it or that it was invented. A dedupe pass drops personas whose profiles overlap too much and writes replacements. Panels are editable; every edit or removal saves a new version and studies remember the version they ran on.

Studies. Variants are text (email, pitch, page copy) with optional images. Question types:

Simulation. Several personas answer per model call (batch size is configurable) to keep usage low. Options are shown under neutral labels, and presentation order rotates across calls so every option appears in every position equally often; price ladders are shuffled too. Each persona answers several independent samples in different batches. Output is JSON, validated against the study's questions, and a call with invalid output is re-asked with the validation errors, only for the respondents that failed. A no-persona baseline answers the same questions with no profile, which shows how much the personas move the answers.

Analysis. Persona-level (cluster) bootstrap intervals for win rates, intent means and top-2-box shares, the probability each option is best, and the difference between the top two. Breakdowns by segment. Van Westendorp curves with the acceptable price range and bootstrap intervals for each point; Gabor-Granger demand and revenue curves. Objection themes clustered by wording (TF-IDF), with counts, share of personas and verbatim quotes; optionally named by the model in one extra call.

Calibration. Log real outcomes per variant ("3 replies of 40 sent"). Sounding compares the simulated ranking with the real one per study (hit, Spearman, Kendall tau-b, pairwise agreement, and whether the real difference was itself statistically clear) and rolls them into a trust level per panel: uncalibrated, low, moderate or high. See docs/method.md.

Reports. Every study exports to standalone HTML (inline SVG charts, light and dark) and Markdown.

Backends

Backend When Notes
claude-cli (default) claude is on PATH and logged in Runs claude -p --output-format json with tools, MCP, settings and session persistence off, from an empty directory
anthropic only when ANTHROPIC_API_KEY is set uv sync --extra anthropic. Studies with 40+ calls go through the Message Batches API
fake tests and offline demos deterministic; can inject bad JSON, position bias and a preferred variant

Models: claude-haiku-5-5 (default) or claude-sonnet-5-5, with --model or SOUNDING_MODEL. Data lives in ~/.sounding (override with SOUNDING_HOME or SOUNDING_DB).

Spec files

Panels and studies are TOML. See examples/vitals/ for a grounded panel, three studies and a pitch test, and docs/vitals.md for the walkthrough written for the first real user.

Layout

src/sounding/
  panels.py      quotas, grounded attribute assignment, persona writing, dedupe, versions
  engine.py      batching, order rotation, validation and retry, baseline control
  analysis.py    bootstrap intervals, segments, Van Westendorp, Gabor-Granger, themes, verdicts
  calibration.py real outcomes, rank correlation, trust levels
  report.py      HTML and Markdown reports; web/ is the FastAPI UI
  backends/      claude CLI, Anthropic API, fake
tests/           pytest, all offline
examples/vitals/ the Vitals demo inputs; demo/results/ holds its real outputs
site/            the static landing page (built by scripts/build_site.py, live at https://sounding-avb.pages.dev)
scripts/         export_demo.py, build_site.py, shoot.mjs (retina UI screenshots), check_site.mjs

License

MIT.