Backend
Define, run, and serve agents from TypeScript.
Backend code defines agent behavior and binds it to infrastructure.
The common path:
defineAgent -> createPaiHonoReceiver -> framework routeAdvanced path:
defineAgent -> createAgentRuntime -> HTTP receiver -> framework adapterStart with Define An Agent, then Serve An Agent. Use Lifecycle Hooks when agent behavior needs RAG, guardrails, canonical output transforms, model fallback, or tool policy.