AgentSpring is an open-source framework designed to simplify the development, deployment, and management of AI agents. It provides a robust set of tools and abstractions that enable developers to create sophisticated AI-powered applications with minimal boilerplate code.
- π€ Intelligent Agents: Create stateful, context-aware AI agents with custom behaviors
- π§ Tool System: Extend agent capabilities with custom tools and functions
- π§© Plugin Architecture: Modular design for easy extension and customization
- β‘ FastAPI Backend: Built on FastAPI for high-performance API endpoints
- π¦ Container Ready: Docker and Docker Compose support for easy deployment
- π Secure: Built-in authentication and authorization
- π Monitoring: Integrated logging and monitoring capabilities
agentspring/
βββ agents/ # Core agent implementations
βββ api/ # FastAPI application and endpoints
βββ db/ # Database models and migrations
βββ tools/ # Built-in tools for agents
βββ demos/ # Example implementations
β βββ travel_planner/ # Example travel planning agent
βββ tests/ # Test suite
βββ Dockerfile # Docker configuration
βββ requirements.txt # Python dependencies
- Python 3.8+
- PostgreSQL (for production)
- Redis (for caching and message brokering)
- Docker (optional, for containerized deployment)
-
Clone the repository:
git clone https://github.com/yourusername/agentspring.git cd agentspring -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Start all services:
docker-compose up -d
-
Check the logs:
docker-compose logs -f
-
Access the API at
http://localhost:8000
from agentspring import Agent, Message, MessageRole
class GreetingAgent(Agent):
"""A simple agent that greets users."""
async def execute(self, messages, context=None):
last_message = messages[-1]
name = last_message.get('name', 'there')
return Message(
role=MessageRole.ASSISTANT,
content=f"Hello, {name}! How can I assist you today?"
)
# Initialize and use the agent
agent = GreetingAgent()
response = await agent.execute([{"role": "user", "content": "Hi!", "name": "Alex"}])
print(response.content)-
Navigate to the demo directory:
cd demos/travel_planner -
Run the demo:
python travel_planner.py
We welcome contributions! Please see our Contributing Guide for details on how to get started.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
-
Base agent framework
- β
Implemented with
BaseAgentclass - β Supports async execution
- β
Configurable via
AgentConfig
- β
Implemented with
-
Tool system
- β
ToolRegistryfor managing tools - β Tool registration and discovery
- β Support for async/sync tools
- β Tool validation and documentation
- β
-
Plugin architecture(Partially implemented)- β Basic plugin structure exists
- Dynamic loading/unloading
- Dependency management
- Version compatibility
- Plugin isolation
-
Basic API endpoints
- β FastAPI-based REST API
- β Agent execution endpoints
- β Request/response handling
- β Error handling
-
Production Security
- Rate limiting and throttling
- API key rotation and management
- Input validation and sanitization
- CORS and security headers
- Audit logging
-
Observability
- Structured logging
- Metrics collection (Prometheus)
- Distributed tracing (OpenTelemetry)
- Health check endpoints
-
Advanced Workflow Engine
- DAG-based workflows
- Conditional branching
- Error handling and retries
- Timeouts and circuit breakers
-
State Management
- Persistent workflow state
- Checkpointing and resumability
- Distributed locking
-
Scalability
- Horizontal scaling support
- Load balancing
- Connection pooling
- Background task processing
- Authentication & Authorization
- OAuth2/OIDC integration
- Role-based access control (RBAC)
- Fine-grained permissions
-
Developer Tools
- CLI for management
- Local development environment
- Testing framework
- Code generation
-
Documentation
- API reference
- User guides
- Tutorials
- Example projects
-
Integration Ecosystem
- Plugin marketplace
- Webhooks
- WebSocket support
- gRPC interface
-
Performance
- Caching layer
- Query optimization
- Memory management
- Async I/O optimization
-
AI/ML Enhancements
- Model versioning
- A/B testing
- Feedback loops
- Automated evaluation
-
Compliance
- GDPR compliance
- Data encryption at rest/transit
- Compliance documentation
- Audit trails
-
Edge Computing
- Lightweight runtime
- Offline capabilities
- Edge synchronization
-
Advanced Analytics
- Usage analytics
- Performance metrics
- Cost tracking
- Anomaly detection
-
Community & Support
- Community forum
- Commercial support
- Training programs
- Certification