Multi-Agent

CAMEL Role-Playing

Have two agents role-play a user-assistant interaction to autonomously complete a task neither could solve alone.

Problem

A single-agent loop has no opposite voice to clarify or push back, and tends to mix goal-setting and execution in the same prompt until both blur. An adversarial debate setup is the wrong shape when what is actually wanted is collaborative role-play, not winning an argument. Without fixed roles and a bounded conversation, two free-form agents drift toward sameness, repeat themselves, and never converge on a working artefact.

Solution

Use inception prompts to instantiate two agents (AI-User and AI-Assistant) with their roles fixed and the task specified. They converse until the task is completed or budget exhausted. The output is the final assistant message; the conversation log is debugging artefact.

When to use

  • The task benefits from explicit user-assistant turn-taking that a single agent loop misses.
  • Inception prompts can fix the two roles and the task tightly enough to keep the conversation on-track.
  • A budget caps the conversation length so unproductive loops terminate.

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related