Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

chore: update cookbook index

Wendong01957d0b29f9
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 5c972b047..82170f375 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -33,6 +33,6 @@ repos:
rev: v2.4.1
hooks:
- id: codespell
- exclude: ^(examples/usecases/) # Ignore files under examples/usecases
+ exclude: ^(examples/usecases/|docs/cookbooks/) # Ignore files under examples/usecases and docs/cookbooks
additional_dependencies:
- tomli # for python_version < '3.11'
\ No newline at end of file
diff --git a/docs/cookbooks/mcp/index.rst b/docs/cookbooks/mcp/index.rst
index b758ec86e..0e250fa40 100644
--- a/docs/cookbooks/mcp/index.rst
+++ b/docs/cookbooks/mcp/index.rst
@@ -9,3 +9,4 @@ MCP Cookbooks
agents_with_sql_mcp.ipynb
camel_aci_mcp_cookbook.ipynb
+ agent_to_mcp_with_faiss.ipynb
diff --git a/docs/cookbooks/multi_agent_society/azure_openai_claude_society.ipynb b/docs/cookbooks/multi_agent_society/azure_openai_claude_society.ipynb
index 05119e4b8..1e9e9b6c0 100644
--- a/docs/cookbooks/multi_agent_society/azure_openai_claude_society.ipynb
+++ b/docs/cookbooks/multi_agent_society/azure_openai_claude_society.ipynb
@@ -1,31 +1,20 @@
{
- "nbformat": 4,
- "nbformat_minor": 0,
- "metadata": {
- "colab": {
- "provenance": []
- },
- "kernelspec": {
- "name": "python3",
- "display_name": "Python 3"
- },
- "language_info": {
- "name": "python"
- }
- },
"cells": [
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "oHO_dChM-Ykl"
+ },
"source": [
"# 🍳 CAMEL Cookbook: Building a Collaborative AI Research Society\n",
"## Claude 4 + Azure OpenAI Collaboration for ARENA AI Alignment Research"
- ],
- "metadata": {
- "id": "oHO_dChM-Ykl"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "jHGN9nIv-bIf"
+ },
"source": [
"<div class=\"align-center\">\n",
" <a href=\"https://www.camel-ai.org/\"><img src=\"https://i.postimg.cc/KzQ5rfBC/button.png\"width=\"150\"></a>\n",
@@ -33,113 +22,62 @@
" \n",
"⭐ <i>Star us on [*Github*](https://github.com/camel-ai/camel), join our [*Discord*](https://discord.camel-ai.org) or follow our [*X*](https://x.com/camelaiorg)\n",
"</div>"
- ],
- "metadata": {
- "id": "jHGN9nIv-bIf"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "QSGuiwh--6ce"
+ },
"source": [
"## 📋 Overview\n",
"\n",
"This cookbook demonstrates how to create a collaborative multi-agent society using CAMEL-AI, bringing together Claude 4 and Azure OpenAI models to research AI alignment topics from the ARENA curriculum.\n",
"\n",
"Our society consists of 4 specialized AI researchers with distinct personas and expertise areas."
- ],
- "metadata": {
- "id": "QSGuiwh--6ce"
- }
+ ]
},
{
"cell_type": "markdown",
- "source": [
- "## So, Let's catapault our way right in 🧚"
- ],
"metadata": {
"id": "fy_Q2Vp3_RgL"
- }
+ },
+ "source": [
+ "## So, Let's catapault our way right in 🧚"
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "XxC8Xe40_f6x"
+ },
"source": [
"## 🛠️ Dependencies and Setup\n",
"First, let's install the required dependencies and handle the notebook environment:"
- ],
- "metadata": {
- "id": "XxC8Xe40_f6x"
- }
+ ]
},
{
"cell_type": "code",
- "source": [
- "!pip install camel-ai['0.2.64'] anthropic"
- ],
+ "execution_count": null,
"metadata": {
- "id": "EKduVbY3XSYV",
- "outputId": "61642b98-baed-4fa7-a7a8-561e380c020d",
"colab": {
"base_uri": "https://localhost:8080/"
- }
+ },
+ "id": "EKduVbY3XSYV",
+ "outputId": "61642b98-baed-4fa7-a7a8-561e380c020d"
},
- "execution_count": 58,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "Requirement already satisfied: camel-ai in /usr/local/lib/python3.11/dist-packages (0.2.65)\n",
- "Collecting anthropic\n",
- " Downloading anthropic-0.54.0-py3-none-any.whl.metadata (25 kB)\n",
- "Requirement already satisfied: colorama<0.5,>=0.4.6 in /usr/local/lib/python3.11/dist-packages (from camel-ai) (0.4.6)\n",
- "Requirement already satisfied: docstring-parser<0.16,>=0.15 in /usr/local/lib/python3.11/dist-packages (from camel-ai) (0.15)\n",
- "Requirement already satisfied: httpx<1.0.0dev,>=0.28.0 in /usr/local/lib/python3.11/dist-packages (from camel-ai) (0.28.1)\n",
- "Requirement already satisfied: jsonschema<5,>=4 in /usr/local/lib/python3.11/dist-packages (from camel-ai) (4.24.0)\n",
- "Requirement already satisfied: mcp>=1.3.0 in /usr/local/lib/python3.11/dist-packages (from camel-ai) (1.9.4)\n",
- "Requirement already satisfied: openai<2,>=1.68.0 in /usr/local/lib/python3.11/dist-packages (from camel-ai) (1.84.0)\n",
- "Requirement already satisfied: pillow<11.0.0,>=10.1.0 in /usr/local/lib/python3.11/dist-packages (from camel-ai) (10.4.0)\n",
- "Requirement already satisfied: psutil<6,>=5.9.8 in /usr/local/lib/python3.11/dist-packages (from camel-ai) (5.9.8)\n",
- "Requirement already satisfied: pydantic>=2.10.6 in /usr/local/lib/python3.11/dist-packages (from camel-ai) (2.11.5)\n",
- "Requirement already satisfied: tiktoken<0.8,>=0.7.0 in /usr/local/lib/python3.11/dist-packages (from camel-ai) (0.7.0)\n",
- "Requirement already satisfied: anyio<5,>=3.5.0 in /usr/local/lib/python3.11/dist-packages (from anthropic) (4.9.0)\n",
- "Requirement already satisfied: distro<2,>=1.7.0 in /usr/local/lib/python3.11/dist-packages (from anthropic) (1.9.0)\n",
- "Requirement already satisfied: jiter<1,>=0.4.0 in /usr/local/lib/python3.11/dist-packages (from anthropic) (0.10.0)\n",
- "Requirement already satisfied: sniffio in /usr/local/lib/python3.11/dist-packages (from anthropic) (1.3.1)\n",
- "Requirement already satisfied: typing-extensions<5,>=4.10 in /usr/local/lib/python3.11/dist-packages (from anthropic) (4.14.0)\n",
- "Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.11/dist-packages (from anyio<5,>=3.5.0->anthropic) (3.10)\n",
- "Requirement already satisfied: certifi in /usr/local/lib/python3.11/dist-packages (from httpx<1.0.0dev,>=0.28.0->camel-ai) (2025.4.26)\n",
- "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.11/dist-packages (from httpx<1.0.0dev,>=0.28.0->camel-ai) (1.0.9)\n",
- "Requirement already satisfied: h11>=0.16 in /usr/local/lib/python3.11/dist-packages (from httpcore==1.*->httpx<1.0.0dev,>=0.28.0->camel-ai) (0.16.0)\n",
- "Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.11/dist-packages (from jsonschema<5,>=4->camel-ai) (25.3.0)\n",
- "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.11/dist-packages (from jsonschema<5,>=4->camel-ai) (2025.4.1)\n",
- "Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.11/dist-packages (from jsonschema<5,>=4->camel-ai) (0.36.2)\n",
- "Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.11/dist-packages (from jsonschema<5,>=4->camel-ai) (0.25.1)\n",
- "Requirement already satisfied: httpx-sse>=0.4 in /usr/local/lib/python3.11/dist-packages (from mcp>=1.3.0->camel-ai) (0.4.0)\n",
- "Requirement already satisfied: pydantic-settings>=2.5.2 in /usr/local/lib/python3.11/dist-packages (from mcp>=1.3.0->camel-ai) (2.9.1)\n",
- "Requirement already satisfied: python-multipart>=0.0.9 in /usr/local/lib/python3.11/dist-packages (from mcp>=1.3.0->camel-ai) (0.0.20)\n",
- "Requirement already satisfied: sse-starlette>=1.6.1 in /usr/local/lib/python3.11/dist-packages (from mcp>=1.3.0->camel-ai) (2.3.6)\n",
- "Requirement already satisfied: starlette>=0.27 in /usr/local/lib/python3.11/dist-packages (from mcp>=1.3.0->camel-ai) (0.46.2)\n",
- "Requirement already satisfied: uvicorn>=0.23.1 in /usr/local/lib/python3.11/dist-packages (from mcp>=1.3.0->camel-ai) (0.34.3)\n",
- "Requirement already satisfied: tqdm>4 in /usr/local/lib/python3.11/dist-packages (from openai<2,>=1.68.0->camel-ai) (4.67.1)\n",
- "Requirement already satisfied: annotated-types>=0.6.0 in /usr/local/lib/python3.11/dist-packages (from pydantic>=2.10.6->camel-ai) (0.7.0)\n",
- "Requirement already satisfied: pydantic-core==2.33.2 in /usr/local/lib/python3.11/dist-packages (from pydantic>=2.10.6->camel-ai) (2.33.2)\n",
- "Requirement already satisfied: typing-inspection>=0.4.0 in /usr/local/lib/python3.11/dist-packages (from pydantic>=2.10.6->camel-ai) (0.4.1)\n",
- "Requirement already satisfied: regex>=2022.1.18 in /usr/local/lib/python3.11/dist-packages (from tiktoken<0.8,>=0.7.0->camel-ai) (2024.11.6)\n",
- "Requirement already satisfied: requests>=2.26.0 in /usr/local/lib/python3.11/dist-packages (from tiktoken<0.8,>=0.7.0->camel-ai) (2.32.3)\n",
- "Requirement already satisfied: python-dotenv>=0.21.0 in /usr/local/lib/python3.11/dist-packages (from pydantic-settings>=2.5.2->mcp>=1.3.0->camel-ai) (1.1.0)\n",
- "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests>=2.26.0->tiktoken<0.8,>=0.7.0->camel-ai) (3.4.2)\n",
- "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests>=2.26.0->tiktoken<0.8,>=0.7.0->camel-ai) (2.4.0)\n",
- "Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.11/dist-packages (from uvicorn>=0.23.1->mcp>=1.3.0->camel-ai) (8.2.1)\n",
- "Downloading anthropic-0.54.0-py3-none-any.whl (288 kB)\n",
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m288.8/288.8 kB\u001b[0m \u001b[31m7.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
- "\u001b[?25hInstalling collected packages: anthropic\n",
- "Successfully installed anthropic-0.54.0\n"
- ]
- }
+ "outputs": [],
+ "source": [
+ "!pip install camel-ai['0.2.64'] anthropic"
]
},
{
"cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "id": "oZlcerEn_jtz"
+ },
+ "outputs": [],
"source": [
"import textwrap\n",
"import os\n",
@@ -154,24 +92,36 @@
"from camel.toolkits import FunctionTool, SearchToolkit\n",
"from camel.types import ModelPlatformType, ModelType\n",
"from camel.societies.workforce import Workforce"
- ],
- "metadata": {
- "id": "oZlcerEn_jtz"
- },
- "execution_count": 45,
- "outputs": []
+ ]
},
{
"cell_type": "markdown",
- "source": [
- "Prepare API keys: Azure OpenAI, Claude (Anthropic), and optionally Google Search\n"
- ],
"metadata": {
"id": "VVhZfj7YaIJL"
- }
+ },
+ "source": [
+ "Prepare API keys: Azure OpenAI, Claude (Anthropic), and optionally Google Search\n"
+ ]
},
{
"cell_type": "code",
+ "execution_count": 46,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "hMPCR_PyXzfZ",
+ "outputId": "7f962858-c402-474a-92e7-7a58ab5906f6"
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Setup optional API Keys for Google search functionality?(y/n): n\n"
+ ]
+ }
+ ],
"source": [
"# Ensuring API Keys are set\n",
"if not os.getenv(\"AZURE_OPENAI_API_KEY\"):\n",
@@ -201,50 +151,38 @@
" print(\"[OPTIONAL] Provide a search engine ID for google search.\")\n",
" search_engine_id = getpass(\"Enter your Search Engine ID: \")\n",
" os.environ[\"SEARCH_ENGINE_ID\"] = search_engine_id\n"
- ],
- "metadata": {
- "id": "hMPCR_PyXzfZ",
- "outputId": "7f962858-c402-474a-92e7-7a58ab5906f6",
- "colab": {
- "base_uri": "https://localhost:8080/"
- }
- },
- "execution_count": 46,
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Setup optional API Keys for Google search functionality?(y/n): n\n"
- ]
- }
]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "EXBs1Cy-_nRM"
+ },
"source": [
"### What this does:\n",
"\n",
"- Imports all necessary CAMEL-AI components\n",
"- Handles async operations for notebook environments\n",
"- Sets up typing hints for better code clarity\n"
- ],
- "metadata": {
- "id": "EXBs1Cy-_nRM"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "bNK_5jFi_rUe"
+ },
"source": [
"## 🏗️ Core Society Class Structure\n",
"Let's define our main research society class:"
- ],
- "metadata": {
- "id": "bNK_5jFi_rUe"
- }
+ ]
},
{
"cell_type": "code",
+ "execution_count": 47,
+ "metadata": {
+ "id": "A_SEy-2i_t1j"
+ },
+ "outputs": [],
"source": [
"class ARENAResearchSociety:\n",
" \"\"\"\n",
@@ -255,38 +193,38 @@
" def __init__(self):\n",
" self.workforce = None\n",
" self.setup_api_keys()"
- ],
- "metadata": {
- "id": "A_SEy-2i_t1j"
- },
- "execution_count": 47,
- "outputs": []
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "mfO3_w-n_wp7"
+ },
"source": [
"### What this does:\n",
"\n",
"- Creates the main class that will orchestrate our AI research society\n",
"- Initializes with API key setup to ensure proper authentication\n",
"- Prepares the workforce variable for later agent assignment"
- ],
- "metadata": {
- "id": "mfO3_w-n_wp7"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "9XnEUVeq_z2N"
+ },
"source": [
"## 🔑 API Configuration Management\n",
"Configure all necessary API keys and endpoints:"
- ],
- "metadata": {
- "id": "9XnEUVeq_z2N"
- }
+ ]
},
{
"cell_type": "code",
+ "execution_count": 48,
+ "metadata": {
+ "id": "LRIpFZkg_2Dh"
+ },
+ "outputs": [],
"source": [
"def setup_api_keys(self):\n",
" \"\"\"Setup API keys for Azure OpenAI and Claude\"\"\"\n",
@@ -329,15 +267,13 @@
"\n",
" print(\"✅ API keys configured!\")\n",
"ARENAResearchSociety.setup_api_keys = setup_api_keys"
- ],
- "metadata": {
- "id": "LRIpFZkg_2Dh"
- },
- "execution_count": 48,
- "outputs": []
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "vWpYeU01_5PY"
+ },
"source": [
"### What this does:\n",
"\n",
@@ -345,23 +281,25 @@
"- Supports Azure OpenAI, Claude (Anthropic), and optional Google Search\n",
"- Sets environment variables for seamless integration\n",
"- Provides graceful fallbacks for optional components"
- ],
- "metadata": {
- "id": "vWpYeU01_5PY"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "N4oDHnlN_-OL"
+ },
"source": [
"## 🤖 Azure OpenAI Agent Creation\n",
"Create specialized Azure OpenAI agents with custom personas:"
- ],
- "metadata": {
- "id": "N4oDHnlN_-OL"
- }
+ ]
},
{
"cell_type": "code",
+ "execution_count": 49,
+ "metadata": {
+ "id": "jZrn1AutACkN"
+ },
+ "outputs": [],
"source": [
"def create_azure_agent(self, role_name: str, persona: str, specialization: str) -> ChatAgent:\n",
" \"\"\"Create an Azure OpenAI agent with specific role and persona\"\"\"\n",
@@ -407,15 +345,13 @@
" model=model,\n",
" )\n",
"ARENAResearchSociety.create_azure_agent = create_azure_agent"
- ],
- "metadata": {
- "id": "jZrn1AutACkN"
- },
- "execution_count": 49,
- "outputs": []
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "H6WJouBHAFp3"
+ },
"source": [
"### What this does:\n",
"\n",
@@ -423,23 +359,25 @@
"- Embeds ARENA curriculum knowledge into each agent's system prompt\n",
"- Uses the latest API version compatible with o4-mini model\n",
"- Returns a fully configured ChatAgent ready for collaboration"
- ],
- "metadata": {
- "id": "H6WJouBHAFp3"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "ZrGBBCAZAIsx"
+ },
"source": [
"## 🧠 Claude Agent Creation\n",
"Create Claude agents with complementary capabilities:"
- ],
- "metadata": {
- "id": "ZrGBBCAZAIsx"
- }
+ ]
},
{
"cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "id": "PKA9hwsmALdj"
+ },
+ "outputs": [],
"source": [
"def create_claude_agent(self, role_name: str, persona: str, specialization: str, tools=None) -> ChatAgent:\n",
" \"\"\"Create a Claude agent with specific role and persona\"\"\"\n",
@@ -485,15 +423,13 @@
"\n",
" return agent\n",
"ARENAResearchSociety.create_claude_agent = create_claude_agent"
- ],
- "metadata": {
- "id": "PKA9hwsmALdj"
- },
- "execution_count": 50,
- "outputs": []
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "fN9_ic0lANV3"
+ },
"source": [
"### What this does:\n",
"\n",
@@ -501,24 +437,26 @@
"- Emphasizes ethical considerations and long-term thinking\n",
"- Supports optional tool integration (like search capabilities)\n",
"- Uses Claude 3.5 Sonnet for advanced reasoning\n"
- ],
- "metadata": {
- "id": "fN9_ic0lANV3"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "JvxlJ7RjARi5"
+ },
"source": [
"## 👥 Workforce Assembly\n",
"Bring together all agents into a collaborative workforce:\n",
"\n"
- ],
- "metadata": {
- "id": "JvxlJ7RjARi5"
- }
+ ]
},
{
"cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "id": "X_u3REt4ATk9"
+ },
+ "outputs": [],
"source": [
"def create_research_workforce(self):\n",
" \"\"\"Create the collaborative research workforce\"\"\"\n",
@@ -614,15 +552,13 @@
" print(\"✅ ARENA Research Society created with 4 specialized agents!\")\n",
" return self.workforce\n",
"ARENAResearchSociety.create_research_workforce = create_research_workforce"
- ],
- "metadata": {
- "id": "X_u3REt4ATk9"
- },
- "execution_count": 51,
- "outputs": []
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "PVUoO9qgAXqH"
+ },
"source": [
"### What this does:\n",
"\n",
@@ -631,23 +567,25 @@
"- Configures search tools for the lead researcher (when available)\n",
"- Sets up proper workforce coordination using Azure OpenAI models\n",
"- Creates a balanced team covering technical, practical, and ethical perspectives"
- ],
- "metadata": {
- "id": "PVUoO9qgAXqH"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "ewoOVtG1AbHk"
+ },
"source": [
"## 📋 Research Task Creation\n",
"Define structured research tasks for the collaborative team:"
- ],
- "metadata": {
- "id": "ewoOVtG1AbHk"
- }
+ ]
},
{
"cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "id": "qBX8N-ZrAd7j"
+ },
+ "outputs": [],
"source": [
"def create_research_task(self, research_topic: str, specific_questions: str = None) -> Task:\n",
" \"\"\"Create a research task for the ARENA curriculum\"\"\"\n",
@@ -698,15 +636,13 @@
" id=\"arena_research_001\",\n",
" )\n",
"ARENAResearchSociety.create_research_task = create_research_task"
- ],
- "metadata": {
- "id": "qBX8N-ZrAd7j"
- },
- "execution_count": 52,
- "outputs": []
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "GpuXTYOkAhOi"
+ },
"source": [
"### What this does:\n",
"\n",
@@ -714,23 +650,25 @@
"- Adapts task content based on available tools (search vs. knowledge-based)\n",
"- Includes ARENA curriculum context for focused analysis\n",
"- Supports custom research questions for specialized investigations"
- ],
- "metadata": {
- "id": "GpuXTYOkAhOi"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "ktGiQU9PAkL9"
+ },
"source": [
"## 🔬 Research Execution\n",
"Execute collaborative research sessions:"
- ],
- "metadata": {
- "id": "ktGiQU9PAkL9"
- }
+ ]
},
{
"cell_type": "code",
+ "execution_count": 53,
+ "metadata": {
+ "id": "32IPUR3iAmVY"
+ },
+ "outputs": [],
"source": [
"def run_research(self, research_topic: str, specific_questions: str = None):\n",
" \"\"\"Run a collaborative research session\"\"\"\n",
@@ -750,15 +688,13 @@
"\n",
" return processed_task.result\n",
"ARENAResearchSociety.run_research = run_research"
- ],
- "metadata": {
- "id": "32IPUR3iAmVY"
- },
- "execution_count": 53,
- "outputs": []
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "CNGecl-jAp2L"
+ },
"source": [
"## What this does:\n",
"\n",
@@ -766,105 +702,32 @@
"- Creates the workforce if not already initialized\n",
"- Processes tasks through the collaborative agent network\n",
"- Returns formatted research results\n"
- ],
- "metadata": {
- "id": "CNGecl-jAp2L"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "yoB1-obIAsBA"
+ },
"source": [
" ## 🎯 Interactive Demo Interface\n",
"Create an interactive interface for easy topic selection:"
- ],
- "metadata": {
- "id": "yoB1-obIAsBA"
- }
+ ]
},
{
"cell_type": "code",
- "source": [
- "\"\"\"Demonstrating the ARENA Research Society\"\"\"\n",
- "society = ARENAResearchSociety()\n",
- "\n",
- "# Example research topics related to ARENA curriculum\n",
- "sample_topics = {\n",
- " 1: {\n",
- " \"topic\": \"Mechanistic Interpretability in Large Language Models\",\n",
- " \"questions\": \"\"\"\n",
- " - How do the latest mechanistic interpretability techniques apply to understanding LLM behavior?\n",
- " - What are the most effective methods for interpreting attention patterns and residual streams?\n",
- " - How can mechanistic interpretability inform AI alignment strategies?\n",
- " - What are the current limitations and future directions in this field?\n",
- " \"\"\"\n",
- " },\n",
- " 2: {\n",
- " \"topic\": \"RLHF Implementation Challenges and Best Practices\",\n",
- " \"questions\": \"\"\"\n",
- " - What are the main technical challenges in implementing RLHF at scale?\n",
- " - How do different reward modeling approaches compare in effectiveness?\n",
- " - What are the alignment implications of various RLHF techniques?\n",
- " - How can we address issues like reward hacking and distributional shift?\n",
- " \"\"\"\n",
- " },\n",
- " 3: {\n",
- " \"topic\": \"AI Governance Frameworks for Emerging Technologies\",\n",
- " \"questions\": \"\"\"\n",
- " - What governance frameworks are most suitable for rapidly advancing AI capabilities?\n",
- " - How can policy makers balance innovation with safety considerations?\n",
- " - What role should technical AI safety research play in policy development?\n",
- " - How can international coordination on AI governance be improved?\n",
- " \"\"\"\n",
- " }\n",
- " }\n",
- "\n",
- "print(\"🎯 ARENA AI Alignment Research Society\")\n",
- "print(\"Choose a research topic or provide your own:\")\n",
- "print()\n",
- "\n",
- "for num, info in sample_topics.items():\n",
- " print(f\"{num}. {info['topic']}\")\n",
- "print(\"4. Custom research topic\")\n",
- "print()\n",
- "\n",
- "try:\n",
- " choice = input(\"Enter your choice (1-4): \").strip()\n",
- "\n",
- " if choice in ['1', '2', '3']:\n",
- " topic_info = sample_topics[int(choice)]\n",
- " result = society.run_research(\n",
- " topic_info[\"topic\"],\n",
- " topic_info[\"questions\"]\n",
- " )\n",
- " elif choice == '4':\n",
- " custom_topic = input(\"Enter your research topic: \").strip()\n",
- " custom_questions = input(\"Enter specific questions (optional): \").strip()\n",
- " result = society.run_research(\n",
- " custom_topic,\n",
- " custom_questions if custom_questions else None\n",
- " )\n",
- " else:\n",
- " print(\"Invalid choice. Running default research...\")\n",
- " result = society.run_research(sample_topics[1][\"topic\"], sample_topics[1][\"questions\"])\n",
- "\n",
- "except KeyboardInterrupt:\n",
- " print(\"\\n👋 Research session interrupted.\")\n",
- "except Exception as e:\n",
- " print(f\"❌ Error during research: {e}\")\n",
- "\n"
- ],
+ "execution_count": 59,
"metadata": {
- "id": "luftv50cAy10",
- "outputId": "15020813-3448-4251-feec-82343422f9a0",
"colab": {
"base_uri": "https://localhost:8080/"
- }
+ },
+ "id": "luftv50cAy10",
+ "outputId": "15020813-3448-4251-feec-82343422f9a0"
},
- "execution_count": 59,
"outputs": [
{
- "output_type": "stream",
"name": "stdout",
+ "output_type": "stream",
"text": [
"🔧 Setting up API keys...\n",
"Please input your Google API key (optional, press Enter to skip): ··········\n",
@@ -883,15 +746,15 @@
]
},
{
- "output_type": "stream",
"name": "stderr",
+ "output_type": "stream",
"text": [
"WARNING:camel.camel.societies.workforce.workforce:No new_worker_agent_kwargs provided. Workers created at runtime will use default ChatAgent settings with SearchToolkit, CodeExecutionToolkit, and ThinkingToolkit. To customize runtime worker creation, pass a dictionary with ChatAgent parameters, e.g.: {'model': your_model, 'tools': your_tools}. See ChatAgent documentation for all available options.\n"
]
},
{
- "output_type": "stream",
"name": "stdout",
+ "output_type": "stream",
"text": [
"✅ ARENA Research Society created with 4 specialized agents!\n",
"🔬 Starting collaborative research on: Mechanistic Interpretability in Large Language Models\n",
@@ -1297,10 +1160,83 @@
"Mechanistic interpretability provides a concrete bridge between black-box LLMs and human‐readable computational structure, enabling transparency, safety monitoring and alignment interventions. The ARENA curriculum should leverage these methods in practical labs, embed ethical governance training, and drive research into scalable, causal, and standardized interpretability techniques for robust, aligned future AI systems.\n"
]
}
+ ],
+ "source": [
+ "\"\"\"Demonstrating the ARENA Research Society\"\"\"\n",
+ "society = ARENAResearchSociety()\n",
+ "\n",
+ "# Example research topics related to ARENA curriculum\n",
+ "sample_topics = {\n",
+ " 1: {\n",
+ " \"topic\": \"Mechanistic Interpretability in Large Language Models\",\n",
+ " \"questions\": \"\"\"\n",
+ " - How do the latest mechanistic interpretability techniques apply to understanding LLM behavior?\n",
+ " - What are the most effective methods for interpreting attention patterns and residual streams?\n",
+ " - How can mechanistic interpretability inform AI alignment strategies?\n",
+ " - What are the current limitations and future directions in this field?\n",
+ " \"\"\"\n",
+ " },\n",
+ " 2: {\n",
+ " \"topic\": \"RLHF Implementation Challenges and Best Practices\",\n",
+ " \"questions\": \"\"\"\n",
+ " - What are the main technical challenges in implementing RLHF at scale?\n",
+ " - How do different reward modeling approaches compare in effectiveness?\n",
+ " - What are the alignment implications of various RLHF techniques?\n",
+ " - How can we address issues like reward hacking and distributional shift?\n",
+ " \"\"\"\n",
+ " },\n",
+ " 3: {\n",
+ " \"topic\": \"AI Governance Frameworks for Emerging Technologies\",\n",
+ " \"questions\": \"\"\"\n",
+ " - What governance frameworks are most suitable for rapidly advancing AI capabilities?\n",
+ " - How can policy makers balance innovation with safety considerations?\n",
+ " - What role should technical AI safety research play in policy development?\n",
+ " - How can international coordination on AI governance be improved?\n",
+ " \"\"\"\n",
+ " }\n",
+ " }\n",
+ "\n",
+ "print(\"🎯 ARENA AI Alignment Research Society\")\n",
+ "print(\"Choose a research topic or provide your own:\")\n",
+ "print()\n",
+ "\n",
+ "for num, info in sample_topics.items():\n",
+ " print(f\"{num}. {info['topic']}\")\n",
+ "print(\"4. Custom research topic\")\n",
+ "print()\n",
+ "\n",
+ "try:\n",
+ " choice = input(\"Enter your choice (1-4): \").strip()\n",
+ "\n",
+ " if choice in ['1', '2', '3']:\n",
+ " topic_info = sample_topics[int(choice)]\n",
+ " result = society.run_research(\n",
+ " topic_info[\"topic\"],\n",
+ " topic_info[\"questions\"]\n",
+ " )\n",
+ " elif choice == '4':\n",
+ " custom_topic = input(\"Enter your research topic: \").strip()\n",
+ " custom_questions = input(\"Enter specific questions (optional): \").strip()\n",
+ " result = society.run_research(\n",
+ " custom_topic,\n",
+ " custom_questions if custom_questions else None\n",
+ " )\n",
+ " else:\n",
+ " print(\"Invalid choice. Running default research...\")\n",
+ " result = society.run_research(sample_topics[1][\"topic\"], sample_topics[1][\"questions\"])\n",
+ "\n",
+ "except KeyboardInterrupt:\n",
+ " print(\"\\n👋 Research session interrupted.\")\n",
+ "except Exception as e:\n",
+ " print(f\"❌ Error during research: {e}\")\n",
+ "\n"
]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "tIjwx8qaA16N"
+ },
"source": [
"## What this does:\n",
"\n",
@@ -1308,50 +1244,50 @@
"- Offers custom topic input for flexible research\n",
"- Handles user interaction gracefully with error handling\n",
"- Demonstrates the full capabilities of the collaborative AI society"
- ],
- "metadata": {
- "id": "tIjwx8qaA16N"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "pJ101gxnA4fY"
+ },
"source": [
"## 🚀 Running the Cookbook\n",
"To run this collaborative AI research society:\n"
- ],
- "metadata": {
- "id": "pJ101gxnA4fY"
- }
+ ]
},
{
"cell_type": "markdown",
- "source": [
- "Execute Individual cells."
- ],
"metadata": {
"id": "6cO2bYKQBoHS"
- }
+ },
+ "source": [
+ "Execute Individual cells."
+ ]
},
{
"cell_type": "markdown",
- "source": [
- "Follow prompts: Enter your API credentials and select research topics"
- ],
"metadata": {
"id": "YyCoe0zXBvVY"
- }
+ },
+ "source": [
+ "Follow prompts: Enter your API credentials and select research topics"
+ ]
},
{
"cell_type": "markdown",
- "source": [
- "The system will create a collaborative research environment where Claude and Azure OpenAI agents work together to produce comprehensive analysis on AI alignment topics!"
- ],
"metadata": {
"id": "3iQSGaVhBxLR"
- }
+ },
+ "source": [
+ "The system will create a collaborative research environment where Claude and Azure OpenAI agents work together to produce comprehensive analysis on AI alignment topics!"
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "wMYMfaZ9Bzdl"
+ },
"source": [
"## 🎯 Conclusion\n",
"The future of AI collaboration is here, and this CAMEL-powered society demonstrates the incredible potential of multi-agent systems working across different AI platforms.\n",
@@ -1375,13 +1311,13 @@
"\n",
"\n",
"\n"
- ],
- "metadata": {
- "id": "wMYMfaZ9Bzdl"
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "id": "PxVgp-zXB9Hj"
+ },
"source": [
"That's everything: Got questions about 🐫 CAMEL-AI? Join us on [Discord](https://discord.camel-ai.org)! Whether you want to share feedback, explore the latest in multi-agent systems, get support, or connect with others on exciting projects, we’d love to have you in the community! 🤝\n",
"\n",
@@ -1406,10 +1342,21 @@
" \n",
"⭐ <i>Star us on [*Github*](https://github.com/camel-ai/camel), join our [*Discord*](https://discord.camel-ai.org) or follow our [*X*](https://x.com/camelaiorg)\n",
"</div>\n"
- ],
- "metadata": {
- "id": "PxVgp-zXB9Hj"
- }
+ ]
}
- ]
+ ],
+ "metadata": {
+ "colab": {
+ "provenance": []
+ },
+ "kernelspec": {
+ "display_name": "Python 3",
+ "name": "python3"
+ },
+ "language_info": {
+ "name": "python"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
}