Skip to content

A Python framework for building agents. Includes support for async processing, multi-tenancy, observability, and LLM integration.

Notifications You must be signed in to change notification settings

navdeep-G/agentspring

Repository files navigation

AgentSpring: A Framework for Building AI Agents

Python Version Docker

🌟 What is AgentSpring?

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.

πŸš€ Key Features

  • πŸ€– 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

πŸ—οΈ Project Structure

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

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • PostgreSQL (for production)
  • Redis (for caching and message brokering)
  • Docker (optional, for containerized deployment)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/agentspring.git
    cd agentspring
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt

Running with Docker (Recommended)

  1. Start all services:

    docker-compose up -d
  2. Check the logs:

    docker-compose logs -f
  3. Access the API at http://localhost:8000

πŸ§‘β€πŸ’» Basic Usage

Creating a Simple Agent

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)

Running the Travel Planner Demo

  1. Navigate to the demo directory:

    cd demos/travel_planner
  2. Run the demo:

    python travel_planner.py

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details on how to get started.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ›£οΈ Roadmap

Q4 2025 - Core Stability & Security

  • Base agent framework

    • βœ… Implemented with BaseAgent class
    • βœ… Supports async execution
    • βœ… Configurable via AgentConfig
  • Tool system

    • βœ… ToolRegistry for 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

Q1 2026 - Enhanced Capabilities & Scalability

  • 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

Q2 2026 - Enterprise Features

  • Authentication & Authorization
    • OAuth2/OIDC integration
    • Role-based access control (RBAC)
    • Fine-grained permissions

Q3 2026 - Developer Experience & Ecosystem

  • 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

Q4 2026 - Advanced Features & Optimization

  • 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

Future Considerations

  • 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

About

A Python framework for building agents. Includes support for async processing, multi-tenancy, observability, and LLM integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published