A modular, production-ready multi-agent orchestration framework built on LangGraph, FastAPI, and Model Context Protocol (MCP). Seamlessly orchestrate complex AI agent workflows with built-in memory management, observability, and secure integration capabilities.
---
config:
theme: mc
layout: dark
---
flowchart RL
subgraph FastAPIGateway["FastAPI Gateway"]
Gateway["REST Interface"]
Validate["Input Validation & Schema Check"]
Trace["Assign Trace ID"]
end
subgraph LangGraphOrchestrator["LangGraph Orchestrator"]
InputNode["Input Node"]
IntentNode["Intent Classification Node"]
ToolDecision["Tool Decision Node"]
ToolExec["Tool Execution Node"]
MemoryUpdate["Memory Update Node"]
ResponseFormat["Response Formatter Node"]
end
subgraph MCPLayer["MCP Layer"]
MCPInterface["MCP Interface\n(MCP Client + Server)"]
LLM["LLM Provider"]
ExternalAPI["External APIs / Tools"]
end
subgraph MemorySystem["Memory System"]
ShortTerm["Short-Term Memory<br>(Graph State)"]
LongTermDB["Long-Term Memory<br>(SQLite / Logs)"]
VectorDB["Vector DB<br>(Notes Embeddings)"]
end
subgraph ObservabilityLayer["Observability"]
Logger["Structured Logger"]
Metrics["Execution Time Metrics"]
TraceStore["Trace Storage"]
end
Client["Client App / OpenClaw"] -- A2A HTTP Request --> Gateway
Gateway --> Validate
Validate --> Trace
Trace --> LangGraphCore["LangGraph Entry"]
LangGraphCore --> InputNode
InputNode --> IntentNode & Logger
IntentNode --> ToolDecision
ToolDecision --> ToolExec
ToolExec --> MemoryUpdate & MCPInterface & Metrics
MemoryUpdate --> ResponseFormat & ShortTerm & LongTermDB & VectorDB
MCPInterface --> LLM & ExternalAPI
ResponseFormat --> TraceStore
ResponseFormat -- Structured Response --> Gateway
Gateway -- HTTP Response --> Client
style FastAPIGateway fill:maroon
style MCPLayer color:#000000,fill:black
style MemorySystem fill:purple
style ObservabilityLayer fill:green
- LangGraph - Agent orchestration and workflow management
- FastAPI - High-performance HTTP API gateway
- Model Context Protocol (MCP) - Modular tool and prompt management
- Redis - Short-term memory and checkpoint recovery
- ChromaDB - Long-term semantic memory with vector embeddings
- OpenTelemetry - Distributed tracing and observability
- Google Generative AI - LLM integration
- Python 3.13+ - Modern async/await support
- Docker - Containerized infrastructure
Seamless integration with OpenClaw for A2A multi agent workflows. Only core agent is exposed to private MCP servers, enabling powerful automation capabilities keeping the robustness of OpenClaw in a highly secure manner
MCP Local Server provides a decoupled architecture:
- Define tools and prompts independently of the main agent
- Flexibility in tool additions or upgrades
- Namespace-based tool organization
- Short-term: Redis-backed conversation history with checkpoint recovery
- Long-term: ChromaDB vector embeddings for semantic search
- Automatic pruning and summarization of old conversations
Built-in OpenTelemetry instrumentation:
- Distributed tracing across FastAPI, HTTPX, and custom spans
- OTLP exporter for Jaeger/Datadog integration
- Request-level context propagation
- Performance metrics and error tracking
- Tool Access Control
- Argument Sanitization
Next iterations will include:
- API authentication (JWT/OAuth2)
- Tool execution sandboxing
I used OpenClaw and was amazed to see the capabilities and control it had on the user's PC, but I was more aroused by seeing the security it lacked. If I have authenticated and connected OpenClaw to my telegram, a simple, "delete file.txt" would run without any restrictions. It led me to think about a agent framework from sratch that would connect to OpenClaw for its robust capabilities and at the same time keep the private functionalities under control of the private agent.
I started with making a minimalistic architecture and a working setup of the gateway, mcp server and client, opentelemetry, and basic security controls. Then I realized a few short comings that I documented in the file docs/Learnings.md.
The top mistakes and learnings:
- Agnostic MCP Client: I had made the client hardcodedly connected to my own mcp server, and I found it impossible to connect to open source servers. I ended up making MCPRegistry class and distilled the MCPClient class to HTTP streams and Stdio initialization, and added a config file
- Memory management: the importance of reducer and summarization of messages before sending it to the llm
- Docker Compose Setup: learned to create justfile to handle too many ports and docker engine workings
for more read docs/Learnings.md.
In the future I will be applying LLM Top 10 best practices to make the agent more secure. Keep checking in the future :)
- Python 3.13+
- Docker (for Redis & ChromaDB)
- Google Generative AI API key
-
Clone and install dependencies
git clone https://github.com/steosumit/open-multi-agent cd open-multi-agent uv sync -
Set environment variables
cp .env.example .env # Add your GOOGLE_API_KEY and other configs -
Start infrastructure (using justfile)
just dev # Starts Redis, MCP Server, and FastAPI GatewayOr manually:
docker run -d --name redis-short-term -p 6379:6379 redis:latest python -m mcp_local.server uvicorn app.main:app --reload --port 8001
-
Test the agent
$body = @{ message = "What can you do?" trace_id = "test-001" } | ConvertTo-Json Invoke-WebRequest -Uri "http://localhost:8001/agent-task" ` -Method POST ` -ContentType "application/json" ` -Body $body
open-multi-agent/
├── app/ # FastAPI gateway and routes
├── core/ # Configuration and utilities
├── mcp_local/ # MCP server implementation
├── memory/ # Short-term (Redis) and long-term (ChromaDB) storage
├── observability/ # OpenTelemetry setup
├── ops/ # Deployment and operations
├── justfile # Task automation
├── pyproject.toml # Project dependencies
└── README.md # This file
pytest tests/ -vruff format .Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m "Add feature") - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request
MIT
Made with ❤️ by steosumit for the open-source community.