PAIPAI

Backend

Define, run, and serve agents from TypeScript.

Backend code defines agent behavior and binds it to infrastructure.

The common path:

defineAgent -> createPaiHonoReceiver -> framework route

Advanced path:

defineAgent -> createAgentRuntime -> HTTP receiver -> framework adapter

Start 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.