camel
エージェント同士の対話から学習データ生成までを一式で扱う研究者向けの基盤。本番の実行基盤ではありません
camelとは
CAMELは、エージェント同士に会話をさせることを出発点にした研究寄りのライブラリです。RolePlayingは指示を出す側と実行する側の2つのエージェントを組ませ、Workforceでは調整役が分割したサブタスクを複数の作業者へ配ります。その周囲には、80を超えるツール群、約50のモデル接続、GAIAやBrowseCompなどのベンチマーク実行環境、対話の記録を微調整用データセットへ変換するパイプラインが揃っています。実験を回す用途ならこの幅広さ自体が強みですが、本番で1つのエージェントを堅実に動かしたいだけなら使わない部分を大量に抱え込むことになりますし、2023年の公開以来バージョンは0.2系のままです。
camelで何ができますか?
- 1つのエージェントに道具を渡して動かす —
ChatAgentにSearchToolkit().get_tools()のような道具の一覧を渡し、agent.step(...)を呼ぶと1往復が進みます。道具の呼び出しと会話履歴の保持は最初から組み込まれているので自前で書く必要はなく、response_formatにPydanticのクラスを指定すれば、返ってくるのは文章ではなく解析済みの構造化データです。 - 指示役と実行役を組ませて話し合わせる —
RolePlayingは、指示を出すAIユーザーと実行するAIアシスタントを組ませ、既定では最初の一手に入る前に課題文をより具体的な形へ書き直します。役割が入れ替わらないのは、双方のシステムプロンプト冒頭に置かれた「役割を入れ替えるな」という指示によるもので、仕組みとして禁じているわけではありません。init_chat()のあとstep()を繰り返して進め、終わり方は自分で決めた往復回数の上限、CAMEL_TASK_DONEという合図、そして会話がトークン上限を超えたときなどにエージェント側が返す終了フラグの3通りです。 - Workforceで作業者を束ねる —
add_single_agent_workerやadd_role_playing_workerで作業者を足し、add_workforceでWorkforce自体を入れ子にもできます。計画役が課題を分割し、調整役が各作業者の説明文を読んで担当を決め、失敗したサブタスクには再実行、再計画、さらなる分割、担当替え、新しい作業者の作成のいずれかで対処します。pause()とresume()で一時停止と再開ができ、save_snapshot()で途中経過も残せるため、人が確認してから続きを進められます。 - ツール群とMCPで外部につなぐ — ウェブ検索、ブラウザ、端末操作、GitHub、Notion、Slack、arXiv、Excelなど80を超えるツール群が同梱され、
FunctionToolは普通のPython関数に添えた説明文をそのまま読み取って道具に変えます。外部のMCPサーバーを使う側に回るときはMCPToolkit、逆に自分が公開する側に回るときは、ツール群ならrun_mcp_server()、ChatAgentやWorkforce全体ならto_mcp()を呼びます。 - 実行の記録を学習用データに変える —
CoTDataGenerator、SelfInstructPipeline、SelfImprovingCoTPipelineが、思考の過程つきの問答や指示文を、微調整にそのまま使えるJSONとして書き出します。答えが正しいかどうかは数学、物理、Python向けの検証器が判定し、1段階および多段階の実験環境は行動ごとに報酬を返すので、強化学習の学習信号としてそのまま使えます。 - 公開ベンチマークで測る —
camel.benchmarksには、GAIA、BrowseComp、APIBank、APIBench、Nexus、RAGBenchを実行する仕組みが入っています。たまたま動いたデモではなく、他者が公表した数値と同じ土俵で自分の構成を比較できます。
camelを選ぶ前に
スター推移
8月17日〜8月28日 · +53
よくある質問
camelは商用利用できますか?
camelはApache-2.0ライセンスで公開されています。OSI承認のオープンソースライセンスで、商用利用が認められています。
camelはどの形で使えますか?
camelはセルフホストの形で利用できます。
ドキュメント
camel-ai/camel のREADMEより転載(Apache-2.0)。 原文を読む ↗
[![Documentation][docs-image]][docs-url] [![Discord][discord-image]][discord-url] [![X][x-image]][x-url] [![Reddit][reddit-image]][reddit-url] [![Wechat][wechat-image]][wechat-url] [![Hugging Face][huggingface-image]][huggingface-url] [![Star][star-image]][star-url] [![Package License][package-license-image]][package-license-url] [![PyPI Download][package-download-image]][package-download-url] [![][join-us-image]][join-us]
Community | Installation | Examples | Paper | Citation | Contributing | CAMEL-AI
Join us (Discord or WeChat) in pushing the boundaries of finding the scaling laws of agents.
🌟 Star CAMEL on GitHub and be instantly notified of new releases.
[![][image-join-us]][join-us]
- CAMEL Framework Design Principles
- Why Use CAMEL for Your Research?
- What Can You Build With CAMEL?
- Quick Start
- Tech Stack
- Research
- Synthetic Datasets
- Cookbooks (Usecases)
- Real-World Usecases
- 🧱 Built with CAMEL (Real-world Producs & Research)
- 🗓️ Events
- Contributing to CAMEL
- Community & Contact
- Citation
- Acknowledgment
- License
CAMEL Framework Design Principles
The framework enables multi-agent systems to continuously evolve by generating data and interacting with environments. This evolution can be driven by reinforcement learning with verifiable rewards or supervised learning.
The framework is designed to support systems with millions of agents, ensuring efficient coordination, communication, and resource management at scale.
Agents maintain stateful memory, enabling them to perform multi-step interactions with environments and efficiently tackle sophisticated tasks.
Every line of code and comment serves as a prompt for agents. Code should be written clearly and readably, ensuring both humans and agents can interpret it effectively.
Why Use CAMEL for Your Research?
We are a community-driven research collective comprising over 100 researchers dedicated to advancing frontier research in Multi-Agent Systems. Researchers worldwide choose CAMEL for their studies based on the following reasons.
What Can You Build With CAMEL?
1. Data Generation
2. Task Automation
3. World Simulation
Quick Start
Installing CAMEL is a breeze thanks to its availability on PyPI. Simply open your terminal and run:
pip install camel-ai
Starting with ChatAgent
This example demonstrates how to create a ChatAgent using the CAMEL framework and perform a search query using DuckDuckGo.
- Install the tools package:
pip install 'camel-ai[web_tools]'
- Set up your OpenAI API key:
export OPENAI_API_KEY='your_openai_api_key'
Alternatively, use a .env file:
cp .env.example .env
# then edit .env and add your keys
- Run the following Python code:
from camel.models import ModelFactory
from camel.types import ModelPlatformType, ModelType
from camel.agents import ChatAgent
from camel.toolkits import SearchToolkit
model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_4O,
model_config_dict={"temperature": 0.0},
)
search_tool = SearchToolkit().search_duckduckgo
agent = ChatAgent(model=model, tools=[search_tool])
response_1 = agent.step("What is CAMEL-AI?")
print(response_1.msgs[0].content)
# CAMEL-AI is the first LLM (Large Language Model) multi-agent framework
# and an open-source community focused on finding the scaling laws of agents.
# ...
response_2 = agent.step("What is the Github link to CAMEL framework?")
print(response_2.msgs[0].content)
# The GitHub link to the CAMEL framework is
# [https://github.com/camel-ai/camel](https://github.com/camel-ai/camel).
- (Optional) Enable model request/response logs:
export CAMEL_MODEL_LOG_ENABLED=true
export CAMEL_MODEL_LOG_MODEL_CONFIG_ENABLED=true
export CAMEL_LOG_DIR=camel_logs
CAMEL_MODEL_LOG_ENABLED: Enables request/response JSON logs.CAMEL_MODEL_LOG_MODEL_CONFIG_ENABLED: Controls whethermodel_config_dictis logged underrequest.model_config_dict. When unset, it defaults to the same value asCAMEL_MODEL_LOG_ENABLED.CAMEL_LOG_DIR: Directory for generated log files (default:camel_logs).- Logs are written as UTF-8 JSON with multilingual text preserved (for example Chinese, Japanese, Arabic) without Unicode escape noise.
For more detailed instructions and additional configuration options, check out the installation section.
After running, you can explore our CAMEL Tech Stack and Cookbooks at docs.camel-ai.org to build powerful multi-agent systems.
We provide a demo showcasing a conversation between two ChatGPT agents playing roles as a python programmer and a stock trader collaborating on developing a trading bot for stock market.
Explore different types of agents, their roles, and their applications.
Seeking Help
Please reach out to us on CAMEL discord if you encounter any issue set up CAMEL.
Tech Stack
Key Modules
Core components and utilities to build, operate, and enhance CAMEL-AI agents and societies.
| Module | Description |
|---|---|
| Agents | Core agent architectures and behaviors for autonomous operation. |
| Agent Societies | Components for building and managing multi-agent systems and collaboration. |
| Data Generation | Tools and methods for synthetic data creation and augmentation. |
| Models | Model architectures and customization options for agent intelligence. |
| Tools | Tools integration for specialized agent tasks. |
| Memory | Memory storage and retrieval mechanisms for agent state management. |
| Storage | Persistent storage solutions for agent data and states. |
| Benchmarks | Performance evaluation and testing frameworks. |
| Interpreters | Code and command interpretation capabilities. |
| Data Loaders | Data ingestion and preprocessing tools. |
| Retrievers | Knowledge retrieval and RAG components. |
| Runtime | Execution environment and process management. |
| Human-in-the-Loop | Interactive components for human oversight and intervention. |
Research
We believe that studying these agents on a large scale offers valuable insights into their behaviors, capabilities, and potential risks.
Explore our research projects:
Research with US
We warmly invite you to use CAMEL for your impactful research.
Rigorous research takes time and resources. We are a community-driven research collective with 100+ researchers exploring the frontier research of Multi-agent Systems. Join our ongoing projects or test new ideas with us, reach out via email for more information.
Synthetic Datasets
1. Utilize Various LLMs as Backends
For more details, please see our Models Documentation.
Data (Hosted on Hugging Face)
| Dataset | Chat format | Instruction format | Chat format (translated) |
|---|---|---|---|
| AI Society | Chat format | Instruction format | Chat format (translated) |
| Code | Chat format | Instruction format | x |
| Math | Chat format | x | x |
| Physics | Chat format | x | x |
| Chemistry | Chat format | x | x |
| Biology | Chat format | x | x |
2. Visualizations of Instructions and Tasks
| Dataset | Instructions | Tasks |
|---|---|---|
| AI Society | Instructions | Tasks |
| Code | Instructions | Tasks |
| Misalignment | Instructions | Tasks |
Cookbooks (Usecases)
Practical guides and tutorials for implementing specific functionalities in CAMEL-AI agents and societies.
1. Basic Concepts
| Cookbook | Description |
|---|---|
| Creating Your First Agent | A step-by-step guide to building your first agent. |
| Creating Your First Agent Society | Learn to build a collaborative society of agents. |
| Message Cookbook | Best practices for message handling in agents. |
2. Advanced Features
| Cookbook | Description |
|---|---|
| Tools Cookbook | Integrating tools for enhanced functionality. |
| Memory Cookbook | Implementing memory systems in agents. |
| RAG Cookbook | Recipes for Retrieval-Augmented Generation. |
| Graph RAG Cookbook | Leveraging knowledge graphs with RAG. |
| Track CAMEL Agents with AgentOps | Tools for tracking and managing agents in operations. |
3. Model Training & Data Generation
| Cookbook | Description |
|---|---|
| Data Generation with CAMEL and Finetuning with Unsloth | Learn how to generate data with CAMEL and fine-tune models effectively with Unsloth. |
| Data Gen with Real Function Calls and Hermes Format | Explore how to generate data with real function calls and the Hermes format. |
| CoT Data Generation and Upload Data to Huggingface | Uncover how to generate CoT data with CAMEL and seamlessly upload it to Huggingface. |
| CoT Data Generation and SFT Qwen with Unsolth | Discover how to generate CoT data using CAMEL and SFT Qwen with Unsolth, and seamlessly upload your data and model to Huggingface. |
このREADMEは一部を省略しています。全文はGitHubにあります。 原文を読む ↗