Frameworks

CAMEL Multi-Agent Framework in Practice: Role-Playing Before It Was Cool

With 17.6k GitHub stars, CAMEL-AI was an early multi-agent framework that let two agents collaborate through role-playing prompts without hand-orchestrated workflows. Here's how it works, where it shines, and how it stacks up against AutoGen, CrewAI, and LangGraph.

Font size

GitHub's CAMEL-AI sits at 17.6k stars and ranks among the earliest projects that turned "multi-agent collaboration" into runnable code. It introduced the Role-Playing paradigm back in 2023, ahead of AutoGen and CrewAI.

The core idea is straightforward: stop hard-coding workflows. Let two agents talk to each other. One plays the user with a need; the other plays the assistant solving it. No human in the loop.

I installed the package and ran the bundled stock_trading example. Here's the breakdown.

The Problem It Solves

In 2023, the dominant pattern was scripting a fixed agent pipeline:

Input → LLM call → Tool call → Output

Change the task, rewrite the code. Every conversational step required upfront orchestration.

CAMEL flipped this: stuff the task description into the prompt and let agents decide what comes next. Two agents assume roles (a User-Agent posing requirements, an Assistant-Agent delivering solutions) and kick off self-driven dialogue through Inception Prompting.

The paradigm's real contribution isn't the framework itself; it's that it dragged "multi-agent collaboration" from a paper concept into executable code. You can spot CAMEL's fingerprints in CrewAI's role definitions and AutoGen's GroupChat.

Getting Started

Install:

pip install camel-ai

A minimal working example, two agents discussing stock investing:

from camel.agents import ChatAgent
from camel.messages import BaseMessage
from camel.models import ModelFactory
from camel.types import ModelPlatformType

# 1. Configure the model (swap in your own API key)
model = ModelFactory.create(
    model_platform=ModelPlatformType.OPENAI,
    model_type="gpt-4o-mini",
    api_key="YOUR_KEY",
)

# 2. Spin up two agents with opposing roles
user_agent = ChatAgent(system_message="You're a novice stock trader looking to learn investing", model=model)
assistant_agent = ChatAgent(system_message="You're a seasoned stock trader; answer professionally", model=model)

# 3. Self-driven conversation for three rounds
task = "I want to build a balanced stock portfolio with moderate risk"
print(f"Task: {task}\n")

msg = BaseMessage.make_user_message(role_name="Novice", content=task)
for i in range(3):
    # Assistant responds
    resp_a = assistant_agent.step(msg)
    print(f"[Trader]: {resp_a.msg.content[:150]}...\n")
    # Novice follows up
    resp_u = user_agent.step(resp_a.msg)
    print(f"[Novice]: {resp_u.msg.content[:150]}...\n")
    msg = resp_u.msg

Want to swap in DeepSeek? Replace ModelPlatformType.OPENAI with ModelPlatformType.DEEPSEEK and model_type with deepseek-chat. CAMEL ships adapters for multiple providers.

How It Works (Architecture)

Three layers:

1. Role-Playing Framework

Two agents drive a task to completion through conversation. No external orchestration is needed; the dialogue itself is the control flow. The User-Agent raises requirements, the Assistant-Agent delivers solutions, and the two take turns pushing things forward.

2. Inception Prompting

The core mechanism. Meta-instruction prompts that tell agents who they are, what they're doing, and what to avoid. Example:

You are a trader. Your task is to answer a beginner's questions about stock investing.
Keep answers professional and concise, under 100 words.
If a question is unclear, ask for clarification rather than guessing.

This style of prompting dramatically cuts down on manual orchestration overhead. Once agents receive their Inception Prompt, they run with it; humans only define roles and termination conditions.

3. Ecosystem Layer

CAMEL extends well beyond two-agent chats. Notable modules:

  • WorkForce — an industrial-grade implementation of multi-agent collaboration, covering task distribution and result aggregation.
  • OASIS — social media simulation that models Twitter / Reddit behavior with thousands of agents.
  • Embodied Agents — agents that operate browsers or game characters.

The official site at camel-ai.org has the full documentation, though it takes some digging to find.

Strengths and Weaknesses

Comparison against mainstream frameworks:

DimensionCAMELAutoGenCrewAILangGraph
ParadigmRole-PlayingGroupChatRole-BasedGraph Orchestration
Learning CurveMediumMediumLowHigh
DocumentationScatteredAverageClearClear
Production UseLimitedManyManyMany
Academic DepthHighMediumLowMedium
FlexibilityMediumMediumMediumHigh

CAMEL's Strengths

  • Pioneer of the Role-Playing paradigm, with strong academic roots.
  • 17.6k stars indicate a sizable community.
  • Rich ecosystem modules (OASIS, WorkForce) make it useful for research.

CAMEL's Weaknesses

  • Documentation is scattered; the README is thin.
  • API changes frequently; older code breaks often.
  • Few production case studies; troubleshooting is on you.
  • Feels more like "a paper's code appendix" than "a product for engineers."

CrewAI and AutoGen overtook CAMEL in community mindshare mainly because of onboarding friction. CrewAI's README gets you running on page one; CAMEL doesn't.

Hands-On Test

I installed camel-ai locally and ran the stock_trading example.

Observed Metrics

  • Three conversation rounds consumed roughly 2k tokens (system messages ate most of it).
  • Per-round latency was about 5–7 seconds on gpt-4o-mini.
  • Default model config doesn't work out of the box; you'll hit a Model not found error and have to manually adjust model_platform and model_type.

One observation: after three rounds, the two agents tend to fall into a "mutual acknowledgment" loop. The User-Agent asks, the Assistant answers, the User-Agent says "thanks," and the conversation stalls. Termination conditions need to be more explicit.

The code runs, and the API design is reasonable. For production use, you'll need to wire up your own monitoring and logging.

Who Should Use It

Good fit for:

  • Researchers studying multi-agent behavior or emergent phenomena.
  • Anyone building social simulations (via OASIS).
  • Teaching scenarios that demonstrate agent collaboration principles.
  • People tracing the origins of the Role-Playing paradigm.

Not a good fit for:

  • Production environments, given weak docs and shaky API stability.
  • Complex workflow orchestration. LangGraph is more flexible.
  • Single-agent use cases. Stick with LangChain.

Editorial Take

CAMEL's most ambitious proposition is Finding the Scaling Law of Agents, not scaling a single agent's capability, but scaling the number of agents, interaction rounds, and heterogeneity.

This runs parallel to the chain-of-thought scaling explored by OpenAI o1 and DeepSeek-R1: both ask "along which axis does an intelligent system scale to buy performance?" The difference is that CAMEL swaps "model parameters / reasoning steps" for "agent count and interaction complexity."

How it differs from prior art: CAMEL predates AutoGen by roughly six months and CrewAI by about a year. It proved that "two agents chatting" could complete a full task rather than staying stuck in academic demos. What it didn't do was turn that into a product, with rough docs, a fast-moving API, and weak community operations. AutoGen (with Microsoft's backing) and CrewAI (as a fast-following upstart) overtook it through better engineering.

Contrarian take: CAMEL's real value isn't the framework; it's the paradigm it left behind. Strip away CrewAI's role definitions or AutoGen's GroupChat and you'll find the logic CAMEL validated. Frameworks get replaced; paradigms get inherited.

Caveat: I couldn't verify current activity levels. Commit frequency and issue response times would need a closer look. Given the 17.6k stars and doc state, the project may be in maintenance rather than high-velocity iteration. If you're considering production use, run the current examples first to check for breaking changes.

References:

Source: https://github.com/camel-ai/camel