Harvey Developer Guide
This guide is for developers who want to understand Harveyβs internals, contribute to the project, or extend its functionality.
ποΈ Architecture & Design
Core Architecture
- ARCHITECTURE.md β Component map, core types (Agent, LLMClient, Message, Workspace), and how they interact
Design Documents
- DECISIONS.md β Key design decisions and their rationale
- RAG Support Design β Design document for retrieval-augmented generation support
- Harvey Skill-Set
Design β Design for the
/skill-setcommand and skill bundling system - Improved Tool Handling with Schemas β Tool schema validation and handling design
- Memory Unified Design β Unified memory system architecture
- Memory Unified Plan β Implementation plan for memory system unification
- Profile Templates Design β Profile-based configuration templates
- Profile Templates Plan β Implementation plan for profile templates
- Programming Language Support Design β Multi-language support architecture
- Programming Language Support Plan β Implementation roadmap for language support
- Pipeline Design β Multi-step prompt pipeline architecture
- Pipeline Plan β Implementation plan for pipeline support
- Loop Design β REPL loop architecture
- Loop Plan β Implementation plan for the REPL loop
π οΈ Development Setup
Prerequisites
- about.md β Project metadata, requirements (Go >= 1.26.3), and author information
Building Harvey
# Build all programs
make build
# Build a single program
go build -o bin/<name> cmd/<name>/*.go
# Generate version.go from codemeta.json
cmt codemeta.json version.go
# Build website (HTML from Markdown via pandoc)
make website
# Clean build artifacts
make cleanπ§ͺ Testing
- TESTING.md β Running tests, test architecture, writing tests, and CI/CD setup
- agent_integration_test.go β Integration tests for agent functionality
- anyllm_client_test.go β Tests for the AnyLLM client wrapper
- commands_test.go β Tests for slash command handlers
- config_test.go β Configuration loading and validation tests
- knowledge_test.go β Knowledge base functionality tests
- memory_*_test.go β Memory system tests (manifest, miner, onboarding, rolling, store, unified)
- ollama_probe_test.go β Ollama probing tests
- pipeline_test.go β Pipeline functionality tests
- rag_support_test.go β RAG support tests
π¦ Code Organization
Main Package (harvey/)
- harvey.go β Core types: Agent, LLMClient, Message, ChatStats
- commands.go β All slash-command handlers and dispatch logic
- config.go β Configuration struct, loading, and validation
- terminal.go β REPL loop, startup sequence, backend selection
- workspace.go β Sandboxed file I/O operations
- knowledge.go β SQLite knowledge base implementation
- audit.go β In-memory ring-buffer audit log
- permissions.go β Permission check helpers
- ollama.go β OllamaClient helpers and probing utilities
- anyllm_client.go β AnyLLMClient wrapper for mozilla-ai/any-llm-go
- routing.go β RouteRegistry, named remote endpoints, @mention dispatch
- recorder.go β Fountain (.spmd) session recorder
- spinner.go β Animated spinner with Edward Lear messages
Command Entry Points
(cmd/)
- Each subdirectory contains a CLI entry point
- Built using
go build -o bin/<name> cmd/<name>/*.go
Built-in Tools
(builtin_tools.go)
- Schema-based tools: read_file, write_file, run_command, list_files, git_command
- All tools enforce workspace boundary and permission checks
π¨ Conventions & Style
Documentation Conventions
All exported functions, structs/types, interfaces, and constants must
be documented with a /** ... */ block comment including: -
Description of what the symbol is or does - Parameters β name, type, and
purpose for each - Return values β type and meaning - An embedded usage
example
Code Conventions
version.gois generated bycmtβ do not edit by handbin/,dist/,man/,testout/are gitignored build artifacts- Source lives at the package level (
harvey/*.go) - CLI entry points go under
cmd/<program>/ - See HARVEY.md for full toolchain dependencies and release targets
π Additional Resources
For Contributors
- GitHub Issues β Bug reports and feature requests
- GitHub Issues β Contribution guidelines, bug reports, and feature requests
- CHANGES.md β Version history and release notes
Related Documentation
- Security β Security model and protections (also relevant for developers)
- Configuration β Workspace configuration reference