Skip to content

v0.2.6

Latest

Choose a tag to compare

@Timwood0x10 Timwood0x10 released this 07 Jul 03:00
7c6c9bd

[0.2.6] - 2026-07-07

New Features

  • Unified SDK Package (sdk/): New top-level API sdk.MustNew() / sdk.New() with functional options (WithOpenAI, WithOllama, WithAnthropic, WithDefaultMemory, WithEvolution, WithMCP, WithHumanInput, etc.). Single entry point for LLM, tools, memory, evolution, and MCP.
  • Agent Runtime: agent.Run(ctx, input) ReAct loop with tool calling, memory context injection, token tracking, and result metadata.
  • Streaming Support: agent.Stream(ctx, input) returns <-chan StreamChunk for async response streaming.
  • Multi-Agent Teams: rt.NewTeam(name, leader, members) with team.Run() for leader/member orchestration.
  • Human-in-the-Loop: WithHumanInput() callback for tool call approval before execution.
  • MCP Integration: WithMCP() connects to MCP servers via stdio, auto-registers their tools.
  • Strategy Evolution: rt.Evolve(ctx, agent, task) evolves agent instructions via LLM. WithEvolution() enables the evolution system.
  • CLI Tools (cmd/ares/): ares init (scaffold project), ares run (run agent from config, auto-detects ares.yaml), ares bench (benchmark with JSON/Markdown output), ares doctor (diagnose environment), ares version.
  • Config-Driven Setup: sdk.LoadConfigFile(path) reads YAML config, cfg.ToOptions() converts to SDK options. ares run auto-discovers ares.yaml or config/ares.yaml.
  • Evaluation Framework (evaluation/): evaluation.New(), Register(), RunScenario(), RunAll() with structured Metrics, Report, Aggregate. Report output via ToMarkdown() / ToJSON(). Built-in scenarios: basic-chat, tool-calling, multi-agent, resilience, evolution.

Examples

  • 9 New SDK Examples: Numbered 01-quickstart through 09-full-app, each with ares.yaml config.
    • 01-quickstart: Minimal agent in 20 lines
    • 02-tool-calling: Multi-tool registration
    • 03-dag-workflow: MutableDAG + conditional branching
    • 04-multi-agent: Leader/member team orchestration
    • 05-evolution-demo: Instruction evolution before/after comparison
    • 06-chaos-resilience: 9 failure modes (file, timeout, network, MCP, LLM, memory, graceful degradation)
    • 07-human-in-loop: Tool call approval with WithHumanInput
    • 08-mcp-integration: MCP server connection via WithMCP
    • 09-full-app: Web UI + Agent + Tools + Memory + Stats dashboard
  • Evaluation Example (examples/eval/): Runs all 5 capability scenarios with scoring.

Documentation

  • README Rewrite: Reduced from 774 to 214 lines. SDK Quick Start at the top. English (README.md) and Chinese (README_CN.md) versions.
  • GitHub Pages Website: docs/index.html with dark theme, marked.js inline Markdown rendering, all articles browsable.
  • Architecture Diagram: Mermaid diagram covering SDK, LLM providers, Tools, Memory, Evolution, CLI, Examples.
  • 7 Cookbook Recipes: docs/cookbook/ with Chat, Tool Calling, Multi-Agent, Memory, Coding Agent, Code Review, GitHub Agent.
  • CI Docs Deployment: GitHub Actions workflow (docs.yml) auto-deploys docs/ to Pages.

Code Quality

  • SDK Test Coverage: 54%+ with 20+ tests covering Runtime, Agent, Team, Config, Evolution, Streaming, MCP, HumanInput, Benchmarks. All pass with go test -short ./....
  • Lint Clean: golangci-lint 0 issues across SDK, CLI, evaluation, and examples.
  • English Comments: All code comments in English per code_rules.md.
  • Binary Rename: CLI binary ARESares (lowercase).

Infrastructure

  • Docker Compose: docker-compose.yml + Dockerfile.demo for one-command demo deployment (Ollama + full-app).
  • Makefile: Added quickstart, examples, install-cli, test-eval targets.
  • Example Cleanup: Removed 20+ stale/duplicate examples; kept 9 curated SDK examples + advanced ones in git history.
  • Chaos Arena YAML: Restored examples/arena/leader_assassination.yaml and cascading_storm.yaml with all built-in action types.

Performance

  • GA Diversity Sampling: Added DiversitySampleSize config (default 200) to estimate numeric diversity via random neighbor sampling instead of O(n²) exact computation. Stats(pop=1000) latency dropped 38% (69.5ms → 43.3ms). Configurable per PopulationConfig.DiversitySampleSize.
  • Fitness Sharing Optimization: Replaced per-agent Fisher-Yates full permutation with Reservoir Sampling in applyFitnessSharingSampled. Allocation reduced 44% for all population sizes (pop=100: 185→106 allocs, pop=500: 905→506 allocs). GC pressure halved in large evolution runs.
  • Subscribe Allocation Reduction: Replaced UUID subscription IDs with atomic.Int64 counter and removed *sync.Once per subscriber. Allocs reduced 33% (900→600 per 100 subscribers). Channel buffer increased from 1→64 to reduce burst drops.
  • Benchmark Report: Comprehensive benchmark report across all modules (events, GA genome/evaluation, memory distillation, tools core, handlers, errors) with full platform config (Apple M3 Max, Go 1.26, 3-run average).

New Features

  • Memory Pipeline Complete: End-to-end memory pipeline with ReportGenerator, PushService, and report formatting for human-readable evolution summaries. Full cycle: evaluation → distillation → report → push.
  • Agent Age Eviction: AgentMaxAge config limits strategy lifespan; GenerationCreated tracking ensures agents survive exactly AgentMaxAge generations. Legacy strategies (GenerationCreated==0) exempted.
  • Confidence Calculation: Added sample-based confidence to AggregateEvidenceCrossTask, enabling evidence quality scoring in cross-task aggregation.

Refactors

  • Truncate Utility Consolidation: Unified internal/ares_memory/internal/truncate package for reusable truncation logic across memory and LLM modules.
  • Evidence Logic Cleanup: AggregateEvidence refactored for clarity; cross-task evidence aggregation now filters mixed-task noise with AggregateEvidenceCrossTask.
  • FIXME Cleanup (22 files): Removed stale FIXME comments in internal/ares_quant/, internal/api_impl/, api/client/, internal/ares_events/, internal/storage/postgres/services/. All had already been implemented but comments were not updated.
  • Promotion Logic: Tightened statistical bands (5-20x → 6-18x) in selection_extra_test.go and reduced low-scorer threshold (5% → 0.2%) for more deterministic selection verification.

Bug Fixes

  • Ignored json.Marshal Errors: Fixed 4 ignored json.Marshal calls in internal/ares_events/summary_repository.go — previously would silently produce null DB values on serialization failure. Now errors propagate with fmt.Errorf("marshal %s: %w", ...).
  • Errgroup Context Propagation: In internal/api_impl/service.go, errgroup.WithContext(ctx) returned a derived context cancelled on sibling errors — but it was discarded with _. Fix: s.g, s.ctx = errgroup.WithContext(ctx) to enable proper error propagation.
  • SSE Health Probe: Implemented real SSE health check via ConnectSSE instead of hardcoded assumed healthy.
  • Generation Logging: Fixed generation=0 in logs by using absolute Population.Generation in callback_gen.
  • GenerationCreated Off-by-One: Use Generation+1 so agents survive exactly AgentMaxAge generations.
  • Guardrail Config Default: Inverted PromptDiversityGuardEnabledDisablePromptDiversityGuard (default enabled).