Why Phero?
- ๐ฏ Purpose-built for agents: Not an LLM wrapper; a framework for orchestrating cooperative agent systems
- ๐งฉ Composable primitives: Small, focused packages that solve specific problems
- ๐ง Tool-first design: Built-in support for function tools, skills, RAG, and MCP
- ๐จ Developer-friendly: Clean APIs, opt-in tracing, OpenAI-compatible + Anthropic support
- ๐ชถ Lightweight: No heavy dependencies; just Go and your choice of LLM provider
Features
- ๐ค Agent orchestration: Multi-agent workflows with role specialization, coordination, and handoffs
- ๐งฉ LLM abstraction: Work with OpenAI-compatible endpoints (OpenAI, Ollama, etc.) and Anthropic
- ๐ ๏ธ Function tools: Expose Go functions as callable tools with automatic JSON Schema generation
- ๐ RAG (Retrieval-Augmented Generation): Built-in 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 management: Conversational context storage for agents
- ๐ Tracing: Observe agent, LLM, tool, and memory lifecycle events with colorized terminal output
- โ๏ธ Text splitting: Document chunking for RAG workflows
- ๐งฌ Embeddings: Semantic search capabilities via OpenAI embeddings
- ๐๏ธ Vector stores: Vector database integration
Architecture
- Agent Layer
agent: Core orchestration for LLM-based agents with tool execution and chat loopsmemory: Conversational context management for multi-turn interactions (in-process, file-backed, PostgreSQL-backed, or semantic RAG-backed)
- LLM Layer
llm: Clean LLM interface with function tool support and JSON Schema utilitiesllm/openai: OpenAI-compatible client (works with OpenAI, Ollama, and compatible endpoints)llm/anthropic: Anthropic API client
- Observability
trace: Typed lifecycle events; human-readable text tracer (trace/text) and NDJSON file tracer (trace/jsonfile); also wraps raw LLM calls
- Knowledge Layer
embedding: Embedding interface for semantic operationsembedding/openai: OpenAI embeddings implementationvectorstore: Vector storage interface for similarity searchvectorstore/qdrant: Qdrant vector database integrationvectorstore/psql: PostgreSQL + pgvector integrationvectorstore/weaviate: Weaviate vector database integrationtextsplitter/recursive: Recursive character-based chunkingtextsplitter/markdown: Markdown-aware chunking (heading-first separators)rag: Complete RAG pipeline combining embeddings and vector stores
- Tools & Integration
skill: Parse SKILL.md files and expose them as agent capabilitiesmcp: Model Context Protocol adapter for external tool integrationtool/file: File viewing and editing helpers (view,create_file,str_replace)tool/bash: Bash command execution with optional blocklist, allowlist, and timeout guardrailstool/human: Human-in-the-loop input collectiona2a: Agent-to-Agent (A2A) protocol server and client for inter-agent networking
Examples
| Example | Description |
|---|---|
| Simple Agent | Start here! Minimal example showing one agent with one custom tool perfect for learning the basics |
| Conversational Agent | REPL-style chatbot with short-term conversational memory and a simple built-in tool |
| Long-Term Memory | REPL-style chatbot with semantic long-term memory (RAG) backed by Qdrant |
| Handoff | One agent hands work off to a specialist agent at runtime using the built-in handoff mechanism |
| A2A Server | Expose a Phero agent as an A2A-compliant HTTP server for cross-process agent calls |
| A2A Client | Connect to a remote A2A agent and use it as a local llm.Tool inside an orchestrator |
| Debate Committee | Multi-agent architecture where committee members debate independently and a judge synthesizes the final decision |
| Multi-Agent Workflow | Classic Plan โ Execute โ Analyze โ Critique pattern with specialized agent roles |
| RAG Chatbot | Terminal chatbot with semantic search over local documents using Qdrant |
| Skill | Discover SKILL.md files and expose them as callable agent tools |
| MCP Integration | Run an MCP server as a subprocess and expose its tools to agents |
| Supervisor Blackboard | Supervisor-worker pattern with a shared blackboard for coordination |
| Tracing | Attach a colorized tracer to an agent and inspect LLM requests, tool calls, and memory events in real time |
Tracing
Tracing is opt-in. Attach a tracer to an agent with SetTracer to observe typed events for agent lifecycle,
LLM requests and responses, tool calls and results, and memory operations.
a.SetTracer(text.New(os.Stderr))
The built-in text tracer writes colorized, human-readable lines to the terminal.
An NDJSON file tracer (jsonfile.New) is also available for structured log ingestion.
See Trace for the full package overview and usage examples.
Design Philosophy
- Composability over monoliths: Each package does one thing well
- Interfaces over implementations: Swap LLMs, vector stores, or embeddings easily
- Explicit over implicit: No hidden magic; clear control flow
- Tools are first-class: Function tools are the primary integration point
- Developer experience matters: Clean APIs, helpful tracing, good error messages
Contributing
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Acknowledgments
Built with โค๏ธ by Simone Vellei.
Inspired by the collaborative intelligence of ant colonies where independent agents work together toward shared goals, recognizing one another and coordinating through clear protocols.
The ant is not just a mascot. It is the philosophy. ๐
Links
- Documentation: pkg.go.dev/github.com/henomis/phero
- Issues: github.com/henomis/phero/issues
- Discussions: github.com/henomis/phero/discussions