{"id":27653439,"url":"https://github.com/LeapLabTHU/cooragent","last_synced_at":"2025-04-24T05:04:11.124Z","repository":{"id":288551753,"uuid":"964650920","full_name":"LeapLabTHU/cooragent","owner":"LeapLabTHU","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-18T16:12:15.000Z","size":1340,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T20:00:48.036Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeapLabTHU.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-11T14:59:45.000Z","updated_at":"2025-04-18T16:12:19.000Z","dependencies_parsed_at":"2025-04-18T20:01:06.692Z","dependency_job_id":"b363a517-a9e2-4bc6-8174-87e93d04c8cf","html_url":"https://github.com/LeapLabTHU/cooragent","commit_stats":null,"previous_names":["leaplabthu/cooragent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeapLabTHU%2Fcooragent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeapLabTHU%2Fcooragent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeapLabTHU%2Fcooragent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeapLabTHU%2Fcooragent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeapLabTHU","download_url":"https://codeload.github.com/LeapLabTHU/cooragent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250566459,"owners_count":21451231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-24T05:01:55.071Z","updated_at":"2025-04-24T05:04:11.114Z","avatar_url":"https://github.com/LeapLabTHU.png","language":"Python","funding_links":[],"categories":["智能体 Agents","Python"],"sub_categories":[],"readme":"# cooragent\n\n[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Wechat](https://img.shields.io/badge/WeChat-cooragent-brightgreen?logo=wechat\u0026logoColor=white)](./assets/wechat_community.jpg)\n[![Discord Follow](https://dcbadge.vercel.app/api/server/ZU6p5nEYgB?style=flat)](https://discord.gg/ZU6p5nEYgB)\n\n[English](./README.md) | [简体中文](./README_zh.md)\n\n# What is Cooragent\n\nCooragent 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.\n\n\n\u003ch5 align=\"center\"\u003e\n\u003cvideo src=\"https://github.com/user-attachments/assets/9af611e3-aed6-4a2f-8663-428a7707fe8d\" width=\"70%\" alt=\"introduce cooragent\" controls\u003e\u003c/video\u003e\n\u003c/h5\u003e\n\n# Infinite Possibilities\nCooragent has two working : **Agent Factory** and **Agent Workflow**.\n- **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.\n- **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.\nCooragent can continuously evolve in these two modes, thus creating infinite possibilities.\n\n# Quick Installation\n\n1. Installation using conda\n```bash\ngit clone https://github.com/LeapLabTHU/cooragent.git\ncd cooragent\n\nconda create -n cooragent python=3.12\nconda activate cooragent\n\npip install -e .\n\n# Optional: If you need to use the browser tool\nplaywright install\n\n# Configure environment\ncp .env.example .env\n# Edit .env file and fill in your API keys\n\npython cli.py\n```\n\n2. Installation using venv\n```bash\ngit clone https://github.com/LeapLabTHU/cooragent.git\ncd cooragent\n\nuv python install 3.12\nuv venv --python 3.12\n\nsource .venv/bin/activate   # For Windows: .venv\\Scripts\\activate\n\nuv sync\n\n# Optional: If you need to use the browser tool\nplaywright install\n\n# Configure environment\ncp .env.example .env\n# Edit .env file and fill in your API keys\n\n# Run the project\nuv run cli.py \n```\n\n## Configuration\n\nCreate a `.env` file in the project root directory and configure the following environment variables:\n\n```bash\n# Note: The Browse tool has a long wait time and is disabled by default. It can be enabled by setting: `USE_BROWSER=True`\n.\ncp .env.example .env\n```\n\n## What Makes Cooragent Different\n\n## Feature Comparison\n\u003ctable style=\"width: 100%;\"\u003e\n  \u003ctr\u003e\n    \u003cth align=\"center\"\u003eFeature\u003c/th\u003e\n    \u003cth align=\"center\"\u003ecooragent\u003c/th\u003e\n    \u003cth align=\"center\"\u003eopen-manus\u003c/th\u003e\n    \u003cth align=\"center\"\u003elangmanus\u003c/th\u003e\n    \u003cth align=\"center\"\u003eOpenAI Assistant Operator\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003eImplementation Principle\u003c/td\u003e\n    \u003ctd align=\"center\"\u003eCollaboration between different Agents based on autonomous Agent creation to complete complex functions\u003c/td\u003e\n    \u003ctd align=\"center\"\u003eImplementation of complex functions based on tool calls\u003c/td\u003e\n    \u003ctd align=\"center\"\u003eImplementation of complex functions based on tool calls\u003c/td\u003e\n    \u003ctd align=\"center\"\u003eImplementation of complex functions based on tool calls\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003eSupported LLMs\u003c/td\u003e\n    \u003ctd align=\"center\"\u003eDiverse\u003c/td\u003e\n    \u003ctd align=\"center\"\u003eDiverse\u003c/td\u003e\n    \u003ctd align=\"center\"\u003eDiverse\u003c/td\u003e\n    \u003ctd align=\"center\"\u003eOpenAI only\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003eMCP Support\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e❌\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e❌\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003eAgent Collaboration\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e❌\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003eMulti-Agent Runtime Support\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e❌\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e❌\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e❌\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003eObservability\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e❌\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e❌\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003eLocal Deployment\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e✅\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e❌\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n# CLI Tools\nCooragent 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.\n\n## Create an Agent with a Single Command using the CLI Tool\nEnter the cooragent command tool interface\n```\npython cli.py\n```\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./assets/cli.png\" alt=\"Cooragent CLI Tool\" /\u003e\n\u003c/p\u003e\n\nCreate a Xiaomi stock analysis agent with a single command\n```\nrun -t agent_factory -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.'\n```\n\n## Edit an Agent\n```\nedit-agent -n \u003cagent_name\u003e -i\n```\n## List Agents\n```\nlist-agents -u \u003cuser-id\u003e -m \u003cregex\u003e\n```\n## Remove an Agent\n```\nremove-agent -n \u003cagent_name\u003e -u \u003cuser-id\u003e\n```\n\n## Use a Group of Agents to Collaboratively Complete Complex Tasks\n```\nrun -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.'\n```\n\n## Create an Agent via MCP\n```python\nserver_params = StdioServerParameters(\n    command=\"python\",\n    args=[str(get_project_root()) + \"/src/mcp/excel_mcp/server.py\"]\n)\n\nasync def excel_agent():\n    async with stdio_client(server_params) as (read, write):\n        async with ClientSession(read, write) as session:\n            # Initialize the connection\n            await session.initialize()\n            # Get tools\n            tools = await load_mcp_tools(session)\n            # Create and run the agent\n            agent = create_react_agent(model, tools)\n            return agent\n\n\nagent = asyncio.run(excel_agent())\nagent_obj = Agent(user_id=\"share\", \n                  agent_name=\"mcp_excel_agent\", \n                  nick_name=\"mcp_excel_agent\", \n                  description=\"The agent is good at manipulating excel files, which includes creating, reading, writing, and analyzing excel files\", \n                  llm_type=LLMType.BASIC, \n                  selected_tools=[], \n                  prompt=\"\")\n\nMCPManager.register_agent(\"mcp_excel_agent\", agent, agent_obj)\n```\nCode can be found at [src/mcp/excel_agent.py](./src/mcp/excel_agent.py)\n\n\n\n## Comprehensive Compatibility\nCooragent 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.\n\n- Deep Compatibility with Langchain Toolchain:\n  - 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.\n  - 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.\n  - 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.\n- Support for MCP (Model Context Protocol):\n  - 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.\n  - 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.\n  - 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.\n- Comprehensive API Call Support:\n  Cooragent's core functions are exposed through comprehensive APIs, providing developers with powerful programmatic control.\n  - Programmatic Management: Through API calls, you can automate the entire lifecycle management of agents, including creation, deployment, configuration updates, start/stop, etc.\n  - Task Integration: Integrate Cooragent's task submission and result retrieval capabilities into your own applications, scripts, or workflow engines.\n  - Status Monitoring and Logging: Obtain real-time operational status, performance metrics, and detailed logs of agents via API for convenient monitoring and debugging.\n  - 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.\n\n\n\n## Contribution\n\nWe 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](CONTRIBUTING.md) to learn how to get started.\n\n## Community Group\nJoin our group on wechat and share your experience with other developers!\n\n\u003cdiv align=\"center\" style=\"display: flex; gap: 20px;\"\u003e\n    \u003cimg src=\"assets/wechat_community.jpg\" alt=\"Cooragent group\" width=\"300\" /\u003e\n\u003c/div\u003e\n\n## Citation\n\nCore contributors: Zheng Wang, Jiachen Du, Shenzhi Wang, Yue Wu, Chi Zhang, Shiji Song, Gao Huang\n\n```\n@misc{wang2025cooragent,\n  title        = {Cooragent: An AI Agent Collaboration Community},\n  author       = {Zheng Wang, Jiachen Du, Shenzhi Wang, Yue Wu, Chi Zhang, Shiji Song, Gao Huang},\n  howpublished = {\\url{https://github.com/LeapLabTHU/cooragent}},\n  year         = {2025}\n}\n```\n\n## Star History\n![Star History Chart](https://api.star-history.com/svg?repos=LeapLabTHU/cooragent\u0026type=Date)\n\n\n\n## Acknowledgments\nSpecial thanks to all the open-source projects and contributors that made cooragent possible. We stand on the shoulders of giants.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeapLabTHU%2Fcooragent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLeapLabTHU%2Fcooragent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeapLabTHU%2Fcooragent/lists"}