HelloAgents-Go
August 7, 2026 ยท View on GitHub
English | ็ฎไฝไธญๆ
HelloAgents-Go
๐ค Production-Grade Multi-Agent Framework (Go Implementation) - 16 core capabilities including Tool Response Protocol, Context Engineering, Session Persistence, Sub-Agent Mechanism, and more
HelloAgents-Go is a faithful Go reimplementation of the HelloAgents Python version, a production-grade multi-agent framework built on the native OpenAI API. It integrates 16 core capabilities including Tool Response Protocol (ToolResponse), Context Engineering (HistoryManager/TokenCounter), Session Persistence (SessionStore), Sub-Agent Mechanism (TaskTool), Optimistic Locking (File Editing), Circuit Breaker (CircuitBreaker), Skills Externalization, TodoWrite Progress Management, DevLog Decision Recording, Streaming Output (SSE), Async Lifecycle, Observability (TraceLogger), Logging System (Four Paradigms), LLM/Agent Base Class Refactoring, providing comprehensive engineering support for building complex agent applications.
๐ Version Notes
Important Notice: This repository is the Go reimplementation of HelloAgents
-
๐ Python Original: HelloAgents The original Python implementation paired with the Datawhale Hello-Agents Tutorial.
-
๐ Go Version (This Repository): Based on Python version V1.0.0, faithfully reimplements all 16 core capabilities using Go, with fully aligned module and functional semantics.
-
๐ฆ Historical Versions: Releases Page Provides all Python versions from v0.1.1 to v0.2.9.
๐ Quick Start
Installation
git clone https://github.com/your-repo/helloagents-go.git
cd helloagents-go
go mod download
Basic Usage
package main
import (
"fmt"
"log"
"helloagents-go/hello_agents/agents"
"helloagents-go/hello_agents/core"
"helloagents-go/hello_agents/tools"
"helloagents-go/hello_agents/tools/builtin"
)
func main() {
llm, err := core.NewHelloAgentsLLM("", "", "", 0.7, nil, nil, nil)
if err != nil {
log.Fatal(err)
}
registry := tools.NewToolRegistry(nil)
registry.RegisterTool(builtin.NewReadTool("./", registry), false)
registry.RegisterTool(builtin.NewWriteTool("./"), false)
registry.RegisterTool(builtin.NewTodoWriteTool("./", "memory/todos"), false)
agent, err := agents.NewReActAgent("assistant", llm, "", registry, nil, nil, 0, nil)
if err != nil {
log.Fatal(err)
}
out, err := agent.Run("Analyze project structure and generate report", nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(out)
}
Environment Configuration
Create a .env file:
LLM_MODEL_ID=your-model-name
LLM_API_KEY=your-api-key-here
LLM_BASE_URL=your-api-base-url
LLM_TIMEOUT=60
// Auto-detect provider
llm, _ := core.NewHelloAgentsLLM("", "", "", 0.7, nil, nil, nil)
fmt.Printf("Detected provider: %s\n", llm.Provider)
๐ก Smart Detection: The framework automatically selects the appropriate provider based on the API key format and Base URL
Supported LLM Providers
The framework supports all major LLM services through 3 adapters:
1. OpenAI-Compatible Adapter (Default)
Supports all services providing OpenAI-compatible interfaces:
| Provider Type | Example Services | Configuration Example |
|---|---|---|
| Cloud API | OpenAI, DeepSeek, Qwen, Kimi, GLM | LLM_BASE_URL=api.deepseek.com |
| Local Inference | vLLM, Ollama, SGLang | LLM_BASE_URL=http://localhost:8000 |
| Other Compatible | Any OpenAI-format interface | LLM_BASE_URL=your-endpoint |
2. Anthropic Adapter
| Provider | Detection Condition | Configuration Example |
|---|---|---|
| Claude | base_url contains anthropic.com | LLM_BASE_URL=https://api.anthropic.com |
3. Gemini Adapter
| Provider | Detection Condition | Configuration Example |
|---|---|---|
| Google Gemini | base_url contains googleapis.com or generativelanguage | LLM_BASE_URL=https://generativelanguage.googleapis.com |
๐ก Auto-Adaptation: The framework automatically selects the adapter based on
base_url, no manual configuration required.
๐๏ธ Project Structure
helloagents-go/
โโโ hello_agents/ # Main package
โ โโโ core/ # Core components
โ โ โโโ llm.go # LLM base class and configuration
โ โ โโโ llm_adapters.go # Three adapters (OpenAI/Anthropic/Gemini)
โ โ โโโ agent.go # Agent base class (Function Calling architecture)
โ โ โโโ config.go # Configuration management
โ โ โโโ session_store.go # Session persistence
โ โ โโโ lifecycle.go # Async lifecycle
โ โ โโโ streaming.go # SSE streaming output
โ โ โโโ message.go # Message definitions
โ โโโ agents/ # Agent implementations
โ โ โโโ simple_agent.go # SimpleAgent
โ โ โโโ react_agent.go # ReActAgent
โ โ โโโ reflection_agent.go # ReflectionAgent
โ โ โโโ plan_solve_agent.go # PlanAndSolveAgent
โ โ โโโ factory.go # Agent factory
โ โโโ tools/ # Tool system
โ โ โโโ registry.go # Tool registry
โ โ โโโ response.go # ToolResponse protocol
โ โ โโโ circuit_breaker.go # Circuit breaker
โ โ โโโ tool_filter.go # Tool filtering (sub-agent mechanism)
โ โ โโโ builtin/ # Built-in tools
โ โ โโโ file_tools.go # File tools (optimistic locking)
โ โ โโโ task_tool.go # Sub-agent tool
โ โ โโโ todowrite_tool.go # Progress management
โ โ โโโ devlog_tool.go # Decision logging
โ โ โโโ skill_tool.go # Skills externalization
โ โโโ context/ # Context engineering
โ โ โโโ history.go # HistoryManager
โ โ โโโ token_counter.go # TokenCounter
โ โ โโโ truncator.go # ObservationTruncator
โ โ โโโ builder.go # ContextBuilder
โ โโโ observability/ # Observability
โ โ โโโ trace_logger.go # TraceLogger
โ โโโ logging/ # Logging system
โ โ โโโ logging.go # AgentLogger
โ โโโ skills/ # Skills system
โ โโโ loader.go # SkillLoader
โโโ cmd/ # Entry commands
โโโ docs/ # Documentation
โโโ example/ # Example code
โโโ skills/ # Skill files
โโโ tests/ # Test cases
๐ค Contributing
Contributions are welcome! Please follow these steps:
- Fork this repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
This project is licensed under the CC BY-NC-SA 4.0 license - see the LICENSE file for details.
License Key Points:
- โ Attribution: You must give appropriate credit to the original author
- โ ShareAlike: Modified works must use the same license
- โ ๏ธ NonCommercial: Cannot be used for commercial purposes
For commercial use, please contact the project maintainers for authorization.
๐ Acknowledgements
- Thanks to the HelloAgents Python version for the original implementation
- Thanks to Datawhale for the excellent open-source tutorial
- Thanks to all contributors of the Hello-Agents Tutorial
- Thanks to all researchers and developers contributing to the advancement of agent technology
๐ Documentation Resources
Learn more about the 16 core capabilities of HelloAgents-Go v1.0.0:
Infrastructure
- Tool Response Protocol - ToolResponse unified return format
- Context Engineering - HistoryManager/TokenCounter/Truncator
Core Capabilities
- Observability - TraceLogger tracing system
- Circuit Breaker - CircuitBreaker fault tolerance mechanism
- Session Persistence - SessionStore session management
Enhanced Capabilities
- Sub-Agent Mechanism - TaskTool and ToolFilter
- Skills Externalization - Skills system usage guide
- Skills Quick Start - Get started with Skills in 3 minutes
- Optimistic Locking - Concurrency control for file editing tools
- TodoWrite Progress Management - Task progress tracking
Auxiliary Features
- DevLog Decision Logging - Development decision recording
- Async Lifecycle - Async Agent implementation
Core Architecture
- Streaming Output - SSE streaming response
- Function Calling Architecture - LLM/Agent base class refactoring
- Logging System - Four logging paradigms
Extension Capabilities
- Custom Tool Extension - Three tool implementation methods (functional/standard class/expandable)
HelloAgents-Go - Making agent development simple and powerful ๐