A production-ready framework implementing 17 advanced agentic patterns powered by AWS Bedrock and Claude 3.
- Features
- Patterns Overview
- Quick Start
- Architecture
- Installation
- Usage Examples
- API Documentation
- Docker Deployment
- AWS Deployment
- Security
- Monitoring & Evaluation
- Testing
- Documentation
- Contributing
- License
See detailed documentation in each pattern folder:
- 01 - Reflection: Self-evaluating agents with iterative improvement
- 02 - Tool Using: External API and tool integration
- 03 - ReAct: Reasoning and acting with thought-action cycles
- 04 - Planning: Multi-step task decomposition
- 05 - PEV: Plan-Execute-Verify validation loops
- 06 - Tree of Thoughts: Parallel solution exploration
- 07 - Multi-Agent: Collaborative agent coordination
- 08 - Meta-Controller: Dynamic routing and orchestration
- 09 - Blackboard: Shared knowledge architecture
- 10 - Ensemble: Model combination and consensus
- 11 - Memory Systems: Episodic and semantic memory
- 12 - Graph Memory: Knowledge graph relationships
- 13 - Self-Improvement: Adaptive learning
- 14 - Dry-Run Harness: Risk-free action preview
- 15 - Simulator: Environment modeling
- 16 - Metacognitive: Self-aware cognitive monitoring
- 17 - Cellular Automata: Emergent behavior patterns
- AWS Bedrock Integration with Claude 3 Sonnet
- FastAPI REST API with authentication & rate limiting
- Docker & Kubernetes deployment ready
- Multi-database Support: PostgreSQL, Redis, ChromaDB
- Infrastructure as Code: Terraform, CloudFormation, CDK
- Prometheus & Grafana monitoring stack
- Structured Logging with audit trails
- Comprehensive Testing: Unit, Integration, E2E
- CI/CD Ready with GitHub Actions support
- API Key authentication
- Role-based access control (RBAC)
- Encryption at rest and in transit
- Audit logging for compliance
- AWS IAM integration
- Secrets management
- Performance benchmarking
- Accuracy testing
- Cost analysis (per pattern)
- Quality metrics (precision, recall, F1)
- Reliability metrics (uptime, error rate)
- Efficiency metrics (throughput, latency)
| # | Pattern | Use Case | Complexity |
|---|---|---|---|
| 01 | Reflection | Self-improving essay writing | Medium |
| 02 | Tool Using | Web search, API calls | Low |
| 03 | ReAct | Complex Q&A with reasoning | Medium |
| 04 | Planning | Multi-step task execution | Medium |
| 05 | PEV | Validated task completion | High |
| 06 | Tree of Thoughts | Creative problem solving | High |
| 07 | Multi-Agent | Team collaboration | High |
| 08 | Meta-Controller | Dynamic agent routing | Medium |
| 09 | Blackboard | Shared knowledge systems | High |
| 10 | Ensemble | Model consensus | Medium |
| 11 | Memory | Long-term context | Medium |
| 12 | Graph Memory | Relationship tracking | High |
| 13 | Self-Improvement | Continuous learning | High |
| 14 | Dry-Run | Risk mitigation | Low |
| 15 | Simulator | Scenario testing | High |
| 16 | Metacognitive | Self-awareness | High |
| 17 | Cellular Automata | Emergent patterns | High |
# Required
- Python 3.10+
- AWS Account with Bedrock access
- Docker & Docker Compose (optional)
- Git
# Optional
- Kubernetes cluster
- Terraform CLI# 1. Clone the repository
git clone https://github.com/swsarancodes/AWS-AGENTIC-ARCHITECTURES.git
cd AWS-AGENTIC-ARCHITECTURES
# 2. Set up environment
Copy-Item .env.example .env
# Edit .env with your AWS credentials
# 3. Install dependencies
pip install -r requirements.txt
# 4. Run the API
uvicorn api.main:app --reload
# 5. Open your browser
start http://localhost:8000/docs# Start all services
docker-compose up -d
# Access services
# API: http://localhost:8000
# Grafana: http://localhost:3000
# Prometheus: http://localhost:9090# Create virtual environment
python -m venv venv
.\venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Alternatively, use UV for faster installs
pip install uv
uv pip install -r requirements.txt# Install with development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run tests
pytest tests/ -vuvicorn api.main:app --host 0.0.0.0 --port 8000 --reload- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- OpenAPI JSON: http://localhost:8000/openapi.json
GET /healthGET /patternsPOST /patterns/{pattern_name}/run
Content-Type: application/json
X-API-Key: your-api-key-here
{
"input": "Your task description",
"config": {
"max_iterations": 3,
"temperature": 0.7
}
}GET /patterns/{pattern_name}curl -X POST "http://localhost:8000/patterns/reflection/run" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"input": "Explain quantum computing",
"config": {"max_iterations": 2}
}'# Start all services
docker-compose up -d
# View logs
docker-compose logs -f api
# Stop services
docker-compose down
# Rebuild and restart
docker-compose up --build -d- API: FastAPI application (port 8000)
- PostgreSQL: Primary database (port 5432)
- Redis: Cache layer (port 6379)
- ChromaDB: Vector store (port 8001)
- Prometheus: Metrics collection (port 9090)
- Grafana: Visualization (port 3000)
- Nginx: Reverse proxy (port 80)
# Build image
docker build -t agentic-patterns:latest .
# Run container
docker run -d \
-p 8000:8000 \
-e AWS_REGION=us-east-1 \
-e BEDROCK_MODEL_ID=anthropic.claude-3-sonnet-20240229-v1:0 \
--name agentic-api \
agentic-patterns:latestcd infrastructure/aws/cloudformation
# Deploy Bedrock setup
aws cloudformation create-stack \
--stack-name agentic-bedrock \
--template-body file://bedrock-setup.yaml \
--capabilities CAPABILITY_IAM
# Deploy Lambda functions
aws cloudformation create-stack \
--stack-name agentic-lambda \
--template-body file://lambda-functions.yaml \
--capabilities CAPABILITY_IAMcd infrastructure/aws/terraform
# Initialize
terraform init
# Plan deployment
terraform plan -out=tfplan
# Apply
terraform apply tfplancd infrastructure/aws/cdk
# Install dependencies
pip install -r requirements.txt
# Deploy
cdk deploy# Apply manifests
kubectl apply -f infrastructure/kubernetes/namespace.yaml
kubectl apply -f infrastructure/kubernetes/deployment.yaml
kubectl apply -f infrastructure/kubernetes/service.yaml
kubectl apply -f infrastructure/kubernetes/ingress.yaml
# Check status
kubectl get pods -n agentic-architectures# API Key authentication (default)
headers = {
"X-API-Key": "your-secure-api-key",
"Content-Type": "application/json"
}from security.access_control import AccessControl
ac = AccessControl()
ac.check_permission(user="analyst", resource="pattern", action="execute")from security.encryption import Encryption
enc = Encryption()
encrypted = enc.encrypt("sensitive data")
decrypted = enc.decrypt(encrypted)from security.audit_logger import AuditLogger
logger = AuditLogger()
logger.log_action(
user="user@example.com",
action="pattern_execution",
resource="reflection_pattern",
result="success"
)Access metrics at: http://localhost:9090
from monitoring.metrics import pattern_execution_counter
# Metrics automatically tracked:
# - pattern_execution_total
# - pattern_duration_seconds
# - pattern_error_rate
# - active_requests_gaugeAccess dashboards at: http://localhost:3000 (admin/admin)
- Pattern execution trends
- Performance metrics
- Error rates and alerts
- Cost analysis
# Run benchmarks
python -m evaluation.benchmarks.performance_tests
# Cost analysis
python -m evaluation.benchmarks.cost_analysis
# Accuracy testing
python -m evaluation.benchmarks.accuracy_testsfrom evaluation.reports.evaluation_dashboard import EvaluationDashboard
dashboard = EvaluationDashboard()
report = dashboard.generate_report({
"reflection": {"accuracy": 0.95, "latency": 2.3},
"react": {"accuracy": 0.92, "latency": 3.1}
})pytest tests/ -v --cov=patterns --cov=api --cov-report=html# Unit tests
pytest tests/unit/ -v
# Integration tests
pytest tests/integration/ -v
# End-to-end tests
pytest tests/e2e/ -v
# Performance tests
pytest tests/performance/ -vpytest tests/unit/patterns/test_reflection.py -v- Quick Start Guide: Get started in 5 minutes
- Getting Started: Detailed installation and setup
- Deployment Guide: Production deployment instructions
- Architecture Comparison: Pattern selection guide
- API Reference: Complete API documentation
- Contributing Guide: Development guidelines
- Changelog: Version history
Each pattern includes:
- Detailed README with use cases
- Example implementations
- Configuration options
- Performance characteristics
- Best practices
Example: patterns/01_reflection/README.md
- Jupyter Notebooks:
examples/notebooks/ - Streamlit Demo:
examples/demos/streamlit_app.py - CLI Tool:
examples/demos/cli_demo.py
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-pattern) - Make your changes
- Add tests
- Run tests (
pytest tests/ -v) - Commit (
git commit -m 'feat: add amazing pattern') - Push (
git push origin feature/amazing-pattern) - Open a Pull Request
# Clone your fork
git clone https://github.com/your-username/AWS-AGENTIC-ARCHITECTURES.git
# Install development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run formatting
black patterns/ api/ utils/
flake8 patterns/ api/ utils/- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions