Skip to main content

A production-grade multi-agent AI orchestration framework

Project description

Agentic AI Framework

A production-grade multi-agent AI orchestration framework built with Python, featuring MCP (Model Context Protocol) integration, LangGraph workflows, and extensible agent architectures.

Architecture Overview

┌─────────────────────────────────────────────────────────────────┐
│                    Agentic AI Framework                         │
├─────────────────────────────────────────────────────────────────┤
│  ┌─────────────────────────────────────────────────────────┐   │
│  │              Orchestration Layer (LangGraph)             │   │
│  │  ┌─────────────┐  ┌──────────────┐  ┌──────────────┐   │   │
│  │  │  Supervisor │──│   Router     │──│   Executor   │   │   │
│  │  └─────────────┘  └──────────────┘  └──────────────┘   │   │
│  └─────────────────────────────────────────────────────────┘   │
│                              │                                  │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │                    Agent Layer                           │   │
│  │  ┌─────────────┐  ┌──────────────┐  ┌──────────────┐   │   │
│  │  │ Math Agent  │  │  Text Agent  │  │ Custom Agent │   │   │
│  │  └─────────────┘  └──────────────┘  └──────────────┘   │   │
│  └─────────────────────────────────────────────────────────┘   │
│                              │                                  │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │                    MCP Layer                             │   │
│  │  ┌─────────────┐  ┌──────────────┐  ┌──────────────┐   │   │
│  │  │ MCP Server  │  │  MCP Client  │  │ Tool Bridge  │   │   │
│  │  └─────────────┘  └──────────────┘  └──────────────┘   │   │
│  └─────────────────────────────────────────────────────────┘   │
│                              │                                  │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │                    Tools Layer                           │   │
│  │  ┌─────────────┐  ┌──────────────┐  ┌──────────────┐   │   │
│  │  │ Math Tools  │  │  Text Tools  │  │   Registry   │   │   │
│  │  └─────────────┘  └──────────────┘  └──────────────┘   │   │
│  └─────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────┘

Features

  • Multi-Agent Orchestration: Coordinate multiple specialized agents using LangGraph state machines
  • MCP Protocol Support: Industry-standard Model Context Protocol for tool serving
  • Extensible Tool System: Plugin-based architecture for adding custom tools
  • Type-Safe Design: Full type hints with Pydantic validation
  • Production Logging: Structured logging with configurable levels
  • Async-First: Built on asyncio for high-performance concurrent execution
  • Comprehensive Testing: Unit and integration tests with pytest

Installation

# Clone the repository
git clone https://github.com/hasanjawad001/agentic-ai-mcp.git
cd agentic-ai-mcp

# Create virtual environment
uv venv env --python 3.13
source env/bin/activate

# Install dependencies
pip install -e ".[dev]"

# Set up environment variables
cp .env.example .env
# Edit .env with your API keys

Quick Start

1. Start the MCP Server

python -m agentic_ai.mcp.server

2. Run a Multi-Agent Workflow

from agentic_ai import AgenticWorkflow

async def main():
    workflow = AgenticWorkflow()
    result = await workflow.execute(
        "Calculate 15 + 27, then convert the result to uppercase"
    )
    print(result)

import asyncio
asyncio.run(main())

3. Create Custom Agents

from agentic_ai.core import BaseAgent
from agentic_ai.tools import tool

class MyCustomAgent(BaseAgent):
    name = "custom_agent"
    description = "A custom agent for specific tasks"

    @tool
    def my_custom_tool(self, input_data: str) -> str:
        """Process input data in a custom way."""
        return f"Processed: {input_data}"

Project Structure

code_agentic_ai/
├── src/
│   └── agentic_ai/
│       ├── core/           # Core abstractions and base classes
│       ├── tools/          # Tool definitions and registry
│       ├── mcp/            # MCP server, client, and bridge
│       ├── agents/         # Specialized agent implementations
│       ├── orchestration/  # LangGraph workflows and routing
│       └── config/         # Configuration management
├── tests/
│   ├── unit/              # Unit tests
│   └── integration/       # Integration tests
├── examples/              # Usage examples
└── docs/                  # Documentation

Key Concepts

Agents

Agents are autonomous entities that can reason, plan, and execute actions. Each agent has:

  • A set of tools it can use
  • A specific domain of expertise
  • The ability to communicate with other agents through the orchestrator

Tools

Tools are atomic operations that agents can invoke. They are:

  • Defined with type hints and descriptions
  • Served via MCP protocol for language-agnostic access
  • Validated at runtime using Pydantic schemas

Orchestration

The orchestration layer coordinates multiple agents:

  • Supervisor: Decides which agent should handle a task
  • Router: Routes requests based on task requirements
  • Executor: Manages the execution flow and state

Configuration

# config/settings.py
from pydantic_settings import BaseSettings

class Settings(BaseSettings):
    anthropic_api_key: str
    mcp_server_host: str = "0.0.0.0"
    mcp_server_port: int = 8888
    log_level: str = "INFO"
    max_agent_iterations: int = 10

    class Config:
        env_file = ".env"

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=agentic_ai --cov-report=html

# Run specific test file
pytest tests/unit/test_tools.py -v

Examples

See the examples/ directory for comprehensive usage examples:

  • basic_workflow.py: Simple single-agent workflow
  • multi_agent_workflow.py: Multi-agent coordination
  • custom_tools.py: Creating and registering custom tools

License

MIT License - see LICENSE for details.

Contributing

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentic_ai_mcp-0.1.0.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentic_ai_mcp-0.1.0-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file agentic_ai_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: agentic_ai_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentic_ai_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3222be168b8efc77fad413428105a06c2a384069de582fa17edf681a185153eb
MD5 7cd14c26a5db8b7b8160aac6e75268b4
BLAKE2b-256 169de98fc95eac0b34da74f5daf449091a978b362567148a16d53a4318743b51

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentic_ai_mcp-0.1.0.tar.gz:

Publisher: cd.yml on hasanjawad001/agentic-ai-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentic_ai_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentic_ai_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentic_ai_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ca94797cfb1a6bd4cde39f9cea9bed073dd581931012d32d5c1fe8759c46362
MD5 2c8abe0be07547a8ea05e6f6adab9cc8
BLAKE2b-256 cb758ffc60975126b92df72cd419785c96c19cfdac1a56298d4dff946de9c9fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentic_ai_mcp-0.1.0-py3-none-any.whl:

Publisher: cd.yml on hasanjawad001/agentic-ai-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page