Skip to main content
CAMEL-AI is an open-source framework for building intelligent agents. It allows you to create, customize, and deploy multi-agent systems efficiently.

Prerequisites

  • A SambaCloud API key
    Get one by creating a SambaCloud account and generating an API key from the API Keys tab.
  • Python 3.10 to 3.14. camel-ai does not support Python 3.9 or earlier, or Python 3.15 or later.
  • Your API key exported as SAMBA_API_KEY:
A SambaCloud key is all you need for the quickstart and the two-agent example. The example notebook additionally requires a Firecrawl API key, a Discord bot token, and a GPU runtime, listed in full in that section.
CAMEL-AI reads your key from SAMBA_API_KEY, not SAMBANOVA_API_KEY. If you have followed another SambaNova integration guide, note that the variable name is different here.
macOS ships with Python 3.9, which is below the required floor, and exposes it as python3 rather than python. Check your version with python3 --version. If it is below 3.10, install a supported version with pyenv, uv, or brew install python@3.12 before continuing.

Installation and setup

  1. Create a virtual environment
  2. Confirm the environment uses a supported version
  3. Install the required libraries. Quote "camel-ai[all]~=0.2.90": zsh, the default shell on macOS, treats the square brackets as a filename pattern and fails with no matches found before pip runs. The extra pulls a large dependency tree and can take several minutes, so allow time for it to finish.
    Both version bounds are deliberate. Keep them.~=0.2.90 holds you on the camel-ai 0.2 line. camel-ai is pre-1.0, so its public API can change between releases. The code on this page is verified against camel-ai 0.2.90. Widen the bound only after you have re-tested your own code."mcp<2" is required. camel-ai requests mcp>=1.3.0 with no upper bound, so an unpinned install pulls mcp 2.0.0, which removed FastMCP from mcp.server. Without the pin, from camel.agents import ChatAgent fails with ImportError: cannot import name 'FastMCP' from 'mcp.server', and neither the examples below nor the notebook can run. Remove the pin once camel-ai bounds the dependency itself.
  4. Verify the installation. This imports ChatAgent rather than the top-level package, because import camel succeeds even when the agent API is broken.
    The command prints exactly this and exits without a traceback:

Quickstart

Before you write anything larger, confirm your setup end to end with a single chat completion. Save this as quickstart.py and run it with python quickstart.py:
You should see a short reply similar to the one below.
It reads SAMBA_API_KEY from your environment and returns a response in a few seconds. If it prints a reply, your environment and key are working, and any later failure is in your own code rather than your setup. Set model_type to any current model ID from SambaCloud models; Meta-Llama-3.3-70B-Instruct is a fast, inexpensive choice for a first run.

Coordinate two agents

CAMEL-AI is built for multi-agent work, so a single agent does not show much of it. The example below gives two agents different system messages and passes one’s output to the other: a planner drafts a plan, a reviewer critiques it, and the planner revises. Each ChatAgent keeps its own conversation history, which is why the planner’s second turn already knows the plan it wrote. Save this as two_agents.py and run it with python two_agents.py:
The script makes three SambaCloud requests and prints three labeled sections. The wording varies between runs, but the shape does not:
Both agents share one model object, so the script opens a single client and bills three completions. Give an agent its own ModelFactory.create() call when you want a different model per role.

Example notebook

You can explore an example notebook that demonstrates how to build a Customer Service Discord Bot using CAMEL-AI, models served by SambaCloud, Firecrawl, and Qdrant:
Camel AI Customer Service Discord Bot example notebook
Two edits are required before the notebook will run. Both are stale values in the notebook itself, not on this page.
  • The notebook sets model_type="QwQ-32B", which SambaCloud deprecated on 6/25/2025 and no longer serves. Replace it with MiniMax-M2.7 or another current ID from SambaCloud models. The notebook’s retrieval corpus is about Qwen models, so consider adjusting the prompts alongside the model.
  • The notebook tells you to set DISCORD_TOKEN, but CAMEL-AI’s code reads DISCORD_BOT_TOKEN. Export DISCORD_BOT_TOKEN.
The notebook also needs credentials and compute beyond a SambaCloud key. Set these up before you start:
  • A Firecrawl account for FIRECRAWL_API_KEY, used to crawl the knowledge source.
  • A bot registered in the Discord Developer Portal for DISCORD_BOT_TOKEN.
  • A GPU runtime. The notebook runs an open-source embedding model locally and suggests a GPU-backed Google Colab runtime (Tesla T4) for that step. You can substitute another embedding model supported by CAMEL-AI instead.
Qdrant needs no account. The notebook runs it locally and writes the vector store to data/vectordb/.

Troubleshooting

zsh, the default shell on macOS, expands square brackets as a filename pattern, so the install command fails before pip runs. Quote the whole argument: pip install "camel-ai[all]~=0.2.90". bash does not need the quotes, but they are harmless there.
mcp 2.0.0 is installed. camel-ai requests mcp>=1.3.0 with no upper bound, but 2.0.0 removed FastMCP, which camel.toolkits imports. Every import under camel.agents fails as a result, including the notebook’s first cell. Note that import camel still succeeds, so this does not show up in a top-level import check. Fix it with pip install "mcp<2".
The virtual environment is not active. Run source .venv/bin/activate again, confirm the prompt shows (.venv), then re-run the install command. Verify with python -c "import camel; print('Camel-AI ready')".
camel-ai[all] installs every optional dependency, which is a large download and can take several minutes on a slow connection. If it fails partway, install the base package first with pip install "camel-ai~=0.2.90", then add the extras. The example notebook needs the extras, so do not skip them permanently.
A newer camel-ai changed an API this page depends on. camel-ai is pre-1.0 and its public surface can move between releases. Reinstall the verified version with pip install "camel-ai[all]~=0.2.90", confirm what you have with pip show camel-ai, and check the CAMEL-AI documentation for the current signature before widening the bound.
The example notebook sets model_type="QwQ-32B", which SambaCloud deprecated on 6/25/2025 and no longer serves. Replace it with MiniMax-M2.7, or another current model ID from SambaCloud models. Note that the notebook’s retrieval corpus is itself about Qwen models, so you may want to adjust the prompts alongside the model.
The linked notebook tells you to set DISCORD_TOKEN, but CAMEL-AI’s code reads DISCORD_BOT_TOKEN. CAMEL-AI’s own docstring still refers to the older name, so the notebook’s instruction is stale upstream rather than an error on this page. Set DISCORD_BOT_TOKEN instead of DISCORD_TOKEN.
Unlike most SambaNova integrations, CAMEL-AI requires SAMBA_API_KEY. Setting SAMBANOVA_API_KEY has no effect here. CAMEL-AI raises this at ModelFactory.create() before any request is sent, so the traceback points at model setup rather than at the API call. Export SAMBA_API_KEY instead.
CAMEL-AI defaults to a 180 second per-request timeout and retries failed calls three times. Lower it for faster feedback while you are iterating by passing timeout=30 to ModelFactory.create(), or set MODEL_TIMEOUT in your environment. If every call times out, confirm the endpoint is reachable: curl -H "Authorization: Bearer $SAMBA_API_KEY" https://api.sambanova.ai/v1/models.
The example notebook needs a Firecrawl API key, a Discord bot token, and a GPU runtime in addition to your SambaCloud key. See Example notebook for the full list and where to get each one. The quickstart and the two-agent example need none of them.

Additional resources