Documentation
¶
Overview ¶
Example: coding_agent — A full-featured autonomous coding agent.
This example demonstrates building a Cursor/Aider-style coding agent that can:
- Read, write, and search files using built-in file tools
- Execute shell commands (git, go build, tests, etc.)
- Use a vector database for semantic code search (RAG)
- Plan and implement multi-step coding tasks autonomously
What you'll learn:
- Wiring file tools, shell tools, and custom tools onto an agent
- Setting up VectorKnowledge with in-memory embeddings for code search
- Running an autonomous agent loop with MaxIterations
- Combining tools with system prompts for effective coding workflows
Prerequisites:
- Go 1.22+
- Set OPENAI_API_KEY or ANTHROPIC_API_KEY for real LLM responses
- No API keys required to see the structure — falls back to a mock provider
Run:
go run ./examples/coding_agent/
Click to show internal directories.
Click to hide internal directories.