Skip to content

A production-ready multi-agent system showcasing Agent Communication Protocol (ACP) and Model Context Protocol (MCP) capabilities through a collaborative research workflow.

License

Notifications You must be signed in to change notification settings

YanCotta/project-synapse

Repository files navigation

Project Synapse ๐Ÿง 

๐ŸŒŸ Multi-Branch Repository: This repository showcases Project Synapse in two complementary implementations:

  • ๐ŸŽ“ educational-simulation: A comprehensive educational simulation with detailed documentation, perfect for understanding multi-agent architecture concepts without running live services.
  • ๐Ÿš€ working-app: A fully functional, production-ready implementation with Docker, Kubernetes, and monitoring. You are currently viewing this branch.

A production-ready multi-agent system showcasing Agent Communication Protocol (ACP) and Model Context Protocol (MCP) capabilities through a collaborative research workflow.

"Where artificial intelligence meets production-grade architecture"

๐ŸŽฏ Project Overview

Project Synapse is a comprehensive multi-agent system built with modern async Python, featuring specialized agents that work together to investigate complex research questions. The system demonstrates advanced patterns in agent communication, secure tool integration, and production deployment practices.

Key Highlights

  • ๐Ÿš€ Production-Ready: Docker containerization with resource management and health monitoring
  • โšก High Performance: Async/await architecture with measured performance metrics
  • ๐Ÿ”’ Security-First: MCP Roots implementation with filesystem access controls
  • ๐Ÿ“Š Observable: Comprehensive logging and real-time monitoring
  • ๐Ÿ—๏ธ Scalable: RabbitMQ message bus with connection pooling

๐ŸŒŸ Architecture Features

Production Infrastructure

Component Technology Performance Status
HTTP Servers FastAPI v0.104.1 1,447 RPS file ops โœ… Optimized
Message Bus RabbitMQ 3.13.7 557 RPS API calls โœ… High Availability
Containerization Docker Compose <131MB per service โœ… Resource Managed
Agent Coordination Async Python 19.8 RPS search ops โœ… Production Ready

Agent Ecosystem

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Orchestrator   โ”‚โ—„โ”€โ”€โ–บโ”‚  Search Agent   โ”‚โ—„โ”€โ”€โ–บโ”‚ Extraction Agentโ”‚
โ”‚  (Coordinator)  โ”‚    โ”‚  (Discovery)    โ”‚    โ”‚  (Processing)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ–ผ                       โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Fact Checker    โ”‚    โ”‚  Synthesis      โ”‚    โ”‚  File Save      โ”‚
โ”‚ (Validation)    โ”‚    โ”‚  (Generation)   โ”‚    โ”‚  (Storage)      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
                                โ–ผ
                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                       โ”‚  Logger Agent   โ”‚
                       โ”‚  (Monitoring)   โ”‚
                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๏ฟฝ Quick Start

Prerequisites

  • Docker and Docker Compose
  • Git

Production Deployment

# Clone the repository
git clone https://github.com/YanCotta/project-synapse.git
cd project-synapse

# Deploy with optimized configuration (includes monitoring)
docker-compose -f docker-compose.optimized.yml up --build

# Monitor system performance
python scripts/monitor_system.py

Kubernetes Deployment

# Deploy to Kubernetes cluster
./k8s/deploy.sh

# Access monitoring
kubectl port-forward svc/grafana 3000:3000
kubectl port-forward svc/prometheus 9090:9090

Development Setup

# Alternative: Local development
pip install -r requirements.txt
python async_main.py

๐Ÿ“Š Performance Metrics

Measured Performance (Production Testing)

Metric Primary Server Filesystem Server RabbitMQ
Response Time 0.9ms avg 0.8ms avg 1.4ms avg
P95 Latency 3.5ms 2.1ms 2.6ms
Throughput 668.4 RPS 882.7 RPS 557 RPS
Success Rate 100% 100% 100%

System Resources

  • Memory Usage: ~131MB per service (optimized)
  • Container Startup: 20-30% faster with optimization
  • Connection Efficiency: 40-60% improvement with pooling
  • Network Isolation: Custom bridge network (172.20.0.0/16)

๐Ÿ—๏ธ System Architecture

Production Infrastructure Stack

Container Orchestration

  • Docker Compose: Multi-service deployment with health checks
  • Resource Limits: CPU and memory constraints for production stability
  • Health Monitoring: Automated health checks with retry mechanisms
  • Network Isolation: Secure service communication

Message Bus (RabbitMQ)

  • High Availability: Production-grade message broker
  • Connection Pooling: Efficient connection reuse
  • Performance Tuning: Memory watermarks and optimization
  • Authentication: Secure credential management

HTTP Infrastructure

  • FastAPI Servers: Async HTTP servers with streaming SSE
  • Connection Pooling: 50 total connections, 10 per host
  • Error Handling: Comprehensive error responses
  • Health Endpoints: Service status monitoring

Security Architecture

MCP Roots Implementation

  • Filesystem Boundaries: Restricted access to approved directories
  • Path Validation: Comprehensive security checks
  • Access Logging: Security event monitoring
  • Error Handling: Secure error responses

๏ฟฝ Configuration Management

Docker Compose Production Configuration

version: '3.8'
services:
  rabbitmq:
    image: rabbitmq:3.13.7-management
    environment:
      RABBITMQ_VM_MEMORY_HIGH_WATERMARK: 0.8
    deploy:
      resources:
        limits: { memory: 512M, cpus: "0.5" }
    healthcheck:
      test: ["CMD", "rabbitmq-diagnostics", "ping"]
      interval: 30s
      timeout: 10s
      retries: 3

Performance Optimization

  • Connection Pooling: 30-second keep-alive with automatic cleanup
  • Resource Limits: Memory and CPU constraints
  • Health Checks: Automated service monitoring
  • Network Optimization: Custom bridge network for isolation

๐Ÿ“ Project Structure

project-synapse/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ agents/              # 7 specialized async agents
โ”‚   โ”‚   โ”œโ”€โ”€ async_orchestrator.py    # Central coordinator
โ”‚   โ”‚   โ”œโ”€โ”€ async_search_agent.py    # Web search capabilities
โ”‚   โ”‚   โ”œโ”€โ”€ async_extraction_agent.py # Content extraction
โ”‚   โ”‚   โ”œโ”€โ”€ async_fact_checker_agent.py # Validation services
โ”‚   โ”‚   โ”œโ”€โ”€ async_synthesis_agent.py  # Report generation
โ”‚   โ”‚   โ”œโ”€โ”€ async_file_save_agent.py  # Secure file operations
โ”‚   โ”‚   โ”œโ”€โ”€ async_logger_agent.py     # System monitoring
โ”‚   โ”‚   โ””โ”€โ”€ async_base_agent.py       # Common agent functionality
โ”‚   โ”œโ”€โ”€ mcp_servers/         # Production MCP servers
โ”‚   โ”‚   โ”œโ”€โ”€ fastapi_primary_server.py    # Web tools with progress
โ”‚   โ”‚   โ””โ”€โ”€ fastapi_filesystem_server.py # Secure file operations
โ”‚   โ”œโ”€โ”€ message_bus/         # RabbitMQ message bus implementation
โ”‚   โ”‚   โ””โ”€โ”€ rabbitmq_bus.py          # Async message routing
โ”‚   โ””โ”€โ”€ protocols/           # Communication schemas
โ”‚       โ”œโ”€โ”€ acp_schema.py        # Agent Communication Protocol
โ”‚       โ””โ”€โ”€ mcp_schemas.py       # Model Context Protocol
โ”œโ”€โ”€ k8s/                     # Kubernetes deployment manifests  
โ”‚   โ”œโ”€โ”€ configmap.yaml          # Environment configuration
โ”‚   โ”œโ”€โ”€ rabbitmq-deployment.yaml # RabbitMQ message broker
โ”‚   โ”œโ”€โ”€ primary-server-deployment.yaml # Primary MCP server
โ”‚   โ”œโ”€โ”€ filesystem-server-deployment.yaml # Filesystem MCP server
โ”‚   โ”œโ”€โ”€ agents-deployment.yaml   # Agent application
โ”‚   โ””โ”€โ”€ deploy.sh               # Deployment automation script
โ”œโ”€โ”€ monitoring/              # Observability and monitoring
โ”‚   โ”œโ”€โ”€ prometheus.yml          # Prometheus configuration
โ”‚   โ”œโ”€โ”€ grafana_dashboard.json  # Pre-built Grafana dashboard
โ”‚   โ”œโ”€โ”€ grafana-datasources.yml # Grafana data source config
โ”‚   โ””โ”€โ”€ grafana-dashboards.yml  # Dashboard provisioning config
โ”œโ”€โ”€ scripts/                 # Performance and monitoring tools
โ”‚   โ”œโ”€โ”€ performance_test.py     # Load testing framework
โ”‚   โ”œโ”€โ”€ optimize_performance.py # Performance optimization
โ”‚   โ”œโ”€โ”€ monitor_system.py       # Real-time monitoring
โ”‚   โ”œโ”€โ”€ health_check.py         # System health validation
โ”‚   โ””โ”€โ”€ integration_test.py     # End-to-end testing
โ”œโ”€โ”€ docs/                    # Comprehensive documentation
โ”‚   โ”œโ”€โ”€ ARCHITECTURE.md         # System architecture guide
โ”‚   โ”œโ”€โ”€ ACP_SPEC.md            # ACP protocol specification
โ”‚   โ””โ”€โ”€ MCP_IN_DEPTH.md        # MCP implementation guide
โ”œโ”€โ”€ docker-compose.optimized.yml # Production deployment
โ”œโ”€โ”€ async_main.py            # System entry point
โ””โ”€โ”€ requirements.txt         # Python dependencies

๐Ÿ”ฌ Technical Documentation

Protocol Specifications

Production Considerations

  • Performance Testing: Load testing with baseline metrics
  • Resource Management: Memory and CPU optimization
  • Health Monitoring: Automated service health checks
  • Security: MCP Roots and access control implementation

๏ฟฝ๏ธ Development Workflow

Performance Testing

# Run performance baseline tests
python scripts/performance_test.py

# Monitor system resources
python scripts/monitor_system.py

# Optimize performance settings
python scripts/optimize_performance.py

Health Monitoring

The system includes comprehensive health monitoring:

  • Service Health: HTTP health endpoints for all services
  • Message Bus Status: RabbitMQ connection and queue monitoring
  • Agent Status: Real-time agent activity tracking
  • Resource Usage: Memory and CPU utilization monitoring

๐ŸŽฏ Use Cases

Research Workflow Automation

The system demonstrates automated research workflows:

  1. Query Processing: Complex research question analysis
  2. Web Search: Distributed search across multiple sources
  3. Content Extraction: Intelligent content processing
  4. Fact Checking: Automated claim validation
  5. Report Synthesis: Comprehensive report generation
  6. Secure Storage: MCP Roots-protected file operations

Agent Coordination Patterns

  • Command & Control: Orchestrator coordinating specialized agents
  • Peer Review: Fact-checking and validation workflows
  • Publish-Subscribe: System-wide event monitoring
  • Request-Response: Sophisticated inter-agent communication

๐Ÿ”ฎ Production Deployment

Scalability Features

  • Horizontal Scaling: Multiple worker processes per service
  • Resource Isolation: Container-based deployment
  • Health Monitoring: Automated failure detection
  • Connection Pooling: Efficient resource utilization

Monitoring and Observability

  • Real-time Metrics: Performance monitoring with baseline comparison
  • Health Dashboards: Service status and resource utilization
  • Error Tracking: Comprehensive error logging and reporting
  • Performance Analytics: Response time and throughput analysis

๐Ÿ“œ License

MIT License - see LICENSE for details.

๐ŸŽฏ Key Features

โœ… Production-Ready: Docker containerization with Kubernetes deployment
โœ… High Performance: Measured metrics with optimization framework
โœ… Secure Architecture: MCP Roots implementation with access controls
โœ… Observable Systems: Prometheus metrics and Grafana dashboards
โœ… Scalable Design: Async architecture with connection pooling
โœ… Complete Documentation: Architecture guides and implementation details
โœ… Production Monitoring: Real-time metrics and alerting capabilities


Deploy a production-grade multi-agent system:

# Docker Compose (recommended for development/testing)
docker-compose -f docker-compose.optimized.yml up --build

# Kubernetes (recommended for production)
./k8s/deploy.sh

Experience the power of async agent coordination with comprehensive monitoring and production-grade deployment. ๐Ÿง โœจ

๐ŸŽ‰ Project Completion Status

๐Ÿš€ PRODUCTION READY - FULLY VALIDATED โœ…

Project Synapse has successfully completed comprehensive development and QA validation:

โœ… Development Milestones Achieved

  • Multi-Agent Architecture: 7 specialized async agents with orchestration
  • Production Infrastructure: Docker containerization with Kubernetes support
  • Message Bus Integration: High-performance RabbitMQ async communication
  • MCP Protocol Implementation: Secure tool integration with progress tracking
  • MLOps Monitoring Stack: Prometheus + Grafana observability
  • Performance Optimization: Resource limits and connection pooling
  • Security Implementation: MCP Roots filesystem access controls
  • Comprehensive Documentation: Complete technical specifications

๐Ÿ”ฌ Quality Assurance Validation

  • Repository Cleanup: โœ… No legacy files or dead code
  • System Integration: โœ… All 6 containers healthy and operational
  • End-to-End Workflows: โœ… Live research workflow completed successfully
  • Monitoring Stack: โœ… Prometheus metrics and Grafana dashboards active
  • Performance Metrics: โœ… Production-grade response times verified

๐Ÿ“Š Final System Metrics

  • Workflow Execution: 4-second end-to-end research processing
  • Container Performance: <131MB memory per optimized service
  • API Response Times: 0.8-0.9ms average latency
  • Message Throughput: 557+ RPS through RabbitMQ
  • Success Rate: 100% operational reliability

View the complete validation results in our System Validation Report


๐Ÿ“š Documentation Links

Core Documentation

Branch Information

About

A production-ready multi-agent system showcasing Agent Communication Protocol (ACP) and Model Context Protocol (MCP) capabilities through a collaborative research workflow.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published