Examples
Explore these practical examples to learn how to build AI agents with the Go SDK.
| Example | Description |
|---|---|
| Basic Agent | A minimal example showing how to create and run a simple agent. |
| Function Calling Tools | Demonstrates how to equip agents with tools (Go functions). |
| Agent Handoffs | Shows how multiple agents can work together by handing off tasks. |
| Lifecycle Hooks | Learn how to use hooks to intercept and instrument agent execution. |
| Config & Usage | Advanced configuration options and usage tracking. |
| Structured Outputs | How to force agents to return data in specific JSON formats. |
| Complex Schema | Handling complex nested data structures in outputs. |
| Guardrails Demo | Implementing safety guardrails for production agents. |
| Sessions Demo | Maintaining conversation state across multiple turns. |
| Advanced Features | Showcase of multiple features working together. |
| Conversations API | Using the new Conversations API for session management. |
| Error Handling | Robust error handling strategies. |
| Session Backends | Using SQLite and custom session storage. |
| Multimodal Tools | Returning images and files from tools. |
| Guardrail Composition | Chaining, parallel execution, and metrics. |
| Production Chatbot | Complete chatbot with multimodal tools, guardrails, and persistence. |