AgentWeave Examples
This section provides comprehensive, runnable examples demonstrating how to build secure AI agents with AgentWeave. Each example includes complete code, configuration files, deployment manifests, and detailed explanations.
Example Categories
Getting Started Examples
Perfect for developers new to AgentWeave:
- Simple Agent - Single agent with one capability, complete walkthrough
- Multi-Agent Orchestration - Orchestrator pattern with multiple workers
Architectural Patterns
Common patterns for building agent systems:
- Federated Agents - Agents across trust domains with cross-domain communication
- Microservices Pattern - Converting traditional microservices to secure agents
Real-World Use Cases
Production-ready examples for specific industries:
- Data Processing Pipeline - ETL pipeline with ingestion, processing, and storage agents
- Financial Services - Trading system with compliance and audit
- Healthcare - Patient data processing with HIPAA compliance
- IoT/Edge Computing - Edge devices communicating securely with cloud
Complexity Levels
Examples are marked with complexity levels to help you choose:
| Level | Description | Best For |
|---|---|---|
| Beginner | Single agent, minimal configuration | Learning AgentWeave basics |
| Intermediate | Multi-agent systems, basic policies | Building practical applications |
| Advanced | Federation, complex policies, production patterns | Enterprise deployments |
How to Run Examples
Prerequisites
All examples require:
- Python 3.11+
1
python --version # Should be 3.11 or higher
- Docker and Docker Compose
1 2
docker --version docker-compose --version
- AgentWeave SDK
1
pip install agentweave
Quick Start
Each example includes a complete setup. The general pattern is:
1
2
3
4
5
6
7
8
9
10
11
12
# 1. Clone the examples repository
git clone https://github.com/aj-geddes/agentweave.git
cd agentweave/examples/<example-name>
# 2. Review the configuration
cat config/agent.yaml
# 3. Start infrastructure (SPIRE, OPA)
docker-compose up -d
# 4. Run the agent
python agent.py
Example Structure
Each example follows this structure:
1
2
3
4
5
6
7
8
9
10
11
12
13
example-name/
├── README.md # Overview and instructions
├── agent.py # Agent implementation
├── config/
│ ├── agent.yaml # Agent configuration
│ └── policies/ # OPA policies
│ └── authz.rego
├── docker-compose.yaml # Infrastructure setup
├── spire/ # SPIRE configuration
│ ├── server.conf
│ └── agent.conf
├── tests/ # Unit and integration tests
└── requirements.txt # Python dependencies
Example Code Repository
All examples are available in the AgentWeave Repository:
1
2
git clone https://github.com/aj-geddes/agentweave.git
cd agentweave/examples
The repository includes:
- Complete, runnable code for each example
- Docker Compose files for infrastructure
- SPIRE and OPA configurations
- Integration tests
- Deployment manifests for Kubernetes
- Helm charts for production deployment
Learning Path
We recommend following examples in this order:
- Simple Agent - Understand the basics
- Multi-Agent Orchestration - Learn inter-agent communication
- Data Pipeline - Apply patterns to a real use case
- Federated Agents - Understand cross-domain security
- Industry-Specific Examples - Adapt patterns to your domain
Getting Help
- Documentation Issues: Open an issue
- Example Questions: GitHub Discussions
- Community: Discord Server
Contributing Examples
Have a useful pattern or use case? We welcome contributions!
See Contributing Guide for:
- Example submission guidelines
- Code quality standards
- Documentation requirements
Next Steps:
- Start with Simple Agent to learn the basics
- Review Core Concepts for deeper understanding
- Check out Real-World Examples for production patterns