Agent contract and load it from the manifest.
An agent is an LLM-driven capability registered alongside tools. You implement one interface — the Agent contract — and the runtime derives two faces from it: a JSON run tool (LLM, MCP, and flow-engine facing) and an in-process astream method (API and SSE facing). You write only the Agent class; no hand-written tool wrapper.
Implement the Agent contract
SubclassAgent, declare the three class attributes that drive tool generation, and implement run. run is the primitive; the base class provides a default astream that runs once and emits one terminal event, which streaming agents override.
myapp/agents.py
ToolInput is a JSON-able pydantic model of the tool parameters — a non-JSON field fails loudly when its schema is generated. The @tai42_app.agents.agent(name) decorator registers the agent and auto-registers its JSON run tool.
Load it from the manifest
Name the module underagents[]. Importing it runs the decorator.
manifest.yml
Run it
1
List registered agents
2
Stream a run
Stream a run one event frame at a time, passing the input as a JSON object.
See also
- Agents — the two faces of one
Agentclass. - Deep agents — sub-agents, skills, and strategies.
- Author an agent plugin — ship an agent as a distributable plugin.
- Python SDK reference — the
Agentcontract surface.

