Skip to content

Self-hosted, open-source swarm of AI agents for end-to-end research on arbitrary topics using CrewAI orchestration, LLMLingua prompt compression, and dynamic MCP integration. Features specialized research agents, cost-optimized workflows, and runtime tool discovery for comprehensive automated research systems.

License

Notifications You must be signed in to change notification settings

simplemindedbot/crewai-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Agent Swarm Research System

Verified on MSeeP

πŸ€– Self-hosted, open-source swarm of AI agents for end-to-end research on arbitrary topics

A sophisticated multi-agent research system built with CrewAI orchestration, LLMLingua prompt compression, and dynamic MCP (Model Context Protocol) integration for cost-effective, extensible AI research workflows.

πŸš€ Overview

This project enables autonomous research teams of AI agents to collaborate on complex research tasks. The system automatically discovers sources, summarizes findings, validates information, and produces comprehensive research reports while minimizing token costs through intelligent prompt compression.

Key Features

  • 🎯 Multi-Agent Orchestration: Specialized agents (Researcher, Summarizer, Validator, Coordinator) work in coordinated workflows
  • 🧠 Enhanced Memory System: Vector embeddings with semantic search for cross-agent knowledge sharing
  • πŸ’° Cost Optimization: LLMLingua compression reduces token usage by 50%+ with minimal quality impact
  • πŸ”§ Dynamic Tool Integration: MCP protocol enables runtime addition of new tools and services
  • πŸ“Š Research Intelligence: End-to-end research workflows with fact-checking and validation
  • πŸ”„ Memory Persistence: Agents maintain context and learn across research sessions with FAISS-powered semantic search
  • πŸ“ˆ Monitoring & Metrics: Built-in token usage, latency, and accuracy tracking

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 Coordinator                β”‚
β”‚             (CrewAI Orchestrator)          β”‚
β”‚  β€’ Manages Shared State & Memory           β”‚
β”‚  β€’ Dispatches Research/Summarizer/         β”‚
β”‚    Validator Agents                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚             Agent Middleware               β”‚
β”‚  β€’ LLMLingua PromptCompressor              β”‚
β”‚  β€’ MCP Client Adapter                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  LLM API  β”‚  MCP Server   β”‚  External APIs β”‚
β”‚ (GPT, etc)β”‚ (any protocol)β”‚ (web, DB, etc) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

  • Orchestration: CrewAI - Multi-agent coordination and task management
  • Compression: LLMLingua - Intelligent prompt compression
  • Tool Protocol: MCP - Dynamic tool discovery and integration
  • Language: Python 3.10+ with UV dependency management
  • Memory: Vector embeddings with FAISS and sentence-transformers for semantic search
  • Monitoring: Prometheus metrics and observability

🚦 Current Status

Phase: Multi-Agent Architecture βœ…
Current Sprint: Sprint 2 Complete - Multi-Agent Research Workflow
Next Milestone: LLMLingua prompt compression integration (Sprint 3)

Working Features

  • βœ… Multi-Agent Research System: ResearcherAgent, SummarizerAgent, ValidatorAgent, CoordinatorAgent
  • βœ… Sequential Workflow: Researcher β†’ Summarizer β†’ Validator β†’ Coordinator with task dependencies
  • βœ… Enhanced Memory Store: Vector embeddings with FAISS for semantic search and cross-agent memory sharing
  • βœ… Cross-Agent Recall: Agents can access facts and context from other agents across task executions
  • βœ… Comprehensive Testing: Automated tests for memory persistence, cross-agent recall, and semantic search
  • βœ… YAML Configuration: Flexible agent and task configuration system
  • βœ… CI/CD Pipeline: Automated testing, linting, and quality assurance
  • βœ… Memory Analytics: Detailed analytics for embeddings, agent distribution, and memory usage

Development Progress (14-week roadmap)

  • βœ… Sprint 1: CI pipeline and memory persistence
  • βœ… Sprint 2: Multi-agent flows with enhanced memory system
  • πŸ“‹ Sprint 3: LLMLingua prompt compression integration
  • πŸ“‹ Sprint 4: MCP dynamic tool loading
  • πŸ“‹ Sprint 5: Runtime tool discovery and failover
  • πŸ“‹ Sprint 6: Complete research workflow automation
  • πŸ“‹ Sprint 7: Production deployment and monitoring

πŸš€ Quick Start

Prerequisites

  • Python 3.10+ (3.14 max)
  • OpenAI API key or compatible LLM API
  • UV package manager

Installation

# Clone the repository
git clone https://github.com/simplemindedbot/crewai-test.git
cd crewai-test

# Install dependencies
crewai install
# or: pip install uv && uv sync

# Configure environment
cp .env.example .env
# Add your OPENAI_API_KEY to .env

Basic Usage

# Run the research crew
crewai run

# Alternative entry points
crewai_test
run_crew

# Training and testing
train <iterations> <filename>
test <iterations> <eval_llm>
replay <task_id>

Example Research Flow

The system currently researches "AI LLMs" by default and produces a detailed markdown report. You can customize the research topic by modifying the inputs in src/crewai_test/main.py.

Sprint 2: Multi-Agent Research Demo

Test the complete multi-agent research workflow:

# Set up environment
export $(cat .env | xargs)
cd crewai_test

# Run multi-agent research crew
PYTHONPATH=src python src/crewai_test/research_main.py "artificial intelligence trends"

# Test enhanced memory system
PYTHONPATH=src python src/crewai_test/test_enhanced_memory.py

# Test cross-agent fact recall
PYTHONPATH=src python src/crewai_test/test_cross_agent_recall.py

The multi-agent system demonstrates:

  • βœ… Four specialized agents working in sequence
  • βœ… Enhanced memory with vector embeddings and semantic search
  • βœ… Cross-agent memory sharing and fact recall
  • βœ… Comprehensive research workflow from discovery to final report

Sprint 1: Echo Agent Demo

For basic functionality testing:

# Test basic echo functionality
export $(cat .env | xargs)
cd crewai_test
PYTHONPATH=src python src/crewai_test/echo_main.py "Hello, World!"

# Test memory persistence across sessions
PYTHONPATH=src python src/crewai_test/test_memory_persistence.py

πŸ“‚ Project Structure

crewai_test/
β”œβ”€β”€ src/crewai_test/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ agents.yaml          # Basic agent role definitions
β”‚   β”‚   β”œβ”€β”€ agents_research.yaml # Multi-agent research configuration
β”‚   β”‚   β”œβ”€β”€ agents_echo.yaml     # Echo agent for testing
β”‚   β”‚   β”œβ”€β”€ tasks.yaml           # Basic task configurations
β”‚   β”‚   β”œβ”€β”€ tasks_research.yaml  # Multi-agent research tasks
β”‚   β”‚   └── tasks_echo.yaml      # Echo tasks for testing
β”‚   β”œβ”€β”€ crew.py                  # Basic crew orchestration
β”‚   β”œβ”€β”€ research_crew.py         # Multi-agent research crew
β”‚   β”œβ”€β”€ echo_crew.py            # Echo agent for testing
β”‚   β”œβ”€β”€ memory_store.py         # Basic memory persistence
β”‚   β”œβ”€β”€ enhanced_memory_store.py # Vector embeddings memory system
β”‚   β”œβ”€β”€ main.py                 # Entry points and CLI
β”‚   β”œβ”€β”€ research_main.py        # Multi-agent research entry point
β”‚   β”œβ”€β”€ test_enhanced_memory.py # Enhanced memory system tests
β”‚   β”œβ”€β”€ test_cross_agent_recall.py # Cross-agent memory tests
β”‚   └── tools/                  # Custom tools and integrations
β”œβ”€β”€ DEVPLAN.md                  # 14-week development roadmap
β”œβ”€β”€ SPRINT1.md                  # Sprint 1 detailed breakdown
β”œβ”€β”€ SPRINT2.md                  # Sprint 2 detailed breakdown
β”œβ”€β”€ MEMORY_PERSISTENCE.md       # Memory system documentation
β”œβ”€β”€ CLAUDE.md                   # Project documentation for AI assistants
└── README.md                   # This file

🎯 Development Roadmap

Our comprehensive development plan spans 14 weeks across 7 focused sprints:

Sprint Focus Area Timeline Status Key Deliverables
1 Foundation Setup 2 weeks βœ… Complete CI/CD, Memory Persistence
2 Agent Architecture 2 weeks βœ… Complete Multi-agent Workflows, Enhanced Memory
3 Cost Optimization 2 weeks πŸ“‹ Planned LLMLingua Integration
4 Tool Extensibility 2 weeks πŸ“‹ Planned MCP Client Integration
5 Dynamic Discovery 2 weeks πŸ“‹ Planned Runtime Tool Loading
6 Research Automation 2 weeks πŸ“‹ Planned End-to-end Workflows
7 Production Ready 2 weeks πŸ“‹ Planned Testing & Deployment

🀝 Contributing

We welcome contributions! Please see our GitHub Issues for current development priorities.

Development Setup

# Clone and setup development environment
git clone https://github.com/simplemindedbot/crewai-test.git
cd crewai-test
crewai install

# Run tests (when available)
pytest

# Code formatting
black src/
isort src/

πŸ“„ License

This project is open source and available under the MIT License.

πŸ”— Related Projects

πŸ“§ Contact & Support


MseeP.ai Security Assessment Badge

Built with ❀️ for the AI research community

About

Self-hosted, open-source swarm of AI agents for end-to-end research on arbitrary topics using CrewAI orchestration, LLMLingua prompt compression, and dynamic MCP integration. Features specialized research agents, cost-optimized workflows, and runtime tool discovery for comprehensive automated research systems.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages