Skip to content

Tutorial 1 — Hello World

What you'll learn

  • How abt init scaffolds a small working project
  • The anatomy of an agent (frontmatter + system prompt)
  • How one agent delegates to another with subagents:
  • How a named prompt (prompts/*.md) is passed to an agent with -p
  • How to run, test, and health-check your project
  • How to make an agent your own

Time: ~5 minutes. No live Slack or Jira credentials needed.


1. Create the project

mkdir my-first-abt && cd my-first-abt
abt init

abt init writes eight files: two agents, their tests, a sample prompt, abt.yaml, profiles.yaml and a .gitignore. The default provider is Anthropic; export ANTHROPIC_API_KEY before running an agent (or pass --provider bedrock/openai to abt init for a different stub):

# profiles.yaml  (gitignored — never commit this)
my-first-abt:
  target: dev
  outputs:
    dev:
      model_id: anthropic:claude-haiku-5-5
      max_tokens: 4096
      credentials:
        anthropic:
          api_key: "{{ env_var('ANTHROPIC_API_KEY') }}"

2. Tour the generated files

abt.yaml

profile: my-first-abt

paths:
  agents: agents
  prompts: prompts
  tests: tests

profile: tells abt which block to load from profiles.yaml. The paths: block maps feature directories — all optional, only used if the directory exists. The starter declares only the three paths it uses; larger templates (intermediate, advanced) add tools, contracts, context, sources, exposures, and more.

agents/analyst.md

---
description: Lists the key facts in a document.
---

You are the analyst. Read the user's document and list its key facts as short bullet points.

The --- blocks are YAML frontmatter. Everything after the second --- is the system prompt (plain Markdown that the model sees as instructions). description tells other agents what this one is for.

agents/reviewer.md

---
description: Reviews a document, asking the analyst for its key facts first.
subagents:
  - analyst
---

You are the reviewer. Ask the `analyst` for the key facts in the document, then give a
one-paragraph verdict: is it clear, and does it back up its claims?

subagents: lists the agents this one may call as tools. The reviewer decides when to call the analyst, using the analyst's description.

prompts/review_task.md

Please review this draft:

The quarterly report says revenue grew 40%, but it cites no source for the number.

This is a named prompt. Pass its stem with -p review_task to use its content as the user message.

tests/analyst.yaml

agents:
  - agent: analyst
    tests:
      - name: lists_facts
        prompt: "Document: Revenue is up. No risks noted."
        says: [lists the key facts as short bullet points]

Test files mirror dbt's schema.yml pattern. Each test case sends a prompt to the agent and checks the response. A says line is a plain sentence that an LLM judge answers yes or no. tests/reviewer.yaml has the same shape.


3. Run it

export ANTHROPIC_API_KEY=...   # the starter profile reads it from the environment
abt compile

Validates discovery, dependency graph, and context resolution. Writes target/manifest.json. Fix any errors before running. Compile does not need the API key; abt run does.

abt run -s analyst -p "Document: Revenue is up. No risks noted."
abt run -s reviewer -p review_task

abt run -s <agent> runs that agent plus its whole subagents: tree, so abt run -s reviewer also runs analyst. Neither agent is wired into a workflows/ file, so abt run is the way to run them. To check the wiring without a model call, add --dry-run. abt dispatch -s <workflow> is the workflow-level command: it takes a workflow name (declared under workflows/), not an agent name, and is what fetches sources:/prompt nodes ahead of an agent and fires exposures: after it. See Tutorial 2 and Your first workflow for multi-agent workflows.

abt test --dry-run
abt test

--dry-run lists the cases that would run without calling the model. abt test runs them; each says line costs one judge call.

abt doctor

Static health checks: missing guardrails, oversized prompts, tool mismatches, etc. The starter is clean. Try abt doctor --deep to add an LLM prompt review (this makes LLM calls).


4. Make it yours

Change what the analyst does, then change the test to match.

Update agents/analyst.md

---
description: Lists the key facts in a document and flags claims that cite no source.
---

You are the analyst. Read the user's document and list its key facts as short bullet
points. Add a final line starting with "Unsourced:" that names every claim with no source.

Update tests/analyst.yaml

Add a deterministic check next to the judged one. contains is fast and cheap, and it needs no judge call:

agents:
  - agent: analyst
    tests:
      - name: flags_unsourced_claim
        prompt: "Revenue grew 40% last quarter."
        contains: ["Unsourced:"]
        says:
          - lists the key facts as short bullet points
          - names the revenue claim as having no source

When to use says vs contains

Use contains when you know exactly what the output must include — fast, cheap, no extra API call. Use says when the output needs interpretation — tone, completeness, reasoning quality. One idea per line, so a failure tells you which one.

Now run again:

abt run -s analyst -p "Revenue grew 40% last quarter."
abt test

5. What to explore next