Extension Guide
ARES is designed for extension at every layer. Each section below references the exact SDK option or interface to implement.
Add an LLM provider
The SDK ships with built-in support for OpenAI, Ollama, Anthropic, and OpenRouter. To use a custom provider:
llm.Client is a concrete struct (not an interface): providers are
selected by configuration, and internal/llm/chat.go dispatches per
provider into the shared llmcore.* message/response types. Runtime
failover is a single chain, llm.FailoverClient; embedding calls live on
llmservice.Service, not on llm.Client.
- Construct a provider config (
llm.Config/core.LLMConfig) with your provider name and base URL. - Pass it via
sdk.WithLLMConfig(cfg); add fallbacks withsdk.WithFallbackLLM(cfg)(callable multiple times). - For serve deployments, agents that must touch workspace files need
tools.file_sandbox_dirin ares.yaml — the default sandbox is a process-private temp dir, not the working directory.
Add a custom tool
- Implement the
tools.Toolinterface (Name,Description,Parameters,Execute,Capabilities), or wrap a function withtools.ToolFunc. - Register it:
runtime.RegisterTool(myTool), or pass it as ansdk.WithToolagent option. - For idempotent (retry-safe) tools in the sub-agent, type-assert the
ToolBinderto*toolBinderand callBindIdempotentTool.
Add a knowledge store backend
- Implement the
knowledge.KnowledgeStoreinterface (13 methods includingStore,Query,HybridSearch,FindDuplicate). - Wire it via
sdk.WithKnowledgeStore(myStore)or register it as aprovider.GraphProviderwithsdk.WithKnowledgeProvider.
Add a strategy source
- Implement
agents.StrategySourcereturning the liveActiveStrategy(prompt + LLM params). - Inject it via
leader.WithStrategySource(src)orsub.WithStrategySource(src)when constructing agents.
Add an MCP server connection
- Start an MCP server exposing tools over stdio.
- Connect with
sdk.WithMCP(MCPConn{Command: "...", Args: []string{...}}). Discovered tools are auto-registered into the tool registry.
Tune the knowledge quality gate
Use sdk.WithAKGQualityGate(knowledge.QualityGateConfig{...}) to adjust the
extraction / consistency / freshness / usage weights and score thresholds that
gate which candidates become active KnowledgeObjects.