A comprehensive AI agent management platform that provides multi-agent orchestration, agent building tools, prompt version management, and real-time chat interface. AgentFusion enables you to create, configure, and deploy AI agents through individual agents, group chats, and graph flows with a complete backend infrastructure.
- Multi-Agent Orchestration: Deploy individual agents, group chats, or complex graph flows
- Database Infrastructure: PostgreSQL with SQLAlchemy ORM for persistent data storage
- User Authentication: Complete user management with bcrypt password hashing and activity logging
- Web Interface: Chainlit-powered real-time chat interface with WebSocket support
- MCP Integration: Model Context Protocol support for external tool integration
- Advanced Memory System: Configurable memory models and intelligent context initialization
- Prompt Management: Version-controlled prompt system with built-in optimization agents
- Activity Logging: Comprehensive audit trail for all user actions and system events
- Flexible Configuration: JSON-based configuration system for agents, workflows, and integrations
# Create and activate virtual environment using uv
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
uv pip install -r requirements.txt
# Install the package in development mode
cd python/packages/agent_fusion
uv pip install -e .# Set up PostgreSQL database (production)
# Or use SQLite for testing - automatically configured
# Run database migrations if needed
# Database schema is located in sql/progresdb.sqlCreate a .env file in the project root with your API keys:
DEEPSEEK_API_KEY=your_deepseek_api_key_here
DASHSCOPE_API_KEY=your_aliyun_api_key_here
GEMINI_API_KEY=your_google_api_key_here
# Database configuration (optional - defaults to SQLite for testing)
DATABASE_URL=postgresql://user:password@localhost/agentfusionchainlit run python/packages/agent_fusion/src/chainlit_web/run.pyThe web interface will be available at http://localhost:8000
AgentFusion/
βββ config/ # Configuration files
β βββ prompt/ # Agent prompts organized by type
β β βββ agent/ # Individual agent prompts
β β βββ group_chat/ # Group chat selectors
β β βββ ui_design/ # UI design prompts
β βββ mem/ # Memory configurations
βββ python/packages/agent_fusion/ # Main Python package
β βββ src/
β βββ data_layer/ # Database layer with SQLAlchemy ORM
β β βββ models/ # Business logic models
β β βββ tables/ # Database table definitions
β βββ schemas/ # Pydantic data models
β βββ builders/ # Core builders for agents/workflows
β βββ chainlit_web/ # Web interface with user authentication
β β βββ user/ # User management and authentication
β β βββ ui_hook/ # UI integration hooks
β βββ model_client/ # Model client implementations
β βββ base/ # Base utilities and MCP support
β βββ tools/ # Agent tools and utilities
β βββ dump/ # Configuration export utilities
βββ sql/ # Database schema and migration scripts
βββ config.json # Main configuration file
βββ dumped_config/ # Exported configurations
βββ CLAUDE.md # Project memory and guidelines
βββ requirements.txt # Python dependencies
- Backend: Python 3.11+ with FastAPI + Chainlit
- Database: PostgreSQL (production) / SQLite (testing)
- ORM: SQLAlchemy 2.0 with async support
- Authentication: Custom user authentication with bcrypt
- Agent Framework: AutoGen AgentChat
- Frontend: Chainlit with real-time WebSocket connections
- User Management: User accounts, authentication, and activity logging
- Agent System: Agent configurations and model clients
- Chat System: Threads, steps, elements, and feedback
- Prompt Management: Prompts with version control
- Audit Trail: Comprehensive activity logging with JSONB metadata
- file_system: File and directory operations via MCP
- product_manager: Product requirement documentation
- prompt_refiner: Prompt optimization and refinement
- executor: Task execution specialist
- template_extractor: Extract parameters from prompt templates
- prompt_specialization: Interactive prompt customization
- prompt_flow: Collaborative prompt development workflow
- hil: Human-in-the-loop product management
- prompt_specialization: Template extraction β customization β execution workflow
Agents are defined in config.json under the agents section:
{
"agents": {
"your_agent": {
"name": "your_agent",
"description": "Agent description",
"labels": ["tag1", "tag2"],
"type": "assistant_agent",
"prompt_path": "agent/your_prompt.md",
"model_client": "deepseek-chat_DeepSeek",
"memory_model_client": "gemini-2.5-flash-preview-04-17_Google",
"mcp_tools": ["file_system"]
}
}
}{
"group_chats": {
"your_group": {
"name": "your_group",
"description": "Group description",
"type": "selector_group_chat",
"selector_prompt": "group_chat/your_selector.md",
"model_client": "deepseek-chat_DeepSeek",
"participants": ["agent1", "agent2", "human_proxy"]
}
}
}{
"graph_flows": {
"your_flow": {
"name": "your_flow",
"description": "Workflow description",
"type": "graph_flow",
"participants": ["agent1", "agent2"],
"nodes": [
["agent1", "agent2"],
["agent2", {"condition": "agent1"}]
],
"start_node": "agent1"
}
}
}Use the dump utilities to export your configuration:
from dump import dump_agents, dump_group_chats
# Export specific components
dump_agents(["file_system"], "dumped_config")
dump_group_chats(["prompt_flow"], "dumped_config")# Run tests
python -m pytest python/packages/agent_fusion/tests/ -v
# Test specific model
python -m pytest python/packages/agent_fusion/tests/test_user_model.py -v- Create a prompt file in
config/prompt/agent/ - Add agent configuration to
config.json - Update database models if needed (data_layer/models/)
- Add tests for new functionality
- Test via the web interface
- Update SQL schema in
sql/progresdb.sql - Update SQLAlchemy models in
data_layer/models/tables/ - Update business logic models in
data_layer/models/ - Add comprehensive tests
Define MCP servers in the mcpServers section of config.json:
{
"mcpServers": {
"your_tool": {
"command": "your_command",
"args": ["arg1", "arg2"],
"env": {},
"read_timeout_seconds": 30
}
}
}- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Update tests and documentation
- Submit a pull request
MIT License - see LICENSE file for details
Built on top of AutoGen - a powerful framework for multi-agent AI applications. Special thanks to the AutoGen team for their pioneering work in multi-agent orchestration.
- Create an issue for bug reports or feature requests
- Check the documentation in the
config/prompt/directory for prompt examples - Review
config.jsonfor configuration patterns