Getting started

Examples

Runnable example projects: a supervisor-routed support desk and a parallel content review panel.

The examples/ directory of the Assemble repository holds runnable projects that consume the published packages. Each one ships with a pnpm demo script, so you can see a real multi-agent workflow end to end before writing your own.

Both examples run on the mock model by default, so neither needs a provider key.

Customer support#

Location: examples/customer-support

A supervisor-routed support desk. A classifier agent labels each ticket, the supervisor routes it to a refund, technical, or QA specialist, and a refund tool runs under a policy that requires human approval for large refunds.

What it demonstrates:

  • Supervisor topology — a route function sends every ticket through the classifier, then to the right specialist, then to a QA agent before finishing. See Workflows & topologies.
  • Policy plus human approval — a requireApproval policy on the stripe.refund tool auto-approves refunds of $100 or less and pauses the run for anything over $100. The demo runs two scenarios: a $42 refund that completes straight through, and a $250 refund that pauses with an approvalId and then resumes once a manager approves via resumeRun. See Human approval.
  • Tracing — each run streams to a console sink and writes a JSONL trace. See Tracing.

Run it:

sh
cd examples/customer-support
pnpm install
pnpm demo

The demo prints both scenarios, including the paused run id and approval id for the large refund and the final customer reply after approval. You can also run the exported supportWorkflow definition through the CLI:

sh
asm run src/support-workflow.ts --workflow supportWorkflow \
  --input '{"ticket":"refund please","orderId":"ord_1","amount":42}'

Content review panel#

Location: examples/content-review-panel

A fan-out review panel built on the parallel topology, using the review-panel team preset. Several reviewer agents score a piece of content concurrently, and their verdicts are merged into a single object keyed by reviewer, exposed as the parallel:merged artifact.

What it demonstrates:

  • Parallel topology — N reviewer agents run at the same time instead of in sequence, so the panel latency is the slowest reviewer rather than the sum of all of them. See Workflows & topologies.
  • Merged verdict — the workflow output collects every reviewer's decision into one object, ready to gate a release on.
  • Bundled eval suite — the example ships an evalSuite that pins the panel's expected verdicts, runnable with asm eval so regressions in the reviewers surface immediately. See Evals.

Run it:

sh
cd examples/content-review-panel
pnpm install
pnpm demo

Run the bundled eval suite from the example directory:

sh
asm eval src/eval-suite.ts

Using the examples as templates#

Both projects are small enough to read top to bottom. Each exports builder functions for wiring your own models, plus a ready-to-run definition (supportWorkflow, contentReviewEvalSuite) that falls back to mock models when no provider keys are set, alongside a demo script that runs the workflow end to end. Copy one, swap the agents and tools for your own, and switch mockModel for a real model provider when you are ready.