Module Developer Guide¶
This guide covers creating custom modules that extend Amplifier's capabilities: providers, tools, hooks, orchestrators, and context managers.
Looking for something else?
- Building applications on amplifier-core? → See Application Developer Guide
- Contributing to the foundation? → See Foundation Developer Guide
- Using the CLI? → See User Guide
This guide is for extending Amplifier with new capabilities, not building applications or contributing to the core.
Topics¶
Module Development
Create custom providers, tools, hooks, orchestrators, and context managers.
Module Contracts
Reference documentation for module interfaces.
Quick Start¶
Creating a Module¶
# Create module directory
mkdir amplifier-module-tool-myname
cd amplifier-module-tool-myname
# Initialize project
cat > pyproject.toml << 'EOF'
[project]
name = "amplifier-module-tool-myname"
version = "1.0.0"
dependencies = []
[project.entry-points."amplifier.modules"]
tool-myname = "amplifier_module_tool_myname:mount"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
EOF
# Create module code
mkdir amplifier_module_tool_myname
cat > amplifier_module_tool_myname/__init__.py << 'EOF'
async def mount(coordinator, config=None):
tool = MyTool(config or {})
await coordinator.mount("tools", tool, name="myname")
return None
class MyTool:
name = "myname"
description = "My custom tool"
input_schema = {"type": "object", "properties": {}}
def __init__(self, config):
self.config = config
async def execute(self, input):
return {"success": True, "output": "Hello!"}
EOF
Testing Locally¶
# Install in development mode
uv pip install -e .
# Test with Amplifier
amplifier source add tool-myname file://$(pwd)
amplifier run --profile dev "Test my new tool"
Philosophy¶
Amplifier's development philosophy emphasizes:
- Modules are independent: No peer dependencies
- Contracts are stable: Backward compatibility is sacred
- Test in isolation: Mock the coordinator
- Regenerate, don't edit: Rebuild modules from spec
Module Types¶
| Type | Purpose | Contract |
|---|---|---|
| Provider | LLM backends | Provider Contract |
| Tool | Agent capabilities | Tool Contract |
| Hook | Observability | Hook Contract |
| Orchestrator | Execution loops | Orchestrator Contract |
| Context | Memory management | Context Contract |