Module Contracts¶
Contracts define the interfaces that modules must implement. They are the stable "studs" that allow modules to be developed and swapped independently.
Contract Philosophy¶
- Stable: Contracts rarely change
- Backward compatible: Changes are additive
- Protocol-based: Duck typing via structural subtyping
- Documented: Clear expectations and examples
Available Contracts¶
| Contract | Purpose | Link |
|---|---|---|
| Provider | LLM backend integration | Provider Contract |
| Tool | Agent capabilities | Tool Contract |
| Hook | Observability and control | Hook Contract |
| Orchestrator | Execution loop strategy | Orchestrator Contract |
| Context | Memory management | Context Contract |
Contract Structure¶
Each contract document covers:
- Purpose: What this module type does
- Protocol: The interface definition
- Mount Function: How to register with the kernel
- Configuration: Available options
- Events: Events emitted/handled
- Examples: Reference implementations
Authoritative Sources¶
The authoritative contract documentation lives in amplifier-core: