# CAMEL

> Build and study cooperating LLM agents through role-playing conversations

- Category: Agents & Automation / Multi-Agent Systems
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/camel-ai/camel
- Website: https://www.camel-ai.org
- Canonical page: https://ai-tldr.dev/tools/camel/

## In short

CAMEL is an open-source Python framework for building and studying multi-agent systems. It lets you create LLM-driven agents that hold a memory, call tools, and work together through role-playing conversations to complete tasks. It sits in the Multi-Agent Systems category of the Agents & Automation tools and is open-source, written in Python and licensed Apache-2.0.

## Overview

CAMEL is an open-source Python framework for building and studying multi-agent systems. It lets you create LLM-driven agents that hold a memory, call tools, and work together through role-playing conversations to complete tasks. The project grew out of research into how agent behavior changes as you scale the number of agents up.

It is aimed at researchers and developers who want to go beyond a single chatbot and run experiments with many agents, different roles, models, and simulated environments. The same building blocks are also used for practical work like task automation and synthetic data generation.

Within the multi-agent systems category, CAMEL leans toward research and experimentation. It ships agent types, prompts, benchmarks, and tool integrations so you can wire up agents, give them tasks, and observe how they coordinate.

## What it does

- ChatAgent core with stateful memory, so agents keep context across multi-step interactions
- Role-playing societies where two or more agents cooperate to solve a task
- Tool integration through toolkits (for example web search) that agents can call during a step
- Pluggable models via ModelFactory, covering multiple model platforms and types
- Data generation utilities for building structured, synthetic datasets
- Designed to scale toward large agent populations for studying emergent behavior

## Getting started

Install the package with pip, set your model provider API key, then run a single ChatAgent with a tool attached.

1. Install CAMEL

   Install the base package from PyPI. CAMEL requires Python 3.10 or newer (and below 3.15). For web search and other web tools, install the web_tools extra.

```bash
pip install camel-ai
pip install 'camel-ai[web_tools]'
```

2. Set your API key

   CAMEL talks to model providers through environment variables. Export your OpenAI key (or copy .env.example to .env and edit it).

```bash
export OPENAI_API_KEY='your_openai_api_key'
```

3. Run a ChatAgent with a tool

   Create a model, attach a search tool, and call step() to get a response. This is the quick start from the README.

```python
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)

response_2 = agent.step("What is the Github link to CAMEL framework?")
print(response_2.msgs[0].content)
```

## When to use it

- Researching how multi-agent systems behave and coordinate as the number of agents grows
- Automating multi-step tasks by having agents play roles and cooperate through conversation
- Generating structured synthetic datasets for training or evaluating models
- Prototyping tool-using agents that search the web and reason over the results
