Introduction
The toolkit for production-ready LLM Agents
AgentKit is a Go toolkit designed to help developers build LLM agents and AI-powered applications.
Integrating large language models (LLMs) into Go applications is complicated and heavily dependent on the specific model provider you use. AgentKit standardizes LLM integrations across supported providers, enabling developers to focus on building great AI applications rather than dealing with technical complexity.
Why use AgentKit?
Building LLM agents requires handling multiple concerns:
- Model Provider Abstraction: Different APIs for OpenAI, Anthropic, Google, etc.
- Conversation Management: Message history, context windows, and memory
- Tool Integration: Function calling and external system integration
- Streaming Support: Real-time response handling
- Error Handling: Robust failure recovery and retry logic
AgentKit handles all of this for you with a simple, unified Go API.
Quick Example
Here's how easy it is to create an agent with AgentKit:
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/model-box/agent-kit/agent"
"github.com/model-box/agent-kit/model"
"github.com/model-box/agent-kit/session"
)
func main() {
// Create a model using chainable API
model := model.Model("gpt-4o").
SetAPIKey(os.Getenv("OPENAI_API_KEY"))
// Create an agent using chainable API
ag := agent.New().
SetModel(model).
SetSystemPrompt("You are a helpful assistant.")
}
// Create session and run
ctx := context.Background()
session := session.New(ag)
result, err := session.Run(ctx, []agent.ChatMessage{agent.NewUserMessage("Hello! What can you help me with?")}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(result.FinalOutput)
}
Core Features
🔌 Provider Abstraction
Switch between OpenAI, Anthropic, Google, and other providers with just a few lines of code.
🔄 Conversation Management
Built-in support for multi-turn conversations with automatic context management.
🛠️ Tool Integration
Define custom tools with JSON schema validation for function calling.
⚡ Streaming Support
Real-time streaming responses for better user experience.
🧵 Agent Sessions
Persistent conversation sessions with automatic history management.
Model Providers
AgentKit currently supports:
- OpenAI - GPT-4, GPT-3.5, and other OpenAI models
- Custom Providers - Implement your own provider interface
More providers are coming soon.
Next Steps
- Quick Start - Build your first agent in 5 minutes
- Agents - Learn about agent configuration
- Models - Explore different model providers
- Examples - See practical usage examples