Skip to content

Timwood0x10/ARES

Repository files navigation

           _____  ______  _____ 
     /\   |  __ \|  ____|/ ____|
    /  \  | |__) | |__  | (___  
   / /\ \ |  _  /|  __|  \___ \ 
  / ____ \| | \ \| |____ ____) |
 /_/    \_\_|  \_\______|_____/ 

ARES — Agent Runtime & Evolution System.

Build resilient, self-evolving AI agents in Go. Unified SDK, DAG workflow, chaos engineering, MCP support.

Quick Start

package main

import "github.com/Timwood0x10/ares/sdk"

func main() {
    rt := sdk.MustNew(sdk.WithOllama("llama3.2"))
    defer rt.Close()

    agent := rt.NewAgent("assistant")
    result, _ := agent.Run(ctx, "Say hello")
    println(result.Output)
}

Install the CLI:

go install github.com/Timwood0x10/ares/cmd/ares@latest
ares doctor
ares run -c ares.yaml "What is Go?"

Or run examples directly:

git clone https://github.com/Timwood0x10/ares
cd ares
make quickstart        # go run examples/quickstart
make examples          # build all 24 examples

Features

Feature Description
Unified SDK Single sdk.MustNew() API for LLM, tools, memory, evolution
Self Evolution Genetic algorithm optimizes prompts and strategies automatically
DAG Workflow Dynamic graphs with conditional branching and recovery
Chaos Resilient Fault injection, failover, survival testing, self-healing
Memory Session context, task distillation, vector similarity search
MCP Ready Connect any Model Context Protocol server for tools and data
Multi-Agent Leader/sub orchestration with automatic failover
Observability OpenTelemetry traces, structured logs, Prometheus metrics

CLI

ares init        # Scaffold a new project (main.go + ares.yaml)
ares run         # Run agent from config file
ares bench       # Quick performance benchmark
ares doctor      # Diagnose environment (LLM key, Ollama, Git)
ares version     # Show version
ares arena       # Chaos engineering scenarios
ares flight      # Inspect and replay task recordings

SDK

rt := sdk.MustNew(
    sdk.WithOpenAI("gpt-4o-mini"),          // or WithOllama, WithAnthropic
    sdk.WithDefaultMemory(),                 // session history
    sdk.WithEvolution(),                     // strategy evolution
    sdk.WithMCP(sdk.MCPConn{                 // MCP server tools
        Name: "my-server", Command: "/path/to/server", Args: []string{"serve"},
    }),
)
defer rt.Close()

// Agent with tools and human-in-the-loop.
agent := rt.NewAgent("assistant",
    sdk.WithInstruction("You are helpful."),
    sdk.WithTools(calculatorTool, weatherTool),
    sdk.WithHumanInput(approveFn),
)
result, _ := agent.Run(ctx, "Calculate 15*23")

// Streaming response.
ch, _ := agent.Stream(ctx, "Tell me a story")
for chunk := range ch { fmt.Print(chunk.Content) }

// Multi-agent team.
team := rt.NewTeam("project", leaderAgent, []*Agent{memberAgent})
teamResult, _ := team.Run(ctx, "Research and write")

See examples/README.md for 9 hands-on examples.

Articles

Deep dives into ARES internals:

English 中文
Architecture 架构
Evolution 进化
MCP Integration MCP 集成
Workflow Engine 工作流引擎
Memory & Distillation 记忆与蒸馏
Chaos Arena 混沌测试

Architecture

graph TB
    User["User / CLI"] --> SDK

    subgraph sdk ["SDK Layer (sdk/)"]
        RT["Runtime<br/>MustNew / New"]
        A["Agent<br/>Run / Stream"]
        T["Team<br/>Multi-Agent"]
        CFG["Config<br/>YAML + Options"]
    end

    SDK --> LLM
    SDK --> Tools
    SDK --> Memory
    SDK --> Evo

    subgraph LLM ["LLM Providers"]
        OAI["OpenAI"]
        OLL["Ollama"]
        ANTH["Anthropic"]
        OR["OpenRouter"]
    end

    subgraph Tools ["Tool System"]
        BT["Built-in<br/>calculator, web_search..."]
        MCP["MCP Servers<br/>Stdio / SSE"]
        CT["Custom Tools<br/>ToolFunc"]
    end

    subgraph Memory ["Memory"]
        SES["Session Context"]
        DIST["Task Distillation"]
        VEC["Vector Search"]
    end

    subgraph Evo ["Evolution"]
        GA["Genetic Algorithm"]
        MUT["Mutation"]
        SCORE["Scoring"]
    end

    subgraph CLI ["CLI (cmd/ares/)"]
        INIT["ares init"]
        RUN["ares run"]
        BENCH["ares bench"]
        DOCTOR["ares doctor"]
    end

    subgraph EX ["Examples (24)"]
        QS["quickstart"]
        TC["tool-calling"]
        DAG["dag-workflow"]
        MA["multi-agent"]
        EVO["evolution-demo"]
        CHAOS["chaos-resilience"]
        HIL["human-in-loop"]
    end

    style sdk fill:#1e3a5f,stroke:#3b82f6,color:#fff
    style LLM fill:#1a2332,stroke:#64748b
    style Tools fill:#1a2332,stroke:#64748b
    style Memory fill:#1a2332,stroke:#64748b
    style Evo fill:#1a2332,stroke:#64748b
    style CLI fill:#2d1b69,stroke:#8b5cf6,color:#fff
    style EX fill:#1a3a2a,stroke:#22c55e
Loading

Cookbook

Recipe Code
Chat Agent 20-line conversational agent
Tool Calling Custom tools for LLM function calling
Multi-Agent Leader/member team orchestration
Memory Persistent conversation context
Coding Agent Code generation with specialized instructions
Code Review Automated PR review
GitHub Agent Issue and PR automation

Project Structure

├── sdk/           # Unified SDK (package sdk)
├── cmd/ares/      # CLI entry point
├── examples/      # 24 runnable examples
├── docs/          # Documentation and articles
├── api/           # Public API interfaces
└── internal/      # Internal implementations

License

Apache 2.0

About

ARES is a self-healing multi-agent runtime that combines event sourcing, memory distillation, chaos engineering, and evolutionary workflow optimization.

Topics

Resources

License

Contributing

Stars

16 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors