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:

Architectural Patterns

Common patterns for building agent systems:

Real-World Use Cases

Production-ready examples for specific industries:

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:

  1. Python 3.11+
    1
    
    python --version  # Should be 3.11 or higher
    
  2. Docker and Docker Compose
    1
    2
    
    docker --version
    docker-compose --version
    
  3. 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:

  1. Simple Agent - Understand the basics
  2. Multi-Agent Orchestration - Learn inter-agent communication
  3. Data Pipeline - Apply patterns to a real use case
  4. Federated Agents - Understand cross-domain security
  5. Industry-Specific Examples - Adapt patterns to your domain

Getting Help

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: