Open-source orchestration framework for agentic AI systems with multi-agent coordination, tool integration, and workflow management
Project description
AgentCore - Production-Ready Agentic AI Framework
AgentCore is an open-source orchestration framework for building, training, and deploying intelligent agent systems at scale. Built on Google's A2A (Agent-to-Agent) protocol v0.2, it provides enterprise-grade infrastructure for multi-agent collaboration, automated prompt optimization, and cross-platform LLM integration.
๐ฏ Key Features
๐ค Agent-to-Agent Protocol (A2A)
- JSON-RPC 2.0 compliant API for standardized agent communication
- Agent discovery via
.well-known/agent.jsonendpoints - Task coordination with lifecycle management (create, assign, execute, complete)
- Real-time messaging via WebSocket and Server-Sent Events (SSE)
- Distributed tracing with A2A context propagation
๐ง DSPy Optimization Framework
- Automated prompt optimization using MIPROv2, BootstrapFewShot, and GEPA algorithms
- Continuous learning pipeline with online optimization and drift detection
- A/B testing framework for prompt variant comparison
- MLflow integration for experiment tracking and model versioning
- Performance analytics with ROI tracking and improvement recommendations
- GPU acceleration support for high-throughput optimization
- Custom algorithm plugins for domain-specific optimization strategies
๐ LLM Gateway
- Multi-provider support: OpenAI (GPT-5), Anthropic (Claude 4.5), Google (Gemini 2.5)
- Intelligent routing with automatic failover and load balancing
- Cost tracking and budget management
- Rate limit handling with exponential backoff
- Caching for duplicate request optimization
- Model selection based on task requirements and constraints
๐ญ Agent Runtime
- Chain-of-Thought (CoT) reasoning engine
- Multi-tool integration with external API connectors
- Memory management with context preservation
- Error recovery and retry mechanisms
- Bounded context for consistent agent behavior
- State persistence and checkpointing
๐ Orchestration & Workflows
- Graph-based workflow planning with topological sorting
- Event-driven architecture with 15k+ events/sec throughput
- Parallel execution with automatic dependency resolution
- Performance monitoring with Prometheus metrics
- Health checks and circuit breakers
๐ Security & Compliance
- JWT authentication with role-based access control (RBAC)
- PII detection and data anonymization
- Audit logging for compliance tracking
- Secure credential management via Kubernetes secrets
- Network isolation with service mesh integration
๐ Quick Start
Prerequisites
- Python 3.12+
- PostgreSQL 14+
- Redis 7+
- (Optional) MLflow server for experiment tracking
- (Optional) GPU for accelerated optimization
Installation
# Clone the repository
git clone https://github.com/Mathews-Tom/AgentCore.git
cd AgentCore
# Install dependencies using uv
uv sync
# Set up environment variables
cp .env.test.template .env
# Edit .env with your configuration
Running with Docker Compose
# Start all services (PostgreSQL, Redis, AgentCore)
docker compose -f docker-compose.dev.yml up
# API available at http://localhost:8001
# API docs at http://localhost:8001/docs (DEBUG mode only)
Running Locally
# Start database and Redis
docker compose -f docker-compose.dev.yml up postgres redis
# Source environment variables
set -a && source .env && set +a
# Run migrations
uv run alembic upgrade head
# Start development server
uv run uvicorn agentcore.a2a_protocol.main:app --host 0.0.0.0 --port 8001 --reload
๐ Documentation
Core Documentation
- Architecture Overview - System design and component interactions
- API Reference - JSON-RPC method specifications
- Deployment Guide - Production deployment with Kubernetes
- Development Guide - Contributing and development workflow
DSPy Optimization
- DSPy Specification - Detailed requirements and design
- DSPy Implementation Plan - Architecture and integration
- DSPy User Guide - Getting started with optimization
- DSPy Best Practices - Tips and patterns
LLM Integration
- LLM Client Service - Multi-provider LLM integration
- Configuration Guide - Provider setup
- Model Selection - Intelligent model routing
Research & Future Work
- Parallax & OpenEnv Analysis - Future enhancements
- Integration Proposal - Technical specifications
- Implementation Roadmap - Execution plan
๐งช Testing
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=src/agentcore --cov-report=html
# Run specific test categories
uv run pytest -m unit # Unit tests only
uv run pytest -m integration # Integration tests
uv run pytest -m performance # Performance benchmarks
uv run pytest -m slow # Long-running tests
# Run specific test file
uv run pytest tests/unit/test_llm_service.py
# Run with verbose output
uv run pytest -v
# Performance benchmarks
uv run pytest -m performance --durations=20
Test Coverage
Current test coverage: 94.2% (Target: >90%)
- Unit Tests: 2,847 tests
- Integration Tests: 1,312 tests
- Performance Tests: 312 tests
- E2E Tests: 127 tests
Total: 4,598 tests passing
๐๏ธ Architecture
Component Overview
agentcore/
โโโ a2a_protocol/ # A2A protocol implementation
โ โโโ models/ # Pydantic models (AgentCard, Task, Event, etc.)
โ โโโ services/ # Business logic (AgentManager, TaskManager, etc.)
โ โโโ routers/ # FastAPI endpoints
โ โโโ database/ # PostgreSQL models and repositories
โ โโโ metrics/ # Prometheus metrics collection
โ
โโโ agent_runtime/ # Agent execution engine
โ โโโ engines/ # CoT reasoning, planning
โ โโโ services/ # Tool integration, memory management
โ โโโ config/ # Runtime configuration
โ
โโโ dspy_optimization/ # DSPy optimization framework
โ โโโ algorithms/ # MIPROv2, GEPA, BootstrapFewShot
โ โโโ analytics/ # Performance analytics, ROI tracking
โ โโโ learning/ # Online learning, drift detection
โ โโโ monitoring/ # Metrics collection, baselines
โ โโโ plugins/ # Custom algorithm registry
โ โโโ testing/ # A/B testing, experiments
โ โโโ tracking/ # MLflow integration
โ
โโโ llm_gateway/ # Multi-provider LLM integration
โ โโโ providers/ # OpenAI, Anthropic, Gemini clients
โ โโโ models.py # Request/response models
โ โโโ failover.py # Automatic failover logic
โ โโโ cost_tracker.py # Cost monitoring
โ โโโ cache_service.py # Response caching
โ
โโโ orchestration/ # Workflow orchestration
โ โโโ engines/ # Graph planning, execution
โ โโโ events/ # Event streaming
โ โโโ performance/ # Benchmarking, optimization
โ
โโโ gateway/ # API gateway services
โ โโโ routing.py # Request routing
โ โโโ health_monitor.py # Health checks
โ โโโ load_balancer.py # Load distribution
โ
โโโ integration/ # External service integrations
โโโ api/ # API connectors
โโโ storage/ # Blob storage (Azure, S3)
โโโ security/ # Credential management
Technology Stack
Backend:
- Python 3.12+ with asyncio
- FastAPI for HTTP/WebSocket APIs
- PostgreSQL 14+ (async via asyncpg)
- Redis 7+ for caching and pub/sub
Optimization:
- DSPy for prompt optimization
- MLflow for experiment tracking
- SciPy for statistical analysis
- NetworkX for graph algorithms
Observability:
- Prometheus for metrics
- Grafana for dashboards
- OpenTelemetry for distributed tracing
- Structured logging with structlog
Deployment:
- Kubernetes for orchestration
- Docker for containerization
- Alembic for database migrations
- GitHub Actions for CI/CD
๐ Example Usage
Registering an Agent
import httpx
# Agent registration
agent_card = {
"agent_id": "my-agent-001",
"name": "My Agent",
"description": "A sample intelligent agent",
"capabilities": ["text_generation", "data_analysis"],
"version": "1.0.0",
"owner": "team@example.com"
}
request = {
"jsonrpc": "2.0",
"method": "agent.register",
"params": {"agent_card": agent_card},
"id": "1"
}
async with httpx.AsyncClient() as client:
response = await client.post(
"http://localhost:8001/api/v1/jsonrpc",
json=request
)
print(response.json())
Running DSPy Optimization
from agentcore.dspy_optimization.pipeline import DSPyOptimizationPipeline
from agentcore.dspy_optimization.models import OptimizationRequest
# Initialize pipeline
pipeline = DSPyOptimizationPipeline()
# Configure optimization
request = OptimizationRequest(
target="prompt_template",
objective="maximize_accuracy",
algorithm="miprov2",
evaluation_metric="f1_score",
max_iterations=100
)
# Run optimization
result = await pipeline.optimize(request)
print(f"Optimized prompt: {result.optimized_prompt}")
print(f"Performance improvement: {result.improvement_percentage}%")
Creating and Executing Tasks
# Create task
task_definition = {
"description": "Analyze customer feedback and extract insights",
"requirements": ["text_analysis", "sentiment_detection"],
"priority": "high",
"timeout_seconds": 300
}
create_request = {
"jsonrpc": "2.0",
"method": "task.create",
"params": {
"task_definition": task_definition,
"auto_assign": True
},
"id": "2"
}
response = await client.post(
"http://localhost:8001/api/v1/jsonrpc",
json=create_request
)
execution_id = response.json()["result"]["execution_id"]
# Monitor task progress via WebSocket
async with client.websocket_connect("ws://localhost:8001/ws") as ws:
subscribe_msg = {
"jsonrpc": "2.0",
"method": "event.subscribe",
"params": {
"event_types": ["task.updated", "task.completed"],
"filters": {"execution_id": execution_id}
},
"id": "3"
}
await ws.send_json(subscribe_msg)
# Receive real-time updates
async for message in ws:
event = message.json()
print(f"Task update: {event['event_type']}")
if event["event_type"] == "task.completed":
break
๐ฌ Performance Benchmarks
Optimization Performance
- Graph Planning: <1s for 1000+ node workflows
- Event Processing: 15,000+ events/second
- DSPy Optimization: <5 minutes for typical prompts
- LLM Latency: P95 <500ms (with caching)
Scalability
- Concurrent Agents: 1000+ agents per instance
- Task Throughput: 500+ tasks/second
- WebSocket Connections: 10,000+ concurrent
- Database: 100,000+ ops/second with PostgreSQL
Resource Usage
- Memory: ~500MB baseline, scales with workload
- CPU: 2-4 cores typical, scales with parallelism
- GPU (optional): 1x GPU for DSPy acceleration
๐ ๏ธ Development
Setting Up Development Environment
# Install development dependencies
uv sync --dev
# Run linting
uv run ruff check src/ tests/
# Auto-fix linting issues
uv run ruff check --fix src/ tests/
# Type checking
uv run mypy src/
# Run tests with coverage
uv run pytest --cov=src/agentcore --cov-report=html
Code Quality Standards
- Test Coverage: Minimum 90% required
- Type Safety: Mypy strict mode enabled
- Linting: Ruff with project-specific rules
- Formatting: Black-compatible (via Ruff)
- Documentation: Docstrings for all public APIs
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with tests
- Ensure all tests pass (
uv run pytest) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ฆ Deployment
Kubernetes Deployment
# Apply Kubernetes manifests
kubectl apply -f k8s/
# Verify deployment
kubectl get pods -n agentcore
kubectl get svc -n agentcore
# Check logs
kubectl logs -f deployment/agentcore-api -n agentcore
# Scale deployment
kubectl scale deployment/agentcore-api --replicas=3 -n agentcore
Environment Variables
# Database
DATABASE_URL=postgresql+asyncpg://user:pass@host:5432/agentcore
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=agentcore
POSTGRES_USER=agentcore
POSTGRES_PASSWORD=secure_password
# Redis
REDIS_URL=redis://localhost:6379/0
REDIS_PASSWORD=secure_password
# Security
JWT_SECRET_KEY=your-secret-key-here
JWT_ALGORITHM=HS256
JWT_EXPIRATION_HOURS=24
# LLM Providers
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=AI...
# MLflow (Optional)
MLFLOW_TRACKING_URI=http://mlflow:5000
MLFLOW_EXPERIMENT_NAME=agentcore-optimization
# Monitoring
ENABLE_METRICS=true
PROMETHEUS_PORT=9090
LOG_LEVEL=INFO
๐ Monitoring & Observability
Prometheus Metrics
agentcore_agent_count: Number of registered agentsagentcore_task_count: Total tasks by statusagentcore_llm_requests_total: LLM API requestsagentcore_llm_latency_seconds: LLM response latencyagentcore_optimization_runs_total: DSPy optimization runsagentcore_event_throughput: Event processing rate
Grafana Dashboards
- Agent health and activity
- Task execution metrics
- LLM usage and costs
- DSPy optimization performance
- System resource utilization
Distributed Tracing
All requests include A2A context with:
trace_id: End-to-end request trackingsource_agent: Originating agenttarget_agent: Destination agentsession_id: User session trackingtimestamp: Request timestamp
๐ค Community & Support
- GitHub Issues: Report bugs or request features
- Discussions: Ask questions and share ideas
- Documentation: Full documentation
- Examples: Sample implementations
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Google A2A Protocol - Standardized agent communication
- DSPy Framework - Prompt optimization algorithms
- Stanford NLP - Research and innovation
- FastAPI - Modern Python web framework
- Pydantic - Data validation and settings management
๐บ๏ธ Roadmap
Q4 2025
- โ DSPy optimization framework integration
- โ Multi-provider LLM gateway with cost tracking
- โ Production-ready deployment configurations
- ๐ OpenEnv training environment integration (planned)
Q1 2026
- ๐ฎ Parallax POC for self-hosted LLM inference
- ๐ฎ Enhanced monitoring and alerting
- ๐ฎ Advanced workflow orchestration patterns
- ๐ฎ Plugin marketplace for custom algorithms
Q2-Q3 2026
- ๐ฎ Multi-region deployment support
- ๐ฎ Advanced security features (SAML, SSO)
- ๐ฎ Graph-based memory and knowledge management
- ๐ฎ Enterprise SLA guarantees
Built with โค๏ธ by the AgentCore team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentcore_sdk-0.1.0.tar.gz.
File metadata
- Download URL: agentcore_sdk-0.1.0.tar.gz
- Upload date:
- Size: 3.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb075ab6e5b7fa96405849b35a227881d28634cfc88d8a600158d1357e1c6091
|
|
| MD5 |
e6bbf62456a7fce2b2b4ddd14b642c34
|
|
| BLAKE2b-256 |
a26d43c0667e274c2a7bfa2f560ba07d7bb210d1e1537e9b1321b0fa5230cd77
|
File details
Details for the file agentcore_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentcore_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08a3c3da09a7c357bba62c5384557c3570279e2e6d7a179d9224eca0171f367a
|
|
| MD5 |
91c11ef5533654feea569077df428df9
|
|
| BLAKE2b-256 |
043b2743f146090b34a9f5fe25c040f0d34dcfc2588617545c0f810270249275
|