Skip to content

Advanced: manifest and compile

abt compile produces target/manifest.json: a single JSON snapshot of the project (agents, workflows, skills, MCP sources, context, sources, exposures, retrievers, transformers, triggers) that every other command reads instead of re-parsing source files. This page documents that manifest, how it is built, and how to consume it from outside abt.

The design follows dbt-core's manifest.json: compile once, then let run, dispatch, and docs generate all read the same artifact instead of re-parsing sources.


What compile_manifest() Does

compile_manifest() (in abt.artifacts) runs these steps:

  1. Creates ProjectContext from abt.yaml to resolve paths
  2. Calls apply_env() to set env vars (needed for settings-based path resolution)
  3. Loads ProjectConfig for package_root configuration
  4. Configures MCP sources from mcps/*.json (or paths.mcps)
  5. Calls AgentDiscovery.discover() to parse all agents/**/*.md files
  6. Calls AgentDiscovery.validate_dag() -- validates all dependency refs (from subagents: frontmatter) exist and graph is acyclic
  7. Converts each AgentNode (runtime, with Path objects) to AgentResource (serialisable)
  8. Reads few_shots file contents and embeds them in AgentResource.few_shots (list of strings)
  9. Computes bidirectional parent_map / child_map from the dependency graph
  10. Scans skill directories for SKILL.md files
  11. Lists registered MCP sources from the registry
  12. Resolves context/**/*.md and external {{ context.*() }} references into contexts (compile-time snapshot). By default this walks every agent; with compile_manifest(..., compile_selector=...) (same as abt compile -s), only the selected agent's upstream delegation closure is expanded (unrelated Confluence/S3/local context is skipped) and only that closure's prompts are rendered (AgentResource.compiled: true) — manifest.json itself always contains every agent, matching dbt's manifest invariant; agents outside the selector keep their raw source but carry an empty system_prompt. When abt run passes -p/--prompt that matches a prompts/ stem, compile_manifest also includes that prompt template in the context scan so named prompts still resolve {{ context.*() }}.
  13. Discovers prompts/, sources/, exposures/, retrievers/, transformers/, and triggers/; compiles prompt templates to prompts[].compiled_content (with compile-time var() / context.*() resolved; {{ source(...) }} / {{ upstream(...) }} freeze back to their own literal call syntax — the real substitution happens at dispatch time, against whichever predecessor workflow node actually ran, see abt.core.compose.render_upstream_refs), type-preserving Jinja render of config: on sources and exposures (template strings only; ints/bools unchanged), and validates exposure reachability (every exposure not marked adhoc_only must appear as an exposure-kind node in some workflow's own edges). There is no sources:/exposures: key on an agent — both are workflow nodes (see Workflows).
  14. Optionally enriches metadata.default_model from the active profile (if already loaded)
  15. Returns a WritableManifest

The function does not require a profiles.yaml. When one is present it is loaded, so an env_var(...) in its env: block that is not set fails the compile (E_ENV_VAR_MISSING) — export it (a placeholder is enough) or drop the profiles.yaml in credential-free CI. Unset values under credentials: do not fail a whole-project compile; a scoped compile (-s) still fails when a selected agent's namespace is missing.


WritableManifest Schema (v2)

{
  "metadata": {
    "abt_version": "0.0.1",
    "schema_version": "v2",
    "generated_at": "2026-03-26T12:00:00.000000+00:00",
    "invocation_id": "550e8400-e29b-41d4-a716-446655440000",
    "project_name": "my-project",
    "default_model": "openai:gpt-4.1-mini"
  },
  "agents": {
    "montecarlo-investigator": {
      "unique_id": "agent.my-project.montecarlo-investigator",
      "name": "montecarlo-investigator",
      "description": "Investigate Monte Carlo data quality alerts...",
      "source_path": "agents/montecarlo-investigator.md",
      "model_id": null,
      "temperature": 0.2,
      "tools": ["montecarlo__search", "montecarlo__getTable"],
      "skills": ["/.agents/skills/investigate-mc-alerts/"],
      "activates": [],
      "few_shots": [],
      "raw_system_prompt": "",
      "runtime_system_prompt": "You are the Monte Carlo investigation specialist...",
      "runtime_system_prompt_no_file_tools": "You are the Monte Carlo investigation specialist...",
      "system_prompt": "You are the Monte Carlo investigation specialist..."
    },
    "mock-incident": {
      "unique_id": "agent.my-project.mock-incident",
      "name": "mock-incident",
      "description": "Coordinates incident response...",
      "source_path": "agents/mock-incident/mock-incident.md",
      "model_id": null,
      "temperature": 0.2,
      "tools": [],
      "skills": [],
      "activates": [
        {"name": "montecarlo-investigator", "model_id_override": null, "temperature_override": null}
      ],
      "few_shots": [],
      "raw_system_prompt": "",
      "runtime_system_prompt": "...",
      "runtime_system_prompt_no_file_tools": "...",
      "system_prompt": "..."
    }
  },
  "workflows": {
    "support_ticket": {
      "unique_id": "workflow.my-project.support_ticket",
      "name": "support_ticket",
      "description": "Triage an inbound ticket, resolve it, close it out",
      "trigger": "support_event",
      "max_iterations": null,
      "edges": [
        {"source": "START", "target": "triage"},
        {
          "source": "triage",
          "conditions": [
            {"field": "route", "op": "eq", "value": "refund", "target": {"agent": "refund", "response": null}},
            {"field": "route", "op": "eq", "value": "escalate", "target": {"agent": "escalate", "response": null}}
          ],
          "default": {"agent": "escalate", "response": null}
        }
      ],
      "source_path": "workflows/support_ticket.yaml"
    }
  },
  "parent_map": {
    "mock-incident": ["montecarlo-investigator"],
    "montecarlo-investigator": []
  },
  "child_map": {
    "montecarlo-investigator": ["mock-incident"],
    "mock-incident": []
  },
  "skills": [
    {
      "name": "Investigate MC Alerts",
      "path": "/.agents/skills/investigate-mc-alerts/",
      "source": "local",
      "description": "...",
      "keywords": ["montecarlo", "alerts"],
      "content": "Full SKILL.md content..."
    }
  ],
  "mcps": [
    {"name": "montecarlo", "transport": "http", "url": "https://api.montecarlo.io"}
  ],
  "contexts": [
    {
      "name": "platform-overview",
      "provider": "local",
      "source": "context/platform-overview.md",
      "content": "# Platform\\n\\n…",
      "used_by": ["agent:mock-incident"]
    }
  ],
  "test_suites": [],
  "sources": {
    "ticket": {
      "unique_id": "source.my-project.ticket",
      "name": "ticket",
      "type": "jira_issue",
      "description": "",
      "credentials_ns": "jira",
      "config": {"issue_key": "{{ var('ticket_id') }}"},
      "deferred_config": [],
      "io_required_var_names": ["ticket_id"],
      "freshness": {},
      "source_path": "sources/ticket.yaml",
      "used_by": ["triage"],
      "tags": []
    }
  },
  "exposures": {
    "ticket_writeback": {
      "unique_id": "exposure.my-project.ticket_writeback",
      "name": "ticket_writeback",
      "type": "jira_comment",
      "description": "",
      "credentials_ns": "jira",
      "config": {},
      "deferred_config": [],
      "io_required_var_names": [],
      "freshness": {},
      "source_path": "exposures/ticket_writeback.yaml",
      "tags": [],
      "adhoc_only": false
    }
  },
  "prompts": {
    "close_out": {
      "unique_id": "prompt.my-project.close_out",
      "name": "close_out",
      "source_path": "prompts/close_out.md",
      "content": "Write the closing note summarizing the resolution.",
      "compiled_content": "Write the closing note summarizing the resolution.",
      "description": "",
      "tags": []
    }
  },
  "retrievers": {},
  "transformers": {
    "pii_redact": {
      "unique_id": "transformer.my-project.pii_redact",
      "name": "pii_redact",
      "type": "pii_redact",
      "description": "",
      "credentials_ns": "pii_redact",
      "config": {},
      "prompt_ref": null,
      "model_id": null,
      "temperature": null,
      "source_path": "transformers/pii_redact.yaml",
      "tags": []
    }
  },
  "triggers": {
    "every_morning": {
      "unique_id": "trigger.my-project.every_morning",
      "name": "every_morning",
      "type": "cron",
      "description": "",
      "credentials_ns": "cron",
      "config": {"schedule": "0 8 * * *"},
      "filter": {},
      "enabled": true,
      "source_path": "triggers/every_morning.yaml",
      "tags": []
    }
  },
  "handlers": {},
  "tools": {},
  "tool_import_errors": [],
  "project_config": {"recursion_limit": null, "checkpoint": null, "approvals": null, "handlers": {}, "...": "..."},
  "benchmarks": {}
}

Key Fields

Field Description
metadata.schema_version Current value is "v2". It changes when the schema changes in a breaking way.
workflows Topology from one file per workflow under workflows/, keyed by workflow name — WorkflowResource: trigger, max_iterations, and edges (PlainEdge: source/target; ConditionalEdge: source/conditions/default, desugared uniformly whether authored as steps:, when:/cases:, or conditions:). The single source of truth for order and branching — see Workflows.
sources Standalone sources/*.yaml, keyed by name — same grain as agents. Referenced by name from a workflow's own edges: (a source node, wired ahead of the agent that reads it). deferred_config lists the paths in config that are rendered when the source runs (strings that use env_var(), and strings inside nested maps or lists); every other string is final text.
exposures Standalone exposures/*.yaml, keyed by name. Referenced by name from a workflow's own edges: (an exposure sink node, wired after the agent whose result it delivers). deferred_config works as on sources.
retrievers Standalone retrievers/*.yaml (StandaloneRetrieverResource), keyed by name. Referenced from an agent's own retrievers: list.
transformers Standalone transformers/*.yaml (StandaloneTransformerResource), keyed by name. Referenced from an agent's own transformers: list.
triggers Standalone triggers/*.yaml (StandaloneTriggerResource), keyed by name. enabled: false unless the YAML sets it explicitly; dormant triggers are skipped by abt watch. Referenced by bare name from a workflow's own trigger: field.
prompts Named user-message templates from prompts/**/*.md, keyed by path (minus .md). Referenced by name from a workflow's own edges: (a prompt node), or passed via -p/--prompt on abt run/abt dispatch.
handlers Discovered Handler subclasses under paths.handlers, keyed by class name.
tools Python tools from paths.tools and installed packages, keyed by tool name: description, args_schema (JSON Schema), origin (project, or package:<directory> for an installed package) and file (the name of the module that exposes it). Compile checks agents' tools: against it; the runtime imports a tool's module from here on first use.
tool_import_errors Tool modules that failed to import at compile, each with its error message and the tool_names it declares. Their tools are absent from tools.
project_config The compiled abt.yaml config: (+ top-level approvals: and agents.<name>.config overlays as agent_overrides), var()-rendered and validated. handlers is resolved against the handler registry. The runtime's only view of project settings.
benchmarks benchmarks/*.yaml, keyed by file name, checked against the compiled workflows — see Benchmarks. Empty for a selective compile (-s).
metadata.invocation_id UUID4, unique per compile run. Useful for tracing.
metadata.default_model The active profile's model ID, for display fallback in docs. Empty if no profile was loaded.
metadata.env_vars Names (never values) of env vars env_var() resolved during compile; the partial-parse cache re-checks their values.
agents Dictionary keyed by agent name. Each entry is an AgentResource.
agents[].unique_id "agent.<project_name>.<name>" -- globally unique identifier.
agents[].raw_system_prompt Markdown body before template expansion. Empty for .py agents. Needed to re-extract context.*() refs (selective/lazy compile); not runnable as-is.
agents[].runtime_system_prompt Rendered prompt actually sent to the LLM when file tools are available: large context.*() content becomes a /workspace/context/... file pointer instead of being inlined.
agents[].runtime_system_prompt_no_file_tools Rendered prompt actually sent to the LLM when file tools are unavailable: context content is inlined, and subject to each context.*(max_chars=...) truncation (must fit in the prompt with no file-tool fallback).
agents[].system_prompt Manifest/docs-facing snapshot: context content always inlined in full, never truncated. Empty string for Python-defined agents (dynamic prompts cannot be statically compiled). Byte-identical to runtime_system_prompt_no_file_tools in the common case (no context.*() refs, or none with max_chars set) — but not interchangeable with it.
agents[].few_shots List of file contents (already read from disk). Self-contained.
agents[].activates List of ActivatesRef with optional model_id_override and temperature_override. Populated from the agent's own subagents: frontmatter — activates is the manifest field name.
parent_map Agent → list of agents it activates (upstream).
child_map Agent → list of agents that activate it (downstream).

CLI Usage

# Validate + write target/manifest.json (default)
abt compile --project-root .

# Validation only -- no file written (CI lint check)
abt compile --project-root . --no-manifest

# Also start MCP servers, and fail on a failed external-context or remote-skill fetch (a default compile only warns)
abt compile --project-root . --live

# Skip the partial_parse.msgpack cache (always recompute)
abt compile --project-root . --no-partial-parse

# Docs: compile manifest internally, write it, then render HTML from it
abt docs generate --project-root .

Partial parse cache (partial_parse.msgpack)

On every successful compile, the workflow writes target/partial_parse.msgpack alongside manifest.json. On the next compile, abt recomputes a fingerprint over: the abt version; size + mtime of every file under each compile-relevant dir resolved from abt.yaml paths: (agents/, prompts/, sources/, exposures/, retrievers/, transformers/, triggers/, mcps/, tests/, contracts/, few_shots/, tools/, providers/, handlers/, macros/, skills/ — all configured dirs, defaulting to .abt/skills); the top-level abt.yaml/abt.yml, profiles.yaml/profiles.yml, and abt_packages.yml/abt_packages.yaml; the active profile identity when one is set (type, model_id, region, temperature, max_tokens — so switching --target invalidates the cache); plus CLI template vars, --live, --lazy, selector, and prompt stem. If the fingerprint matches, the manifest is loaded directly from msgpack (≈1 order of magnitude faster than a full compile); if not, abt falls back to a full compile and rewrites the cache.

Disable the cache with --no-partial-parse on the CLI, or globally with ABT_PARTIAL_PARSE=0. abt clean removes it.

Live compile

compile_manifest(..., live=True) (CLI: --live) makes compile start the project's MCP servers to list their tools, and fail when an external-context or remote-skill fetch fails, so you get a true snapshot. By default MCP tool lists are deferred to runtime and a failed fetch only warns; all other compile steps (template expansion, context materialization, agent wiring) run as normal, and a local mistake such as an invalid agent file or an unknown tool still fails immediately. Leave live off for inner-loop work when MCP sources are unavailable or slow; use it in CI. See Live compile.

Output of abt compile:

  Manifest ready (2 agents).
Compiled 2 agent(s).
Manifest written to: target/manifest.json
Compiled 3 file(s) to: target/compiled/<project>  (agents: 2, prompts: 1)

abt compile does not require a profiles.yaml. It tries to load one (to populate default_model in metadata) and continues if none is found. If one is found, every env_var(...) in its env: block must resolve, or the compile stops with environment variable '<NAME>' is not set and no default was given. Credentials under credentials: are resolved only when a selected agent needs them, so a compile never fails for an API key that no compiled agent uses.


How abt run and abt dispatch Use the Manifest

abt run --manifest <path> (manifest-only)

abt run and abt dispatch both accept --manifest PATH to skip the project bootstrap and compile entirely: the file on disk is the single source of truth. This matches dbt's "the manifest is the project" discipline and enables:

  • CI deploy artifacts — compile once, ship manifest.json, run against it anywhere without cloning sources.
  • Reproducible replay — record a compile in one environment, run in another with zero source-file dependencies.
  • Fast cold starts — no agent discovery, no YAML scanning, no context resolution.
abt compile --project-root .                                   # once
abt run --manifest target/manifest.json -s assistant -p "hi"
abt dispatch --manifest target/manifest.json -s my_workflow

A valid profiles.yaml is still required for anything that actually calls a model, but agent definitions are never re-parsed.

abt dispatch -s <workflow> (dispatch a workflow)

abt dispatch only accepts a workflow name from a workflow file under workflows/ — no sigils and no selector flags. Given a known agent name instead it redirects with a clear error: 'triage' is an agent, not a workflow. `abt dispatch` only accepts workflow names — use `abt run -s triage` to run it.

  1. Compile: bootstrap passes compile_selector so the manifest slice matches the workflow's agent set (same idea as abt compile -s).
  2. Select: resolve_workflow_selection(manifest, name) → WorkflowResource — the workflow-only mirror of resolve_selection. Raises a redirect-shaped error when name is a known agent instead (pointing at abt run).
  3. Execute: the workflow runner walks steps:/edges: from START, dispatching each node in turn. Source and prompt nodes compose the turn an agent node sees; each agent node then runs its own retrievers:, runs the turn, applies its own transformers:, and any exposure node wired after it dispatches the moment that agent succeeds — independent of whether the rest of the workflow later succeeds or crashes (--expose overrides with an ad-hoc route instead of the catalog exposures). Conditional edges (when:/cases: or conditions:) read output.<field> from the source node's output_schema to pick the next node; default: is required and structurally guarantees a match.

abt run -s <agent> (rehearse an agent)

abt run only accepts an agent name — plus its full subagents: delegation tree, unbounded. It never runs a workflow neighbor; workflow isolation is structural, not a flag. Given a known workflow name instead it redirects: 'support_ticket' is a workflow, not an agent.abt runonly accepts agent names — useabt dispatch -s support_ticketto run it.

  1. Compile: same selector-scoped compile as abt dispatch.
  2. Select: resolve_selection(manifest, name) → SelectedAgent (the agent plus its full upstream subagents: closure — no depth argument, no isolation mode).
  3. User message: -p/--prompt — literal text, or a prompts/ stem when it matches.
  4. Exposures: abt run does not fetch sources or dispatch exposures; use abt dispatch -s <workflow> for that.

Agent definitions are parsed exactly once per invocation for manifest build + selector resolution. The manifest eliminates duplicate parsing of Markdown agents, even though Python-defined agents may still be re-imported by resource_to_node() to rebuild AgentNode.system_prompt.

At run time, the manifest's serialised agent entries are converted back to the runtime agent objects, so the same run machinery works for manifest-only runs and for runs that compile first.


How Docs Generation Uses the Manifest

abt docs generate calls compile_manifest(), writes target/manifest.json, then passes the WritableManifest object to abt.docs.generate() with an explicit project root (so tool discovery does not fall back to an arbitrary cwd). The docs renderer calls build_data_from_manifest(manifest, project_root=…) which:

  1. Converts AgentResource objects to the JSON format the HTML template expects
  2. Resolves skill paths (from manifest.skills) against each agent's skills list
  3. Builds subagent detail cards by looking up manifest activates names in manifest.agents
  4. Computes MCP used_by from all agents' tools (any "mcp_name:tool" spec)
  5. Discovers @tool callables under paths.tools (same as runtime: modules are imported) and adds python_tools for the Integrations tab; ABT_DOCS_SKIP_PYTHON_TOOLS skips that import (see Environment variables)
  6. Labels few_shots as Trajectory 1, Trajectory 2, etc.
  7. Builds the entrypoint list (workflows with a trigger: — the "what can I press?" view) and the per-agent Catalog cards: sources, exposures, retrievers, transformers are each owned by the agent that declares them and are surfaced directly on that agent's row — there is no separate workflow-level catalog.
  8. The Lineage graph shows agent nodes (subagents: delegation edges), workflow edges (plain and conditional, from workflow files under workflows/), context nodes (used_by → agent), and source / prompt / exposure workflow-node cards wired in at their real position in each workflow's own edge graph (not agent-owned — see Workflows), plus trigger nodes wired to their workflow's entry agent. MCP, tool, and skill usage get their own node types and edges too. Clicking a source/exposure node shows its type/credentials; clicking a prompt node shows its content preview and whether it's static text or templated with {{ var(...) }}/{{ upstream(...) }}/etc.

The HTML renderer receives a plain dict and renders it (no second pass over agent source files).

abt.docs.generate() is manifest-first and passes project root into build_data_from_manifest() so the Integrations tab can list both MCP sources and Python tools.


Using the Manifest from External Tools

The manifest is a standard JSON file. Any tool that can read JSON can consume it.

Example: list all agents with their tools (shell)

cat target/manifest.json | python3 -c "
import json, sys
m = json.load(sys.stdin)
for name, agent in m['agents'].items():
    print(f'{name}: {agent[\"tools\"]}')
"

Example: load in Python

import json
from pathlib import Path
from abt.artifacts import WritableManifest

manifest = WritableManifest.model_validate_json(
    Path("target/manifest.json").read_text()
)

# Find all agents with upstream dependencies in the manifest
with_upstream = [a for a in manifest.agents.values() if a.activates]

# Traverse upstream dependencies
def upstream(name: str) -> list[str]:
    return manifest.parent_map.get(name, [])

# Find agents using a specific MCP
mc_agents = [
    name for name, a in manifest.agents.items()
    if any(t.startswith("montecarlo__") for t in a.tools)
]

Example: check for system prompt changes in CI

import json
from pathlib import Path

old = json.loads(Path("old/manifest.json").read_text())
new = json.loads(Path("target/manifest.json").read_text())

for name, agent in new["agents"].items():
    old_prompt = old["agents"].get(name, {}).get("system_prompt", "")
    if agent["system_prompt"] != old_prompt:
        print(f"CHANGED: {name}")