Multi-agent framework · Go

Phero The chemical language of AI agents.

Phero is a Go framework for building cooperative multi-agent systems — not an LLM wrapper, but a set of composable primitives for orchestration, tools, RAG, memory and inter-agent networking. Provider-agnostic by design.

  • Agent orchestration
  • Function tools
  • RAG & vector stores
  • A2A & NATS protocols
  • MCP support
  • Opt-in tracing
Why Phero

Built for cooperating agents, not single calls.

Five commitments shape the framework.

ðŸŽŊ

Purpose-built for agents

Not an LLM wrapper — a framework for orchestrating cooperative agent systems with handoffs, sub-agents and roles.

ðŸ§Đ

Composable primitives

Small, focused packages that each solve one problem well and compose cleanly into larger systems.

🔧

Tool-first design

Built-in support for function tools, skills, RAG and MCP. Tools are the primary integration point.

ðŸŽĻ

Developer-friendly

Clean APIs, opt-in tracing, and OpenAI-compatible plus Anthropic support out of the box.

ðŸŠķ

Lightweight

No heavy dependencies — just Go and your choice of LLM provider.

🐜

Colony philosophy

Inspired by ant colonies: independent agents recognising one another and coordinating through clear protocols.

Capabilities

Everything a multi-agent system needs.

ðŸĪAgent orchestration

Multi-agent workflows with role specialization, coordination and runtime handoffs.

🌐A2A protocol

Expose any agent as an HTTP A2A server, or call remote A2A agents as local tools.

🔀NATS Agent Protocol

Register agents as NATS micro services over pub/sub — wire-compatible with the TS and Python SDKs.

ðŸ§ĐLLM abstraction

One interface over OpenAI-compatible endpoints (OpenAI, Ollama, â€Ķ) and Anthropic.

🛠ïļFunction tools

Expose Go functions as callable tools with automatic JSON Schema generation.

📚RAG

Built-in retrieval-augmented generation with vector storage and semantic search.

🧠Skills system

Define reusable agent capabilities in SKILL.md files.

🔌MCP support

Integrate Model Context Protocol servers as agent tools.

ðŸ§ūMemory

Conversational context storage — in-process, file, PostgreSQL, NATS KV or semantic RAG.

🔍Tracing

Observe agent, LLM, tool and memory lifecycle events with colorized terminal output.

✂ïļText splitting

Document chunking — recursive and markdown-aware — for RAG workflows.

🧎Embeddings & vectors

Semantic embeddings with Qdrant, PostgreSQL pgvector and Weaviate back ends.

Architecture

Interfaces over implementations.

Five layers, each defining a single core interface so you can swap LLMs, vector stores or embeddings without touching the rest.

Agent Layerorchestration
agent · chat loops, tools, handoffs memory · simple · jsonfile · psql · nats · rag
LLM Layermodels
llm · typed messages, tools, middleware llm/openai · OpenAI-compatible llm/anthropic · Anthropic
Observabilitytracing
trace · typed lifecycle events trace/text · colorized terminal trace/jsonfile · NDJSON trace/otel · OpenTelemetry
Knowledge LayerRAG
embedding · vector embeddings vectorstore · qdrant · psql · weaviate textsplitter · recursive · markdown rag · full pipeline
Tools & Integrationconnectivity
tool · bash · file · human · skill · agent skill · SKILL.md mcp · Model Context Protocol a2a · HTTP nats · pub/sub
Quick start

An agent and a tool in a few lines.

Expose a Go function as a tool — the JSON Schema is generated for you — hand it to an agent, and run the chat loop.

main.go — a minimal Phero agent
package main

import (
    "context"
    "fmt"
    "os"

    "github.com/henomis/phero/agent"
    "github.com/henomis/phero/llm"
    "github.com/henomis/phero/llm/openai"
)

type WeatherInput struct {
    City string `json:"city" jsonschema:"description=City to look up"`
}
type WeatherOutput struct {
    Forecast string `json:"forecast"`
}

// A plain Go function becomes a tool — no schema written by hand.
func weather(_ context.Context, in *WeatherInput) (*WeatherOutput, error) {
    return &WeatherOutput{Forecast: "sunny in " + in.City}, nil
}

func main() {
    ctx := context.Background()

    tool, _ := llm.NewTool("weather", "Get the weather for a city", weather)

    client := openai.New(os.Getenv("OPENAI_API_KEY"), openai.WithModel("gpt-4o"))

    a, _ := agent.New(client, "Assistant", "You are a helpful assistant.")
    a.AddTool(tool)

    res, _ := a.Run(ctx, llm.Text("What's the weather in Rome?"))
    fmt.Println(res.TextContent())
}
Examples

Learn by running real patterns.

A handful of the runnable examples that ship with Phero.

Simple Agent

Start here. One agent with one custom tool — the basics in one file.

Handoff

One agent hands work off to a specialist agent at runtime.

Multi-Agent Workflow

Classic Plan → Execute → Analyze → Critique with specialized roles.

Parallel Research

Fan-out / fan-in across multiple researchers, then merge findings.

RAG Chatbot

Terminal chatbot with semantic search over local documents via Qdrant.

A2A Newsroom

Researcher, writer and editor agents, each an independent A2A server.

NATS Agent

Register an agent as a NATS micro service and call it over pub/sub.

Human-in-the-Loop

A flow that pauses for explicit human approval before each action.

MCP Integration

Run an MCP server as a subprocess and expose its tools to agents.

27 examples in total — see the full list and package docs in the documentation.