🚀
极致性能
智能体实例化仅需 ~180ns,比 Python 版本快 16 倍。每个智能体内存占用仅 1.2KB,原生支持 Go 并发。
仅需几行代码即可创建带工具的 AI 智能体:
package main
import (
"context"
"fmt"
"github.com/rexleimo/agno-go/pkg/agno/agent"
"github.com/rexleimo/agno-go/pkg/agno/models/openai"
"github.com/rexleimo/agno-go/pkg/agno/tools/calculator"
)
func main() {
// 创建模型
model, _ := openai.New("gpt-4o-mini", openai.Config{
APIKey: "your-api-key",
})
// 创建带工具的智能体
ag, _ := agent.New(agent.Config{
Name: "数学助手",
Model: model,
Toolkits: []toolkit.Toolkit{calculator.New()},
})
// 运行智能体
output, _ := ag.Run(context.Background(), "25 * 4 + 15 等于多少?")
fmt.Println(output.Content) // 输出: 115
}
指标 | Python Agno | Agno-Go | 改进 |
---|---|---|---|
智能体创建 | ~3μs | ~180ns | 快 16 倍 |
内存/智能体 | ~6.5KB | ~1.2KB | 减少 5.4 倍 |
并发性 | GIL 限制 | 原生 goroutine | 无限制 |
Agno-Go 不仅是一个框架——它是一个完整的生产系统。包含的 AgentOS 服务器提供:
遵循 Keep It Simple, Stupid 哲学:
# 克隆仓库
git clone https://github.com/rexleimo/agno-Go.git
cd agno-Go
# 设置 API 密钥
export OPENAI_API_KEY=sk-your-key-here
# 运行示例
go run cmd/examples/simple_agent/main.go
# 或启动 AgentOS 服务器
docker-compose up -d
curl http://localhost:8080/health
Agno-Go 基于 MIT 许可证 发布。
灵感来自 Agno (Python) 框架。