Installation
This guide covers different ways to install and set up Agno-Go.
Prerequisites
- Go 1.21 or later - Download Go
- API Key - OpenAI, Anthropic, or Ollama (for local models)
- Git - For cloning the repository
Method 1: Go Get (Recommended)
Install Agno-Go as a Go module dependency:
go get github.com/rexleimo/agno-Go
Then import in your code:
import (
"github.com/rexleimo/agno-Go/pkg/agno/agent"
"github.com/rexleimo/agno-Go/pkg/agno/models/openai"
)
Method 2: Clone Repository
Clone the repository to explore examples and contribute:
# Clone repository
git clone https://github.com/rexleimo/agno-Go.git
cd agno-Go
# Download dependencies
go mod download
# Verify installation
go test ./...
Method 3: Docker
Use Docker to run AgentOS server without installing Go:
Using Docker
# Build image
docker build -t agentos:latest .
# Run server
docker run -p 8080:8080 \
-e OPENAI_API_KEY=sk-your-key \
agentos:latest
Using Docker Compose (Full Stack)
# Copy environment template
cp .env.example .env
# Edit .env and add your API keys
nano .env
# Start all services
docker-compose up -d
This starts:
- AgentOS server (port 8080)
- PostgreSQL database
- Redis cache
- ChromaDB (optional, for RAG)
- Ollama (optional, for local models)
API Keys Setup
OpenAI
- Get API key from OpenAI Platform
- Set environment variable:
export OPENAI_API_KEY=sk-your-key-here
Anthropic Claude
- Get API key from Anthropic Console
- Set environment variable:
export ANTHROPIC_API_KEY=sk-ant-your-key
Ollama (Local Models)
- Install Ollama: ollama.com
- Pull a model:
ollama pull llama3
- (Optional) Set base URL:
export OLLAMA_BASE_URL=http://localhost:11434
Verify Installation
Test Go Package
Create a test file test.go
:
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/rexleimo/agno-Go/pkg/agno/agent"
"github.com/rexleimo/agno-Go/pkg/agno/models/openai"
)
func main() {
model, err := openai.New("gpt-4o-mini", openai.Config{
APIKey: os.Getenv("OPENAI_API_KEY"),
})
if err != nil {
log.Fatal(err)
}
ag, err := agent.New(agent.Config{
Name: "Test Agent",
Model: model,
})
if err != nil {
log.Fatal(err)
}
output, err := ag.Run(context.Background(), "Say hello!")
if err != nil {
log.Fatal(err)
}
fmt.Println(output.Content)
}
Run it:
export OPENAI_API_KEY=sk-your-key
go run test.go
Test Docker Installation
# Check health
curl http://localhost:8080/health
# Expected response:
# {"status":"healthy","service":"agentos","time":1704067200}
Development Setup
For contributing or local development:
1. Install Development Tools
# Install golangci-lint (linter)
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# Install goimports (formatter)
go install golang.org/x/tools/cmd/goimports@latest
Or use Make:
make install-tools
2. Run Tests
# Run all tests
make test
# Run specific package
go test -v ./pkg/agno/agent/...
# Generate coverage report
make coverage
3. Format and Lint
# Format code
make fmt
# Run linter
make lint
# Run go vet
make vet
4. Build Examples
# Build all examples
make build
# Run specific example
./bin/simple_agent
Environment Variables
Create a .env
file for configuration:
# LLM API Keys
OPENAI_API_KEY=sk-your-openai-key
ANTHROPIC_API_KEY=sk-ant-your-anthropic-key
OLLAMA_BASE_URL=http://localhost:11434
# AgentOS Server
AGENTOS_ADDRESS=:8080
AGENTOS_DEBUG=true
# Logging
LOG_LEVEL=info
# Timeouts
REQUEST_TIMEOUT=30
# Database (if using PostgreSQL)
DATABASE_URL=postgresql://user:password@localhost:5432/agentos
# Redis (if using cache)
REDIS_URL=redis://localhost:6379/0
# ChromaDB (if using RAG)
CHROMA_URL=http://localhost:8000
IDE Setup
VS Code
Install recommended extensions:
{
"recommendations": [
"golang.go",
"ms-azuretools.vscode-docker"
]
}
GoLand
GoLand has built-in Go support. Just open the project directory.
Troubleshooting
Common Issues
1. "Go version too old"
Update Go to 1.21+:
# Check version
go version
# Download latest: https://golang.org/dl/
2. "Module not found"
go mod download
go mod tidy
3. "Permission denied" (Docker)
Add user to docker group:
sudo usermod -aG docker $USER
newgrp docker
4. "Port already in use"
Change port in .env
:
AGENTOS_ADDRESS=:9090
Getting Help
If you encounter issues:
- Check GitHub Issues
- Ask in Discussions
- Review documentation
Next Steps
Now that Agno-Go is installed:
- Quick Start - Build your first agent
- Core Concepts - Learn about Agent, Team, Workflow
- Examples - Explore working examples
- API Reference - Detailed API documentation
Platform-Specific Notes
macOS
No special requirements. Install via Homebrew:
brew install go
Linux
Install Go from package manager:
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install golang-go
# Fedora
sudo dnf install golang
# Arch
sudo pacman -S go
Windows
Download installer from golang.org or use Chocolatey:
choco install golang
Note: Use PowerShell or WSL2 for best experience.
Production Deployment
For production deployments, see:
- Deployment Guide - Docker, Kubernetes, cloud platforms
- Performance Guide - Optimization tips
- Security Best Practices - Production security