This project provides a basic foundation for building AI agents in Go that can interact with users and utilize tools. It uses the Anthropic API (Claude) by default.
cmd/agent/main.go: Main application entry point.pkg/agent/: Contains the core agent logic (agent.go,inference.go).pkg/tools/: Contains tool definitions (tools.go,schema.go) and implementations.go.mod,go.sum: Go module files.
- Install Go: Ensure you have Go installed (version 1.21 or later).
- Dependencies: Run
go mod tidyto install dependencies. - API Key: Set the
ANTHROPIC_API_KEYenvironment variable with your Anthropic API key:export ANTHROPIC_API_KEY='your-api-key-here'
go run cmd/agent/main.goThe agent will start, and you can interact with it in the terminal. Use Ctrl+C to exit.
The agent currently supports the following tools:
read_file: Reads the content of a file.list_files: Lists files and directories in a path.edit_file: Replaces a string in a file (use with caution!).ripgrep_search: Searches for a regex pattern within files/directories using thergcommand (ripgrep must be installed and in PATH).