๐Ÿœ Phero

The chemical language of AI agents.

Why Phero?

Features

Architecture

Examples

ExampleDescription
Simple AgentStart here! Minimal example showing one agent with one custom tool perfect for learning the basics
MultimodalSend text + image inputs to a vision-capable model using typed content parts
AudioEnd-to-end speech-to-text and text-to-speech using the OpenAI backend
LLM MiddlewareWrap an LLM with composable middleware for logging and other cross-cutting concerns
Conversational AgentREPL-style chatbot with short-term conversational memory and a simple built-in tool
Long-Term MemoryREPL-style chatbot with semantic long-term memory (RAG) backed by Qdrant
HandoffOne agent hands work off to a specialist agent at runtime using the built-in handoff mechanism
A2A ServerExpose a Phero agent as an A2A-compliant HTTP server for cross-process agent calls
A2A ClientConnect to a remote A2A agent and use it as a local tool inside an orchestrator
Debate CommitteeMulti-agent architecture where committee members debate independently and a judge synthesizes the final decision
Evaluator-OptimizerIterative generation loop where an optimizer proposes drafts and an evaluator critiques them until quality criteria are met
Human-in-the-LoopMulti-agent flow that pauses for explicit human approval before continuing each action
Multi-Agent WorkflowClassic Plan โ†’ Execute โ†’ Analyze โ†’ Critique pattern with specialized agent roles
Orchestrator-WorkersDynamic task decomposition where an orchestrator delegates sub-tasks to worker agents
Parallel ResearchFan-out/fan-in workflow that runs multiple specialist researchers in parallel and merges their findings
Prompt ChainingSequential multi-step prompting with a programmatic gate between stages
RAG ChatbotTerminal chatbot with semantic search over local documents using Qdrant
SkillUse the tool/skill dispatcher to load SKILL.md instructions into the current conversation
Social SimulationMulti-agent social simulation with persona-driven actors and emergent interactions
MCP IntegrationRun an MCP server as a subprocess and expose its tools to agents
Playwright MCPConnect browser automation tools through MCP and orchestrate them from an agent
Supervisor BlackboardSupervisor-worker pattern with a shared blackboard for coordination
TracingAttach 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

  1. Composability over monoliths: Each package does one thing well
  2. Interfaces over implementations: Swap LLMs, vector stores, or embeddings easily
  3. Explicit over implicit: No hidden magic; clear control flow
  4. Tools are first-class: Function tools are the primary integration point
  5. 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