Examples
The repository includes 18 comprehensive examples demonstrating core features and production patterns:
Getting started
basic_agentβ Simple ReAct agent with tool calling and message handlingstate_builderβ Simplified state initialization with fluent APIstreamingβ Real-time event streaming for responsive UIs and progress tracking
Tool integration
mcp_toolsβ Model Context Protocol integration with dynamic tool discovery
Advanced workflows
conditional_flowβ Dynamic routing and branching based on stateparallel_tasksβ Concurrent execution with fan-out/fan-in patternssubgraphβ Modular workflows with reusable graph components
State management
checkpointingβ Automatic state persistence and fault recoverytime_travelβ Debug workflows by replaying from any superstepmessage_retentionβ Conversation history management and pruning strategies
Production features
observabilityβ OpenTelemetry metrics, distributed tracing, and monitoringhuman_pauseβ Human-in-the-loop workflows with interrupt/resumehuman_approvalβ Approval workflows with conditional guards, state edits, and audit trailsa2a_integrationβ Agent-to-Agent protocol for multi-agent coordinationmiddlewareβ Middleware system for graph/model/tool execution layerscircuit_breakerβ Circuit breaker middleware for fault toleranceguardrailsβ Content filtering, PII protection with custom middleware
Embeddings & RAG
semantic_cachingβ Text embeddings for semantic search and RAG workflows
Browse all examples: github.com/hupe1980/agentmesh/tree/main/examples
API documentation
Complete API reference with examples:
- Main package β pkg.go.dev/github.com/hupe1980/agentmesh
- Graph package β pkg.go.dev/github.com/hupe1980/agentmesh/pkg/graph
- Agent package β pkg.go.dev/github.com/hupe1980/agentmesh/pkg/agent
- Model package β pkg.go.dev/github.com/hupe1980/agentmesh/pkg/model
- Tool package β pkg.go.dev/github.com/hupe1980/agentmesh/pkg/tool
- Testutil package β pkg.go.dev/github.com/hupe1980/agentmesh/pkg/testutil
Community
Get help
- GitHub Issues β Report bugs or request features
- Discussions β Ask questions and share ideas
Contributing
Contributions are welcome! See:
- Contributing guide β CONTRIBUTING.md
- Code of conduct β CODE_OF_CONDUCT.md
Development
Running tests
# Run all tests
go test ./...
# Run with race detection
go test ./... -race
# Run with coverage
go test ./... -cover
Testing utilities
The pkg/testutil package provides mock implementations and builders for testing agents and workflows. See the Testing Guide for comprehensive documentation.
import "github.com/hupe1980/agentmesh/pkg/testutil"
// Create a mock model with builder pattern
model := testutil.NewModelBuilder().
WithResponse("Hello!").
WithToolCalls(message.ToolCall{Name: "search"}).
Build()
Benchmarks
# Run all benchmarks
go test ./... -bench=.
# Run specific benchmark
go test ./pkg/graph -bench=BenchmarkOptimized
Local documentation
Preview documentation locally:
cd docs
bundle install
bundle exec jekyll serve --livereload
Navigate to http://localhost:4000