Skip to content

abt plugin examples

A real, installable package with one working example per abt.* entry-point group except abt.source_thread_keys — the runnable companion to Extending abt with plugins. Every file under src/abt_plugin_examples/ does something genuinely useful on its own, not just a no-op stub.

Try it

# from the abt repo root, into the same venv abt is installed in
uv pip install -e docs/build/examples/abt_plugin_examples

cd your-abt-project
abt doctor            # runs profiles_yaml_gitignored_rule once for the project

Uninstall when you're done: uv pip uninstall abt-plugin-examples.

What's here

Group Registered name File What it does
abt.source_providers static_text sources.py Returns config["text"] verbatim — no external call
abt.exposure_dispatchers jsonl_audit_log exposures.py Appends every run result as one JSON line to a local file
abt.singular_tests smoke singular_tests.py One-agent, one-prompt smoke test file (tests/*.yaml with a smoke: key)
abt.context_providers local_file context_providers.py {{ context.local_file(name, path=...) }} reads a file under the project root
abt.model_providers fake_echo model_providers.py Zero-cost, no-network chat model — echoes the last human message
abt.retriever_providers local_grep retrievers.py Greps the project tree for a query string
abt.transformer_providers word_replace transformers.py Literal find/replace on the final response text
abt.checkpoint_backends demo_memory checkpoints.py wrap_checkpointer around MemorySaver — shows the zero-class-boilerplate path
abt.middleware response_length_logger middleware.py Logs the character length of every model response
abt.doctor_rules profiles_yaml_gitignored doctor_rules.py Flags a profiles.yaml that exists but isn't in .gitignore
abt.mcp_loaders env_mcp mcp_loaders.py Registers an MCP source from EXAMPLE_MCP_URL if set, dynamically
abt.external_approvals local_file approvals.py HITL approval resolved by hand-editing a local JSON file

Per-group quick tries

Assumes the package above is installed and you're inside a compiled abt project.

doctor rule — abt doctor; flags a non-gitignored profiles.yaml.

mcp loader — EXAMPLE_MCP_URL=https://example.invalid/mcp abt compile then inspect the resolved MCP sources (abt doctor or your own script against abt.mcps.registry) for a source named env_mcp.

source — wire it as a node in a workflow's edges:. A source type: with no real credentials (like this one) declares requires_credentials: false in its sources/*.yaml, which skips the credentials-presence check entirely (no profiles.yaml entry needed):

# sources/hello.yaml
name: hello
type: static_text
config:
  text: "hello from a plugin source"
requires_credentials: false

exposure — same idea as a workflow exposure node: exposures/audit.yaml with type: jsonl_audit_log, config: {path: target/audit.jsonl}.

model provider — set model_id: fake_echo:anything for a profile target in profiles.yaml, then abt run -s <agent> -p "hi" --target <that-target>.

smoke test — a tests/smoke_hello.yaml file:

smoke:
  agent: my-agent
  prompt: "hi"

Run with abt test -s my-agent.

context provider — in a prompt: {{ context.local_file('readme', path='README.md') }} (first arg is a slot name, required).

retriever — reference local_grep wherever a retriever's type: field accepts a retriever type, with config: {glob: "**/*.md", max_hits: 20}. The search string comes from the retriever's query: template (or the prompt), not from config.

transformer — type: word_replace, config: {replacements: {"Acme Corp": "[REDACTED]"}}.

checkpoint backend — backend: demo_memory in a checkpoint spec.

middleware — add to an agent's middleware: list:

middleware:
  - response_length_logger: {}

Zero-config middleware can use the bare-string shorthand instead (- response_length_logger).

external approval — type: local_file under approvals.resources; approve by editing the written JSON file's decision field to "approved" or "denied".