Skip to content

RFC 0002: Agent Composition — Declarative Multi-Agent Coordination#2273

Open
ImenGBY wants to merge 3 commits intostrands-agents:mainfrom
ImenGBY:feature/agent-composition
Open

RFC 0002: Agent Composition — Declarative Multi-Agent Coordination#2273
ImenGBY wants to merge 3 commits intostrands-agents:mainfrom
ImenGBY:feature/agent-composition

Conversation

@ImenGBY
Copy link
Copy Markdown

@ImenGBY ImenGBY commented May 10, 2026

RFC 0002: Agent Composition — Declarative Multi-Agent Coordination

What

Proposes a strands.composition module that resolves agent dependencies and computes coordination from manifest declarations (RFC 0001). Given agents with manifests and a set of available resources, the module determines which agents can activate, which are blocked, what's missing, and how they connect.

Why

RFC 0001 gave agents the ability to declare inputs and outputs. But declarations alone don't compose agents — developers still manually check dependencies, wire routing, and manage lifecycle. This RFC adds the resolution engine that makes manifests actionable:

  • BindingResolver: Evaluates the full dependency surface (events, features, tools, KBs). Reports gaps.
  • EventRouter: Derives the event flow graph from declarations. No manual wiring.
  • LifecycleManager: Reactive dormant/active transitions when resources change.
  • CompositionRegistry: Local catalog for dependency resolution across agents.

How it relates to existing patterns

This is a third multi-agent pattern alongside Graph and Swarm:

Graph Swarm Composition
Structure defined by Developer (imperative) Agents at runtime Manifest declarations
Adding a new agent Edit graph code Add to node list Register manifest
Dependency validation None (runtime failure) None (runtime failure) At registration time
Best for Fixed pipelines Collaborative tasks Plug-and-play extensibility

These are complementary, not competing.

Key design decisions

  • Pure Python, no infrastructure dependencies — testable locally
  • Builds on AgentManifest.satisfies() from RFC 0001
  • Does not execute agents or deliver events — that's the runtime's job
  • Declarative: you specify WHAT agents need, the engine derives HOW they connect

Open question

If this is considered too opinionated for core, happy to maintain it as a standalone package under strands-agents/composition with no changes to the implementation.

Dependencies

  • RFC 0001 (AgentManifest) must be merged first

imengby added 2 commits May 10, 2026 00:27
Add optional AgentManifest to the Agent class that formally declares
input requirements, output types, trigger conditions, and tool
capabilities. This enables platforms to manage agent lifecycle,
resolve dependencies automatically, and compose agents into chains
without custom wiring.

New files:
- src/strands/agent/manifest.py: AgentManifest, InputContract,
  OutputContract, Trigger dataclasses with serialization support
- tests/strands/agent/test_manifest.py: 24 unit tests
- rfcs/0001-agent-manifest.md: Design rationale and usage examples

Modified files:
- src/strands/agent/agent.py: Added manifest parameter to Agent.__init__
- src/strands/agent/__init__.py: Export new classes

The manifest is purely declarative metadata. It does not change agent
execution behavior and has zero impact on prompt caching. Existing
agents without manifests work exactly as before.
Implements the composition engine proposed in RFC 0002:
- CompositionRegistry: local catalog of agents and manifests
- BindingResolver: evaluates full dependency surface, reports gaps
- EventRouter: derives event flow graph from declarations
- LifecycleManager: reactive dormant/active transitions

All 31 tests passing. Pure Python, no external dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant