Production-ready AI Agent framework built in Go. DDD architecture · Eino workflow engine · OpenAI-compatible · Human-in-the-loop approval · Streaming SSE
Everything you need to build, deploy, and operate agentic AI systems.
DAG-based agentic workflows with Router → Think → Act → Observe loop. Multi-agent routing built-in. LangGraph equivalent for Go.
Drop-in replacement for OpenAI's /v1/chat/completions. Works with any OpenAI client, LiteLLM, or custom LLM endpoint.
Pause workflow execution and request human approval before sensitive tool calls. Resume or reject with a reason via REST API.
DB-managed token expiration with per-token rate limits, allowed tools, and allowed models. Scoped access control per API key.
Real-time token streaming with Server-Sent Events. Compatible with OpenAI's streaming format. Zero buffering, low latency.
Multi-stage build from scratch. Single binary, no runtime dependencies. PostgreSQL + Redis included in Compose.
Strict Domain-Driven Design — dependencies flow inward only.
Up and running in under 5 minutes.
git clone https://github.com/wyuneed/go-agent-api.git
cd go-agent-api
cp .env.example .env
# Set LLM_BASE_URL and LLM_API_KEY in .env
docker compose -f deployments/docker-compose.yml up -d
# Starts: API + PostgreSQL + Redis + LiteLLM + Migrations
# Register
curl -X POST http://localhost:8080/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"dev@example.com","password":"Secure1234","name":"Dev"}'
# Login → get token
curl -X POST http://localhost:8080/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"dev@example.com","password":"Secure1234"}'
# Chat
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello!"}]}'
go 1.22+, PostgreSQL 16, Redis 7
make dev-deps # installs golangci-lint, air, migrate
cp .env.example .env # fill in DB, Redis, LLM settings
make migrate-up # run all 5 migrations
make run # start server on :8080
# or: make run-watch # hot reload with air
make test # 81 unit tests with race detection
make test-coverage # generates coverage.html
make build # produces bin/server
13 endpoints. All protected routes require Authorization: Bearer <token>
/v1/auth/register
/v1/auth/login
/v1/auth/refresh
/v1/chat/completions
/v1/conversations
/v1/conversations
/v1/conversations/{id}
/v1/conversations/{id}/messages
/v1/conversations/{id}/approve
/v1/tools
/v1/tools/execute
/v1/tools/batch
/health
/ready
Browse and explore the full OpenAPI specification.