Documentation
¶
Overview ¶
Package hector is an open-source, self-sovereign AI agent runtime for Go.
One self-contained binary with production-ready defaults. Deploy on-premise, in air-gapped environments, or in any cloud without external dependencies. Define agents in YAML or Go, and keep every byte of data under your control. Built on open standards (A2A, MCP) with SQL-backed persistence, multi-agent orchestration, RAG, guardrails, and a built-in visual IDE.
Quick Start (CLI) ¶
Install Hector:
go install github.com/verikod/hector/cmd/hector@latest
Create a minimal agent configuration:
# config.yaml
llms:
default:
provider: anthropic
model: claude-sonnet-4
api_key: ${ANTHROPIC_API_KEY}
agents:
assistant:
llm: default
instruction: You are a helpful assistant.
Start the server:
export ANTHROPIC_API_KEY="sk-ant-..." hector serve --config config.yaml
The server starts at http://localhost:8080. Open it in a browser for Hector Studio, or send A2A JSON-RPC requests directly to /agents/assistant.
Programmatic API ¶
Import the top-level package for a fluent builder API:
import "github.com/verikod/hector/pkg"
Load agents from YAML:
h, err := pkg.FromConfig("config.yaml")
if err != nil {
log.Fatal(err)
}
defer h.Close()
h.Serve(":8080")
Or build programmatically:
h, err := pkg.New(
pkg.WithAnthropic(anthropic.Config{APIKey: os.Getenv("ANTHROPIC_API_KEY")}),
pkg.WithInstruction("You are a helpful assistant."),
)
if err != nil {
log.Fatal(err)
}
defer h.Close()
response, err := h.Generate(ctx, "Hello!")
Import specific sub-packages for lower-level control:
import (
"github.com/verikod/hector/pkg/agent"
"github.com/verikod/hector/pkg/config"
"github.com/verikod/hector/pkg/runner"
"github.com/verikod/hector/pkg/server"
"github.com/verikod/hector/pkg/session"
)
Key Features ¶
- Config-First: Complete agents defined in YAML, no code required
- A2A Protocol: Full A2A v0.3.0 compliance for agent interoperability
- Multi-Agent: Sequential, parallel, loop, conditional, and remote agent types
- MCP Tools: All MCP transports (stdio, SSE, streamable-HTTP)
- RAG Pipeline: Directory, SQL, API, and cloud blob document sources
- Guardrails: Deterministic and LLM-powered input/output protection
- Auth: JWKS/OIDC integration and simple token auth
- Observability: Prometheus metrics and OpenTelemetry tracing
- Persistence: SQL-backed sessions, tasks, and checkpoints (SQLite / PostgreSQL)
Documentation ¶
- Getting Started: https://gohector.dev/getting-started/quick-start/
- Configuration Reference: https://gohector.dev/reference/configuration/
- CLI Reference: https://gohector.dev/reference/cli/
- API Reference: https://gohector.dev/reference/api/
- Go API Reference: https://gohector.dev/reference/go-api/
- Source: https://github.com/verikod/hector
License ¶
MIT. See LICENSE for details.
Package hector provides build-time version information. These variables are populated via ldflags during build.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Version is the semantic version (e.g., "v1.20.0"). // Set via: -X 'github.com/verikod/hector.Version=$(VERSION)' // VERSION in the Makefile is derived from: git describe --tags --always --dirty Version = "v1.20.0" // GitCommit is the short git commit hash. // Set via: -X 'github.com/verikod/hector.GitCommit=$(GIT_COMMIT)' GitCommit = "unknown" // BuildDate is the build timestamp in ISO 8601 format. // Set via: -X 'github.com/verikod/hector.BuildDate=$(BUILD_DATE)' BuildDate = "unknown" )
Version information set at build time via ldflags. When building with make: make build (uses git describe --tags) When running unbuilt (e.g. go run): falls back to the constant below.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
hector
command
Command hector is the CLI for Hector.
|
Command hector is the CLI for Hector. |
|
Package pkg provides a config-first AI agent platform with a clean programmatic API.
|
Package pkg provides a config-first AI agent platform with a clean programmatic API. |
|
agent
Package agent defines the core agent interfaces and types for Hector v2.
|
Package agent defines the core agent interfaces and types for Hector v2. |
|
agent/llmagent
Package llmagent provides an LLM-based agent implementation for Hector v2.
|
Package llmagent provides an LLM-based agent implementation for Hector v2. |
|
agent/remoteagent
Package remoteagent provides remote A2A agent support.
|
Package remoteagent provides remote A2A agent support. |
|
agent/runneragent
Package runneragent provides a deterministic tool execution agent.
|
Package runneragent provides a deterministic tool execution agent. |
|
agent/workflowagent
Package workflowagent provides workflow agents for orchestrating multi-agent flows.
|
Package workflowagent provides workflow agents for orchestrating multi-agent flows. |
|
app
Package app provides multi-app (multi-tenant) management for Hector.
|
Package app provides multi-app (multi-tenant) management for Hector. |
|
auth
Package auth provides authentication and authorization for Hector v2.
|
Package auth provides authentication and authorization for Hector v2. |
|
builder
Package builder provides fluent builder APIs for programmatic agent construction.
|
Package builder provides fluent builder APIs for programmatic agent construction. |
|
checkpoint
Package checkpoint provides execution state capture and recovery.
|
Package checkpoint provides execution state capture and recovery. |
|
embedder
Package embedder provides text embedding services for semantic search.
|
Package embedder provides text embedding services for semantic search. |
|
examples/programmatic
command
Example programmatic demonstrates the comprehensive programmatic API of Hector.
|
Example programmatic demonstrates the comprehensive programmatic API of Hector. |
|
examples/weather
command
Example weather demonstrates using Hector with MCP tools.
|
Example weather demonstrates using Hector with MCP tools. |
|
execution/native
Package native provides the native execution provider implementation.
|
Package native provides the native execution provider implementation. |
|
guardrails
Package guardrails provides composable safety controls for Hector agents.
|
Package guardrails provides composable safety controls for Hector agents. |
|
guardrails/moderation
Package moderation provides content moderation through various providers.
|
Package moderation provides content moderation through various providers. |
|
httpclient
Package httpclient provides an HTTP client with retry, backoff, and rate limit handling.
|
Package httpclient provides an HTTP client with retry, backoff, and rate limit handling. |
|
instruction
Package instruction provides instruction templating for Hector v2 agents.
|
Package instruction provides instruction templating for Hector v2 agents. |
|
model
Package model defines the LLM interface for Hector v2.
|
Package model defines the LLM interface for Hector v2. |
|
model/anthropic
Package anthropic provides an Anthropic Claude LLM implementation.
|
Package anthropic provides an Anthropic Claude LLM implementation. |
|
model/gemini
Package gemini implements the model.LLM interface for Google Gemini models.
|
Package gemini implements the model.LLM interface for Google Gemini models. |
|
model/ollama
Package ollama provides an Ollama LLM implementation.
|
Package ollama provides an Ollama LLM implementation. |
|
model/openai
Package openai provides an OpenAI LLM implementation using the Responses API.
|
Package openai provides an OpenAI LLM implementation using the Responses API. |
|
notification
Package notification provides outbound notification dispatching.
|
Package notification provides outbound notification dispatching. |
|
observability
Package observability provides OpenTelemetry tracing and Prometheus metrics.
|
Package observability provides OpenTelemetry tracing and Prometheus metrics. |
|
rag
Package rag provides Retrieval-Augmented Generation (RAG) capabilities.
|
Package rag provides Retrieval-Augmented Generation (RAG) capabilities. |
|
ratelimit
Package ratelimit provides a comprehensive rate limiting system for Hector v2.
|
Package ratelimit provides a comprehensive rate limiting system for Hector v2. |
|
runner
Package runner provides the orchestration layer for agent execution.
|
Package runner provides the orchestration layer for agent execution. |
|
runtime
Package runtime builds and manages Hector agents from configuration.
|
Package runtime builds and manages Hector agents from configuration. |
|
server
make build-release # Production build make install # Install to GOPATH/bin
|
make build-release # Production build make install # Install to GOPATH/bin |
|
session
Package session provides session management for Hector v2.
|
Package session provides session management for Hector v2. |
|
signal
Package signal provides a clean signal management foundation for the Hector server.
|
Package signal provides a clean signal management foundation for the Hector server. |
|
task
Package task provides task management for Hector v2.
|
Package task provides task management for Hector v2. |
|
tool
Package tool defines interfaces for tools that agents can invoke.
|
Package tool defines interfaces for tools that agents can invoke. |
|
tool/agenttool
Package agenttool provides a tool that allows an agent to call another agent.
|
Package agenttool provides a tool that allows an agent to call another agent. |
|
tool/approvaltool
Package approvaltool provides a Human-in-the-Loop (HITL) tool example.
|
Package approvaltool provides a Human-in-the-Loop (HITL) tool example. |
|
tool/commandtool
Package commandtool provides a secure, streaming command execution tool.
|
Package commandtool provides a secure, streaming command execution tool. |
|
tool/controltool
Package controltool provides control flow tools for agent reasoning loops.
|
Package controltool provides control flow tools for agent reasoning loops. |
|
tool/functiontool
Package functiontool provides a convenient way to create tools from typed Go functions.
|
Package functiontool provides a convenient way to create tools from typed Go functions. |
|
tool/mcptoolset
Package mcptoolset provides a Toolset implementation for MCP servers.
|
Package mcptoolset provides a Toolset implementation for MCP servers. |
|
tool/searchtool
Package searchtool provides a search tool for agents to query document stores.
|
Package searchtool provides a search tool for agents to query document stores. |
|
trigger
Package trigger provides scheduled and event-driven agent invocation.
|
Package trigger provides scheduled and event-driven agent invocation. |
|
utils
Package utils provides utility functions for v2.
|
Package utils provides utility functions for v2. |
|
vector
Package vector provides a unified interface for vector database operations.
|
Package vector provides a unified interface for vector database operations. |
