Skip to main content

CAMEL Agents

Communicative Agents for "Mind" Exploration

中文文档 | English

Architecture • Installation • Quick Start • API Reference


A Python implementation of CAMEL, a framework for building communicative agents that collaborate through role-playing.

Architecture

CAMEL Architecture
│
├── CAMELSociety (Orchestrator)
│   ├── Manages multi-agent collaboration
│   ├── Handles turn-taking between agents
│   └── Tracks conversation progress
│
├── RolePlayingAgent (Agents)
│   ├── Role-based behavior
│   ├── Contextual responses
│   └── Goal-oriented communication
│
├── Conversation (Dialogue Manager)
│   ├── Message history
│   ├── Context formatting
│   └── OpenAI format export
│
└── Types (Data Structures)
    ├── Role - Agent role definition
    ├── Task - Collaborative task
    ├── Message - Single utterance
    └── TaskSpec - Task specification

Core Workflow

┌─────────────────────────────────────────────────────────────────┐
│                    CAMEL Collaboration Flow                      │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│   Task ──▶ Agent 1 (Role A) ◀──▶ Conversation ◀──▶ Agent 2     │
│              │                    │                    │         │
│              │                    │                    │         │
│              ▼                    ▼                    ▼         │
│           Respond              Update              Respond       │
│              │                    │                    │         │
│              └────────────────────┴────────────────────┘         │
│                         (Iterate until done)                     │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Installation

pip install camel-agents

Quick Start

from camel import CAMELSociety, Role, AgentType

# Create society
society = CAMELSociety(verbose=True, max_turns=10)

# Define roles
programmer = Role(
    name="Python Programmer",
    description="Expert Python developer who writes clean code",
    agent_type=AgentType.ASSISTANT
)

reviewer = Role(
    name="Code Reviewer",
    description="Meticulous reviewer ensuring quality",
    agent_type=AgentType.USER
)

# Run collaboration
result = society.collaborate(
    task="Write a function to sort a list",
    agents=[programmer, reviewer]
)

print(f"Success: {result.success}")
print(f"Output: {result.final_output}")
print(result.to_transcript())

Predefined Roles

Role Description
programmer Expert Python programmer
reviewer Code quality reviewer
teacher Educational instructor
student Eager learner
writer Content creator
editor Text quality editor

CLI Usage

# Quick collaboration with predefined roles
camel run "Write a sorting algorithm" --role1 programmer --role2 reviewer

# Interactive mode
camel interactive --role1 teacher --role2 student

# List available roles
camel roles

# Export result
camel run "Task" --export result.json

API Reference

CAMELSociety

Method Description
add_agent(role) Add an agent to the society
collaborate(task, agents) Run collaborative task
quick_collaborate(task, role1, role2) Use predefined roles
get_conversation() Get current conversation
get_agents() Get all agents

RolePlayingAgent

Method Description
respond(message) Generate response as role
introduce() Self-introduction
get_conversation() Get agent's conversation

Academic Reference

Implementation of the CAMEL paper:

CAMEL: Communicative Agents for "Mind" Exploration of Large Language Models

Guohao Li, Hasan Hammoud, Hani Itani, Dmitrii Khizbullin, Bernard Ghanem

NeurIPS 2023

Paper: https://arxiv.org/abs/2303.17760

@inproceedings{li2023camel,
  title={CAMEL: Communicative Agents for "Mind" Exploration of Large Language Models},
  author={Li, Guohao and Hammoud, Hasan and Itani, Hani and Khizbullin, Dmitrii and Ghanem, Bernard},
  booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
  year={2023}
}

License

MIT License


Made with ❤️ by AI Agent Research Team

Metadata

Release files for camel-agents 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for camel-agents 0.1.0
File Size Uploaded Provenance Actions
camel_agents-0.1.0.tar.gz 14.5 kB Without provenance Details for camel_agents-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for camel-agents 0.1.0
File Interpreter ABI Platform Actions
camel_agents-0.1.0-py3-none-any.whl Python 3 none any Details for camel_agents-0.1.0-py3-none-any.whl

Total release size: 27.9 kB

Release files / camel_agents-0.1.0.tar.gz

Download URL camel_agents-0.1.0.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
95782274af70510dff4ceded53f9377d8b64c1931e9a1ec466d041eb9f08170d
BLAKE2b-256 checksum
How to use checksums
a397362865a4f1fbed408753ff7789edc43da73205278ceee2466f14e778e482
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / camel_agents-0.1.0-py3-none-any.whl

Download URL camel_agents-0.1.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53e618671d28dbbd621043d2658328bd76b592d0d7cf48fb22c525a73db7b85b
BLAKE2b-256 checksum
How to use checksums
fa579ba101f9a83c80c1df715c5caa6bb1408d1dd0648ce2bb076fb6e26536b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for camel-agents 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page