Skip to content

loujohn/cooragent

 
 

Repository files navigation

cooragent

Python 3.12+ Wechat Discord Follow

English | 简体中文

What is Cooragent

Cooragent is an AI agent collaboration community. In this community, you can create powerful agents with a single sentence and collaborate with other agents to complete complex tasks. Agents can be freely combined, creating infinite possibilities. At the same time, you can also publish your agents to the community and share them with others.

introduce_cooragent.mp4

Infinite Possibilities

Cooragent has two working mode : Agent Factory and Agent Workflow.

  • Agent Factory : You only need to describe the agent, and Cooragent will generate an agent based on your needs. In Agent Factory mode, the system automatically analyzes user requirements and gains a deep understanding of the user through memory and expansion, eliminating the need for complex Prompt design. Based on a deep understanding of user needs, the Planner selects appropriate tools, automatically refines the Prompt, and gradually completes the agent construction. After construction, the agent can be used immediately, but you can still edit it to optimize its behavior and functionality.
  • Agent Workflow : You only need to describe the target task you want to complete, and Cooragent will automatically analyze the task requirements and select suitable agents for collaboration. The Planner combines agents based on their areas of expertise, plans the task steps and completion order, and then hands over the task to the task distribution node 'publish' for task release. Each agent receives its own task and collaborates to complete it. Cooragent can continuously evolve in these two modes, thus creating infinite possibilities.

Quick Installation

  1. Installation using conda
git clone https://github.com/LeapLabTHU/cooragent.git
cd cooragent

conda create -n cooragent python=3.12
conda activate cooragent

pip install -e .

# Optional: If you need to use the browser tool
playwright install

# Configure environment
cp .env.example .env
# Edit .env file and fill in your API keys

python cli.py
  1. Installation using venv
git clone https://github.com/LeapLabTHU/cooragent.git
cd cooragent

uv python install 3.12
uv venv --python 3.12

source .venv/bin/activate   # For Windows: .venv\Scripts\activate

uv sync

# Optional: If you need to use the browser tool
playwright install

# Configure environment
cp .env.example .env
# Edit .env file and fill in your API keys

# Run the project
uv run cli.py 

Note: If running the project's CLI tool on Windows, besides the steps above, you also need to install additional dependencies. For details, please refer to Windows Platform Support.

Configuration

Create a .env file in the project root directory and configure the following environment variables:

# Note: The Browse tool has a long wait time and is disabled by default. It can be enabled by setting: `USE_BROWSER=True`
cp .env.example .env

What Makes Cooragent Different

Feature Comparison

Feature cooragent open-manus langmanus OpenAI Assistant Operator
Implementation Principle Collaboration between different Agents based on autonomous Agent creation to complete complex functions Implementation of complex functions based on tool calls Implementation of complex functions based on tool calls Implementation of complex functions based on tool calls
Supported LLMs Diverse Diverse Diverse OpenAI only
MCP Support
Agent Collaboration
Multi-Agent Runtime Support
Observability
Local Deployment

CLI Tools

Cooragent provides a series of developer tools to help developers quickly build agents. Through the CLI tools, developers can quickly create, edit, and delete agents. The CLI is designed for efficiency and ease of use, significantly reducing the tediousness of manual operations and allowing developers to focus more on the design and optimization of the agents themselves.

Create an Agent with a Single Command using the CLI Tool

Enter the cooragent command tool interface

python cli.py

Cooragent CLI Tool

Create a Xiaomi stock analysis agent with a single command

run -t agent_workflow -u test -m 'Create a stock analysis expert agent to analyze the Xiaomi stock trend, today is 22 April, 2025, look over the past month, analyze the big news about Xiaomi, then predict the stock price trend for the next trading day, and provide buy or sell recommendations.'

Edit an Agent

edit-agent -n <agent_name> -i

List Agents

list-agents -u <user-id> -m <regex>

Remove an Agent

remove-agent -n <agent_name> -u <user-id>

Use a Group of Agents to Collaboratively Complete Complex Tasks

run -t agent_workflow -u test -m 'Use the task planning agent, web crawler agent, code execution agent, browser operation agent, report writing agent, and file operation agent to plan a trip to Yunnan for the May Day holiday in 2025. First, run the web crawler agent to fetch information about Yunnan tourist attractions, use the browser operation agent to browse the attraction information and select the top 10 most worthwhile attractions. Then, plan a 5-day itinerary, use the report writing agent to generate a travel report, and finally use the file operation agent to save the report as a PDF file.'

Integrate MCP Services (like Claude Desktop)

Enhance your Agents by integrating external services and tools via the Model Context Protocol (MCP). This is similar to how desktop AI assistants like Claude Desktop manage external functionalities.

Configuration:

  1. Locate/Create Config File: Find or create config/mcp.json in your project root.

    cd ./config
    cp mcp.json.example mcp.json
  2. Add MCP Services: Define your MCP services in this JSON file. Each service has a unique key and a configuration object.

    Example (config/mcp.json):

    {
        "mcpServers": {
          "aws-kb-retrieval": {
            "command": "npx",
            "args": ["-y", "@modelcontextprotocol/server-aws-kb-retrieval"],
            "env": {
              "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_HERE",
              "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY_HERE",
              "AWS_REGION": "YOUR_AWS_REGION_HERE"
            }
          },
          "AMAP": {
            "url": "https://mcp.amap.com/sse",
            "env": {
              "AMAP_MAPS_API_KEY": "AMAP_MAPS_API_KEY"
            }
          }
        }
    }

How it Works:

Once configured, Cooragent registers these MCP services as available tools. Agents can then select and use these tools during task planning and execution, enabling more complex functionalities. After configuration of AMAP mcpServers (GaoDe Map) as the example, you may be able to run the case below:

Create a navigation agent that focuses on navigation and uses map-related tools to plan the route from Beijing West Railway Station to the Forbidden City.

Documentation & Support

Comprehensive Compatibility

Cooragent is designed with extreme openness and compatibility in mind, ensuring seamless integration into the existing AI development ecosystem and providing maximum flexibility for developers. This is mainly reflected in its deep compatibility with the Langchain toolchain, support for the MCP (Model Context Protocol) protocol, and comprehensive API calling capabilities.

  • Deep Compatibility with Langchain Toolchain:
    • You can directly use familiar Langchain components within Cooragent's agents or workflows, such as specific Prompts, Chains, Memory modules, Document Loaders, Text Splitters, and Vector Stores. This allows developers to fully leverage the rich resources and existing code accumulated by the Langchain community.
    • Smooth Migration and Integration: If you already have applications or components developed based on Langchain, you can more easily migrate or integrate them into the Cooragent framework, enhancing them with Cooragent's collaboration, scheduling, and management capabilities.
    • Beyond Basic Compatibility: Cooragent is not only compatible with Langchain but also offers advanced features built upon it, such as Agent Factory, Agent Workflow, and native A2A communication, aiming to provide a more powerful and user-friendly agent building and collaboration experience. You can use Langchain as a powerful toolkit within the Cooragent framework.
  • Support for MCP (Model Context Protocol):
    • Standardized Interaction: MCP defines a set of specifications for agents to exchange information, state, and context, making it easier for agents built by different sources and developers to understand each other and collaborate.
    • Efficient Context Management: Through MCP, context information across multiple agents or multi-turn interactions can be managed and transferred more effectively, reducing information loss and improving the efficiency of complex task processing.
    • Enhanced Interoperability: Support for MCP enables Cooragent to better interoperate with other systems or platforms that follow the protocol, building a broader and more powerful intelligent ecosystem.
  • Comprehensive API Call Support: Cooragent's core functions are exposed through comprehensive APIs, providing developers with powerful programmatic control.
    • Programmatic Management: Through API calls, you can automate the entire lifecycle management of agents, including creation, deployment, configuration updates, start/stop, etc.
    • Task Integration: Integrate Cooragent's task submission and result retrieval capabilities into your own applications, scripts, or workflow engines.
    • Status Monitoring and Logging: Obtain real-time operational status, performance metrics, and detailed logs of agents via API for convenient monitoring and debugging.
    • Build Custom Interfaces: Using the API, you can build custom front-end user interfaces or management backends for Cooragent to meet specific business needs and user experiences.

Cooragent Roadmap

✨ Accuracy Improvement

Enhancing the accuracy and reliability of agent outputs. Introduce more robust critique mechanisms, utilizing multi-turn validation and feedback to ensure the quality of generated results and reduce errors and inconsistencies.

🎯 Vertical Scene Support

Build targeted Agent Workflows to meet the needs of specific industries. Support vertical domains such as education and news summarization.Providing customized solutions to improve effectiveness in specific scenarios.

👁️ Multimodal Agent Support

Expand the capabilities of Agents to handle and understand multiple types of information. The primary goal is to add support for visual information, enabling Agents to analyze image content and lay the foundation for broader application scenarios.

👥 Community Engagement Enhancement

Enhance interaction methods within the Agent community. This may include an Agent sharing marketplace, collaborative challenges, and other initiatives aimed at encouraging users to share, discover, and collectively improve Agents.

ToDoList to be coming soon

  • MCP Scaling Up
    More MCP Server/Tool test and support in Cooragent

  • SandBox Support
    Use Daytona to support sandbox for python and shell

  • Visualized drag/drop workflow editing
    Provide visual workflow editing capabilities, allowing users to edit workflows quickly and accurately through drag and drop operations.

  • Long Memmory Support:
    Use Redis and Vector Base to remember Long Memory of User .

Contribution

We welcome contributions of all forms! Whether it's fixing typos, improving documentation, or adding new features, your help will be greatly appreciated. Please check out our contribution guidelines to learn how to get started.

Community Group

Join our group on wechat and share your experience with other developers!

Cooragent group

Citation

Core contributors: Zheng Wang, Jiachen Du, Shenzhi Wang, Yue Wu, Chi Zhang, Shiji Song, Gao Huang

@misc{wang2025cooragent,
  title        = {Cooragent: An AI Agent Collaboration Community},
  author       = {Zheng Wang, Shenzhi Wang, Yue Wu, Chi Zhang, Shiji Song, Gao Huang},
  howpublished = {\url{https://github.com/LeapLabTHU/cooragent}},
  year         = {2025}
}

Star History

Star History Chart

Acknowledgments

Special thanks to all the open-source projects and contributors that made cooragent possible. We stand on the shoulders of giants.

About

Official Repository of Cooragent

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.9%
  • Other 1.1%