Loading...
Loading...
Use when building custom agent backends, implementing the AG-UI protocol, debugging streaming issues, or understanding how agents communicate with frontends. Covers event types, SSE transport, AbstractAgent/HttpAgent patterns, state synchronization, tool calls, and human-in-the-loop flows.
npx skill4agent add copilotkit/skills copilotkit-aguiAbstractAgent.run()Observable<BaseEvent>AbstractAgent.run()copilotkit-developcopilotkit-setupcopilotkit-integrations| Family | Events | Purpose |
|---|---|---|
| Lifecycle | | Run boundaries and progress |
| Text | | Streaming text messages |
| Tool Calls | | Agent tool invocations |
| State | | State synchronization |
| Reasoning | | Chain-of-thought visibility |
| Activity | | Structured progress updates |
| Custom | | Extension points |
TEXT_MESSAGE_CHUNKTOOL_CALL_CHUNKtransformChunksdata: {"type":"RUN_STARTED","threadId":"t1","runId":"r1"}\n\n
data: {"type":"TEXT_MESSAGE_START","messageId":"m1","role":"assistant"}\n\n
data: {"type":"TEXT_MESSAGE_CONTENT","messageId":"m1","delta":"Hello"}\n\n
data: {"type":"TEXT_MESSAGE_END","messageId":"m1"}\n\n
data: {"type":"RUN_FINISHED","threadId":"t1","runId":"r1"}\n\n| Package | npm | Purpose |
|---|---|---|
| Events, types, schemas | Protocol definition |
| AbstractAgent, HttpAgent, middleware, event application | Client SDK |
| EventEncoder (SSE + protobuf) | Server-side encoding |
RunAgentInputtext/event-streamthreadIdrunIdmessagestoolsstatecontextRUN_STARTEDRUN_FINISHEDRUN_ERROR@ag-ui/encoderEventEncoder.encode()data: JSON\n\nTOOL_CALL_RESULTreferences/building-agents.mdRUN_STARTEDRUN_FINISHEDRUN_ERRORTEXT_MESSAGE_CONTENT.deltatoolCallIdSTATE_DELTASTATE_SNAPSHOTreferences/protocol-spec.mdreferences/building-agents.mdreferences/event-flow-diagrams.mdreferences/client-sdk.md