This page provides an index of all example applications included with Minion.
# Clone the repository
git clone https://github.com/Ranganaths/minion.git
cd minion
# Set API key
export OPENAI_API_KEY="sk-..."
# Run an example
go run examples/basic/main.goCreate and execute a simple agent with LLM.
go run examples/basic/main.goDemonstrates:
- Framework initialization
- Agent creation and activation
- Basic execution
- Metrics retrieval
Location: examples/basic/
Agent that can use built-in tools.
go run examples/with_tools/main.goDemonstrates:
- Tool registration
- Capability-based tool filtering
- Tool execution
- Tool output handling
Location: examples/with_tools/
Create a custom behavior for specialized agent processing.
go run examples/custom_behavior/main.goDemonstrates:
- Behavior interface implementation
- Custom system prompts
- Input/output processing
- Behavior registration
Location: examples/custom_behavior/
Use domain-specific tools for various tasks.
go run examples/domain_tools/main.goDemonstrates:
- Data tools (CSV, JSON, XML)
- HTTP tools
- File operations
- Security tools
Location: examples/domain_tools/
Simple multi-agent system with coordinator and workers.
go run examples/multiagent-basic/main.goDemonstrates:
- Orchestrator creation
- Worker specialization
- Task delegation
- Result aggregation
Location: examples/multiagent-basic/
Advanced multi-agent patterns with custom workflows.
go run examples/multiagent-custom/main.goDemonstrates:
- Custom worker implementations
- Complex task decomposition
- Inter-agent communication
- Error handling
Location: examples/multiagent-custom/
Multi-agent system with distributed tracing.
go run examples/multiagent-tracing/main.goDemonstrates:
- Distributed traces across agents
- Span propagation
- Performance monitoring
- Trace visualization
Location: examples/multiagent-tracing/
Expose agent via A2A protocol for inter-agent communication.
go run examples/a2a-server/main.goDemonstrates:
- A2A server setup
- Agent Card generation
- JSON-RPC endpoints
- SSE streaming
Endpoints:
GET /.well-known/agent.json- Agent CardPOST /- JSON-RPC endpoint
Location: examples/a2a-server/
Agent with real-time streaming for frontend applications.
go run examples/agui-server/main.goDemonstrates:
- AG-UI server setup
- SSE event streaming
- Token-by-token output
- State synchronization
Endpoints:
POST /- Run request with SSE
Location: examples/agui-server/
AI sales assistant with CRM integration.
go run examples/sales_agent/main.goDemonstrates:
- Lead qualification
- CRM tool integration
- Email composition
- Sales pipeline management
Location: examples/sales_agent/
Full sales workflow automation.
go run examples/sales-automation/main.goDemonstrates:
- Lead scoring
- Automated outreach
- Follow-up scheduling
- Analytics
Location: examples/sales-automation/
AI-powered customer support agent.
go run examples/customer-support/main.goDemonstrates:
- Ticket classification
- Knowledge base search
- Response generation
- Escalation handling
Location: examples/customer-support/
General business process automation.
go run examples/business_automation/main.goDemonstrates:
- Document processing
- Approval workflows
- Report generation
- Integration patterns
Location: examples/business_automation/
Infrastructure and deployment automation.
go run examples/devops-automation/main.goDemonstrates:
- CI/CD integration
- Infrastructure management
- Monitoring automation
- Incident response
Location: examples/devops-automation/
LLM chain patterns including RAG, sequential, and router chains.
go run examples/chain-features/main.goDemonstrates:
- LLM chains
- RAG chains
- Sequential chains
- Router chains
- Transform chains
Location: examples/chain-features/
Dedicated LLM worker pattern.
go run examples/llm_worker/main.goDemonstrates:
- Worker pool pattern
- Request queuing
- Batch processing
- Rate limiting
Location: examples/llm_worker/
Using TupleLeap as LLM provider.
go run examples/tupleleap_example/main.goDemonstrates:
- TupleLeap provider setup
- Custom model configuration
- API integration
Location: examples/tupleleap_example/
OpenTelemetry distributed tracing.
go run examples/tracing/main.goDemonstrates:
- Tracer initialization
- Span creation
- Attribute recording
- Error tracking
Location: examples/tracing/
Complete observability setup with tracing and metrics.
go run examples/observability/main.goDemonstrates:
- OpenTelemetry tracing
- Prometheus metrics
- Custom instrumentation
- Dashboard integration
Location: examples/observability/
Time-travel debugging for agent execution.
go run examples/debug-timetravel/main.goDemonstrates:
- Execution recording
- State snapshots
- Timeline navigation
- Replay debugging
Location: examples/debug-timetravel/
Benchmark and evaluate agent performance.
go run examples/evaluation/main.goDemonstrates:
- Test case creation
- Evaluation metrics
- Performance benchmarks
- Quality assessment
Location: examples/evaluation/
Agent that improves based on feedback.
go run examples/self-improving/main.goDemonstrates:
- Feedback collection
- Performance analysis
- Prompt optimization
- Iterative improvement
Location: examples/self-improving/
- Go 1.24+ installed
- API key set as environment variable
# OpenAI
export OPENAI_API_KEY="sk-..."
# Or Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."
# Or TupleLeap
export TUPLELEAP_API_KEY="..."# From project root
go run examples/<example-name>/main.go
# Or build first
go build -o example examples/<example-name>/main.go
./example"API key not set"
export OPENAI_API_KEY="your-key-here""Module not found"
go mod tidy"Port already in use" (for server examples)
# Use different port
PORT=9090 go run examples/a2a-server/main.goUse the basic example as a template:
package main
import (
"context"
"fmt"
"os"
"github.com/Ranganaths/minion/core"
"github.com/Ranganaths/minion/llm"
"github.com/Ranganaths/minion/models"
"github.com/Ranganaths/minion/storage"
)
func main() {
// 1. Create framework
framework := core.NewFramework(
core.WithStorage(storage.NewInMemory()),
core.WithLLMProvider(llm.NewOpenAI(os.Getenv("OPENAI_API_KEY"))),
)
defer framework.Close()
// 2. Create agent
ctx := context.Background()
agent, _ := framework.CreateAgent(ctx, &models.CreateAgentRequest{
Name: "My Example Agent",
Description: "Description of what this agent does",
})
// 3. Activate
activeStatus := models.StatusActive
framework.UpdateAgent(ctx, agent.ID, &models.UpdateAgentRequest{
Status: &activeStatus,
})
// 4. Execute
output, _ := framework.Execute(ctx, agent.ID, &models.Input{
Raw: "Your prompt here",
})
fmt.Println(output.Result)
}- Getting Started - Installation guide
- Architecture - System design
- API Reference - Complete API docs
- Protocols - A2A, AG-UI, MCP