How 11 lines of YAML become a running agent
Foundation is the layer that makes thin Amplifier bundles runnable — so no app has to hand-wire the plumbing itself. It first imported on 2025-12-09.
First, just how thin can a bundle get?
providers/anthropic-sonnet.yaml is 11 lines and fully describes a provider/agent — name, version, description, and one provider module with its source and config.
But eleven lines can't run themselves.
Without a shared layer, every app re-implements the same wiring — and if heavy docs are always loaded, they poison every session's context.
So how does the shared layer do the wiring instead?
compose() deep-merges bundles — later overrides earlier. prepare() downloads and activates the modules a bundle references, returning a runnable PreparedBundle.
That solves duplicated plumbing. Now the docs problem.
compose(self, *others: Bundle) -> Bundle — merges configuration; later overrides earlier.async def prepare(...) -> PreparedBundle — downloads & activates modules into a runnable bundle.The @namespace:path system pulls context in by reference. Expert agents act as context sinks — their heavy docs load ONLY when the agent is spawned, not into every session.
And the verbs don't stop there — they apply to themselves.
@my-bundle:docs/FULL_GUIDE.md — heavy docs, loaded only when spawned.spawn() launches a child sub-session from a child bundle. By default (compose: bool = True) the child is composed with its parent — the verbs compose on themselves.
Which means the platform can be built the same way it runs an agent.
bundle.md (v2.0.0) is a thin manifest whose includes: list composes 20 other bundles — 7 internal behaviors and 13 external git+https bundles. The same four verbs build the whole platform.
Composition all the way down.
A 3,809-line composition core — inside the 13,331-line library — lets an 11-line bundle become a running, self-composing agent. That leverage is the reusable pattern.
Thin at the edges, composable at the center.
Feature status: Shipped compose · prepare · spawn · @mentions all verified in current HEAD.
Repository: microsoft/amplifier-foundation (local checkout, HEAD 0965a34, 2026-04-09).
Data as of: HEAD 0965a34 — first import c1d26bf 2025-12-09; 502 commits on branch.
Commands run:
for f in providers/*.yaml; do echo "$(wc -l < "$f") $f"; done → anthropic-sonnet.yaml = 11 linesgrep -n 'def compose' amplifier_foundation/bundle/_dataclass.py → line 93grep -n 'async def prepare' amplifier_foundation/bundle/_dataclass.py → line 240grep -n 'async def spawn' amplifier_foundation/bundle/_prepared.py → line 433sed -n '1,40p' amplifier_foundation/mentions/parser.py → parse_mentions / load_mentionshead -60 bundle.md ; grep -c '^\s*- bundle:' bundle.md → v2.0.0, 20 bundles (7 internal + 13 git+https)find amplifier_foundation/ -name '*.py' | xargs wc -l | tail -1 → 13,331 lines / 63 fileswc -l _dataclass.py _prepared.py registry.py spawn_utils.py mentions/*.py → 3,809 lines (composition core)git log --oneline | wc -l → 502 commits; git shortlog -sn --all → Brian Krabach 739 commitsGaps: The composition-all-the-way-down phrase is the topic's framing, strongly supported (bundle.md composing 20 bundles) but not a verbatim slogan in the source. Earlier "8,645 LOC" figures were not reproducible at this HEAD and are not used.
Primary contributor: Brian Krabach (739 commits, dominant author; authored initial import).