Zenn
🐪

Camel-AIのOWLを試してみた

2025/03/25に公開
2

はじめに

OWL(Optimized Workforce Learning)とはCAMELフレームワークに基づいて開発された先進的なマルチエージェントコラボレーションシステムです。
エージェントのコラボレーションによって複雑な問題を解決するように設計されています。
ローカルスクリプトを修正することで、モデルやツールをカスタマイズすることができます。

少し前に話題になったmanusAIのオープンソースで利用可能な代替ツールとしていま話題になっています。

このウェブアプリは現在ベータ版の開発中です。デモンストレーションとテストのみを目的として提供されており、本番での使用はまだ推奨されていません。

主な機能

  • オンライン検索: ウィキペディア、Google、DuckDuckGo、百度、Bochaなど複数の検索エンジンに対応し、リアルタイムの情報検索と知識取得が可能。
  • マルチモーダル処理: インターネットまたはローカルの動画、画像、音声データの処理に対応。
  • ブラウザ自動化: Playwrightフレームワークを使用してスクロール、クリック、入力処理、ダウンロード、ナビゲーションなどのブラウザ操作をシミュレーション。
  • ドキュメント解析: Word、Excel、PDF、PowerPointファイルからコンテンツを抽出し、テキストまたはMarkdown形式に変換。
  • コード実行: インタープリターを使用してPythonコードを記述・実行。
  • 内蔵ツールキット: 以下を含む包括的な内蔵ツールキットにアクセス可能:
    • Model Context Protocol (MCP): AIモデルと様々なツールやデータソースとの相互作用を標準化する普遍的なプロトコル層
    • コアツールキット: Arxiv、音声分析、コード実行、DALLE、DataCommons、Excel、GitHub、GoogleMaps、GoogleScholar、画像分析、数学、NetworkX、Notion、OpenAPI、Reddit、検索、SemanticScholar、SymPy、動画分析、天気、ブラウザなど、特殊タスク用の多数のツールキット

camel Framework

camelフレームワークについては以前こちらの記事にまとめていますのでご覧ください。
https://zenn.dev/mixi/articles/942aa8a2c32a0a

動かしてみた

事前準備

ソースコードはこちらです。

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

今回もdocker内にowlの環境を構築して動作を検証してみたいと思います。

Readmeに書かれている内容では説明が不十分な箇所があったため
2025/03/25時点で私が実際に動作検証を実施した際の手順を記載しておきます。

# Clone the repository
git clone https://github.com/camel-ai/owl.git
cd owl

# Configure environment variables
cp owl/.env_template owl/.env
# Edit the .env file and fill in your API keys

コピーした .envファイルに必要なAPIキーを登録してください。
OPEN_AIのAPIキー
https://github.com/camel-ai/owl/blob/main/owl/.env_template#L6-L7

Google SearchのAPIキー
https://github.com/camel-ai/owl/blob/main/owl/.env_template#L33-L35

の2つを私は登録しました。

これらの設定は後述するwebUIを使った動作に必要な情報となります。

コマンドで実行する際はご自身のローカル環境の環境変数 OPEN_API_KEY にAPIキーをセットしておくことでdockerのコンテナ環境にも同様に反映されます。

https://github.com/camel-ai/owl/blob/main/.container/docker-compose.yml#L23

それではdockerの環境を立ち上げていきます。

cd .container

# This option downloads a ready-to-use image from Docker Hub
# Fastest and recommended for most users
docker compose up -d

これで無事にdocker環境が立ち上がるはずです。

あとはコンテナの中に入って作業をしていきます。

# Run OWL inside the container
docker compose exec owl bash
cd .. && source .venv/bin/activate
playwright install-deps

これで準備完了です。

実践(コマンド編)

クイックスタートとしてサンプルが載っていた examples/run.py を動かしてみます。

https://github.com/camel-ai/owl/blob/main/examples/run.py

このプログラムは、CAMEL-AIライブラリを利用して、与えられた質問に対して複数のAIエージェントが協力して回答を生成するシステムを構築するためのコードです。
construct_society 関数で、使用するLLM、利用可能なツールキット、エージェントの役割などを定義し、main 関数で質問を設定してエージェント社会を実行し、結果を出力します。
このフレームワークにより、Web検索、コード実行、ファイル操作、画像・動画・音声分析、ドキュメント処理など、多様なタスクをAIエージェントの連携によって解決することが可能になります。

デフォルトで与えられているタスクは以下の内容です。
Amazon.comにアクセスし、プログラマーにとって魅力的な商品を1つ選んでください。商品名と価格を教えてください。答えを確認する必要はありません

xvfb-python は仮想ディスプレイ環境でPythonを実行するコマンドのようです。
詳しく知りたい方は調べてみてください。

root@caaaaaaaaaaa:/app# xvfb-python examples/run.py
...
2025-03-25 12:22:56,851 - camel.agents.chat_agent - INFO - Model gpt-4o, index 0, processed these messages: [{'role': 'system', 'content': '===== RULES OF USER =====\nNever forget you are a user and I am a assistant. Never flip roles! You will always instruct me.\nWe share a common interest in collaborating to successfully complete a task.\nI must help you to complete the task.\nHere is the task: Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer.. Never forget our task!\nYou must instruct me based on my expertise and your needs to solve the task ONLY in the following two ways:\n\n1. Instruct with a necessary input:\nInstruction: <YOUR_INSTRUCTION>\nInput: <YOUR_INPUT>\n\n2. Instruct without any input:\nInstruction: <YOUR_INSTRUCTION>\nInput: None\n\nThe "Instruction" describes a task or question. The paired "Input" provides further context or information for the requested "Instruction".\n\nYou must give me one instruction at a time.\nI must write a response that appropriately solves the requested instruction.\nI must decline your instruction honestly if I cannot perform the instruction due to physical, moral, legal reasons or my capability and explain the reasons.\nYou should instruct me not ask me questions.\nNow you must start to instruct me using the two ways described above.\nDo not add anything else other than your instruction and the optional corresponding input!\nKeep giving me instructions and necessary inputs until you think the task is completed.\nWhen the task is completed, you must only reply with a single word <CAMEL_TASK_DONE>.\nNever say <CAMEL_TASK_DONE> unless my responses have solved your task.'}, {'role': 'user', 'content': '\n    Now please give me instructions to solve over overall task step by step. If the task requires some specific knowledge, please instruct me to use tools to complete the task.\n        '}]
2025-03-25 12:22:58,078 - camel.agents.chat_agent - INFO - Model gpt-4o, index 0, processed these messages: [{'role': 'system', 'content': '===== RULES OF ASSISTANT =====\nNever forget you are a assistant and I am a user. Never flip roles! Never instruct me!\nWe share a common interest in collaborating to successfully complete a task.\nYou must help me to complete the task.\nHere is the task: Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer.. Never forget our task!\nI must instruct you based on your expertise and my needs to complete the task.\n\nI must give you one instruction at a time.\nYou must write a specific solution that appropriately solves the requested instruction and explain your solutions.\nYou must decline my instruction honestly if you cannot perform the instruction due to physical, moral, legal reasons or your capability and explain the reasons.\nUnless I say the task is completed, you should always start with:\n\nSolution: <YOUR_SOLUTION>\n\n<YOUR_SOLUTION> should be very specific, include detailed explanations and provide preferable detailed implementations and examples and lists for task-solving.\nAlways end <YOUR_SOLUTION> with: Next request.'}, {'role': 'user', 'content': "I'm here to assist you with the task. Please provide me with the first instruction to begin."}]
2025-03-25 12:22:58,079 - camel.owl.utils.enhanced_role_playing - INFO - Round #0 user_response:
 I'm here to assist you with the task. Please provide me with the first instruction to begin.
2025-03-25 12:22:58,079 - camel.owl.utils.enhanced_role_playing - INFO - Round #0 assistant_response:
 Solution: Please instruct me to navigate to Amazon.com and identify one product that is attractive to coders. I will then proceed to find the product name and price for you. Next request.

長いので間を割愛します。
ですが複数のAIエージェントが立ち上がって動いているのが確認できると思います。

2025-03-25 12:24:02,380 - camel.agents.chat_agent - INFO - Model gpt-4o, index 0, processed these messages: [{'role': 'system', 'content': '===== RULES OF ASSISTANT =====\nNever forget you are a assistant and I am a user. Never flip roles! Never instruct me!\nWe share a common interest in collaborating to successfully complete a task.\nYou must help me to complete the task.\nHere is the task: Navigate to Amazon.com and identify one product that is attractive to coders. Please provide me with the product name and price. No need to verify your answer.. Never forget our task!\nI must instruct you based on your expertise and my needs to complete the task.\n\nI must give you one instruction at a time.\nYou must write a specific solution that appropriately solves the requested instruction and explain your solutions.\nYou must decline my instruction honestly if you cannot perform the instruction due to physical, moral, legal reasons or your capability and explain the reasons.\nUnless I say the task is completed, you should always start with:\n\nSolution: <YOUR_SOLUTION>\n\n<YOUR_SOLUTION> should be very specific, include detailed explanations and provide preferable detailed implementations and examples and lists for task-solving.\nAlways end <YOUR_SOLUTION> with: Next request.'}, {'role': 'user', 'content': "I'm here to assist you with the task. Please provide me with the first instruction to begin."}, {'role': 'assistant', 'content': 'Solution: Please instruct me to navigate to Amazon.com and identify one product that is attractive to coders. I will then proceed to find the product name and price for you. Next request.'}, {'role': 'user', 'content': 'Instruction: Navigate to Amazon.com and identify one product that is attractive to coders. \nInput: None'}, {'role': 'assistant', 'content': '', 'tool_calls': [{'id': 'call_RXx4L2PWo7oZi1oHpZEnCOYX', 'type': 'function', 'function': {'name': 'browse_url', 'arguments': '{"task_prompt": "Identify one product that is attractive to coders and provide the product name and price.", "start_url": "https://www.amazon.com", "round_limit": 12}'}}]}, {'role': 'tool', 'content': 'The task of identifying a product that is attractive to coders has been completed. Here is the final answer:\n\n- **Product Name:** DIERYA T68SE 60% Gaming Mechanical Keyboard\n- **Price:** $23.70\n\nThis product is suitable for coders due to its compact design and features that appeal to both gamers and programmers.', 'tool_call_id': 'call_RXx4L2PWo7oZi1oHpZEnCOYX'}, {'role': 'assistant', 'content': 'Solution: I have identified a product that is attractive to coders on Amazon.com. The product is the **DIERYA T68SE 60% Gaming Mechanical Keyboard**, and it is priced at **$23.70**. This keyboard is compact and features mechanical keys, making it appealing to both gamers and programmers. \n\nNext request.'}, {'role': 'user', 'content': 'Instruction: Confirm that the identified product and its details meet the task requirements.\nInput: None'}, {'role': 'assistant', 'content': 'Solution: The identified product, **DIERYA T68SE 60% Gaming Mechanical Keyboard**, meets the task requirements as it is a product that is attractive to coders. Mechanical keyboards are often preferred by coders due to their tactile feedback and durability, which enhance the typing experience during long coding sessions. The compact 60% design is also beneficial for saving desk space, making it a practical choice for programmers. The price of **$23.70** makes it an affordable option for those looking for a quality mechanical keyboard.\n\nNext request.'}, {'role': 'user', 'content': 'Instruction: Confirm that the task is completed based on the provided solution.\nInput: None'}, {'role': 'assistant', 'content': 'Solution: Based on the provided solution, the task is completed. We have successfully navigated to Amazon.com, identified a product that is attractive to coders, and provided the product name and price. The product, **DIERYA T68SE 60% Gaming Mechanical Keyboard**, meets the task requirements, and all necessary details have been confirmed.\n\nIf you have any further requests or need additional assistance, feel free to let me know. Otherwise, the task is considered complete.'}, {'role': 'user', 'content': 'CAMEL_TASK_DONE'}]
2025-03-25 12:24:02,380 - camel.owl.utils.enhanced_role_playing - INFO - Round #4 user_response:
 CAMEL_TASK_DONE
2025-03-25 12:24:02,381 - camel.owl.utils.enhanced_role_playing - INFO - Round #4 assistant_response:
 Great! If you have any more tasks or need further assistance in the future, feel free to reach out. Have a wonderful day!
Answer: Great! If you have any more tasks or need further assistance in the future, feel free to reach out. Have a wonderful day!

重要な回答だけ抜粋するとこちら

Solution: Based on the provided solution, the task is completed. We have successfully navigated to Amazon.com, identified a product that is attractive to coders, and provided the product name and price. The product, DIERYA T68SE 60% Gaming Mechanical Keyboard, meets the task requirements, and all necessary details have been confirmed.

DIERYA T68SE 60% ゲーミング メカニカル キーボード が選ばれたようです。

ただこれだとよくわからないなと思うのでwebUIの方も試してみました。

実践(webUI編)

https://github.com/camel-ai/owl?tab=readme-ov-file#-web-interface

このコマンドでwebUIが立ち上がってきます。

python owl/webapp.py
root@aaaaaaaaa:/app/owl# python webapp.py
2025-03-25 13:22:38,355 - root - INFO - Logging system initialized, log file: /app/owl/logs/gradio_log_2025-03-25.txt
2025-03-25 13:22:38,355 - root - INFO - OWL Web application started
2025-03-25 13:22:38,355 - root - INFO - Log reading thread started
/app/owl/webapp.py:1079: GradioDeprecationWarning: 'scale' value should be an integer. Using 0.5 will cause issues.
  with gr.Column(scale=0.5):
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
IMPORTANT: You are using gradio version 3.50.2, however version 4.44.1 is available, please upgrade.

こんなUIが立ち上がってきます。

モデルも複数選択できそうです。

UI上からAPIキーが設定できると書いてあったのですがどこから設定できるか見つけられませんでした...

デフォルトで既にサンプルのタスクが記載されていますのでまずはこれをそのまま実行してみます。

Open Google search, summarize the github stars, fork counts, etc. of camel-ai's camel framework, and write the numbers into a python file using the plot package, save it locally, and run the generated python file.

Google 検索を開き、camel-ai の camel フレームワークの github スター、フォーク数などをまとめ、plot パッケージを使用して数値を python ファイルに書き込み、ローカルに保存して、生成された python ファイルを実行します。

という内容です。

実際に実行していきます。


先ほどのコマンドラインでの実行と比較してもかなり視覚的に理解しやすいかと思います。
Assistant AgentUser Agentが動いているのがわかります。

最終の実行結果がこちら

You can run the camel_framework_stats.py file on your local machine to view the plot interactively. Simply use the command python camel_framework_stats.py in your terminal or command prompt.

調べてみると生成された成果物はコンテナ環境内の webapp.pyを実行したディレクトリの下に置かれているようです。
今回生成されたパイソンスクリプトとpngファイルは以下です。

camel_framework_stats.py
import matplotlib.pyplot as plt

# Data for plotting
data = {
    'Stars': 11100,
    'Forks': 1100,
    'Issues': 308,
    'Pull Requests': 114,
    'Branches': 232,
    'Tags': 78
}

# Create a bar plot
fig, ax = plt.subplots()
ax.bar(data.keys(), data.values(), color='skyblue')

# Add title and labels
ax.set_title('GitHub Statistics for camel-ai/camel Framework')
ax.set_ylabel('Count')

# Rotate x labels for better readability
plt.xticks(rotation=45)

# Save the plot to a file
plt.tight_layout()
plt.savefig('camel_framework_stats.png')
plt.show()

コマンドラインで実行したamazon.comの検索についても実行してみます。
こちらは結果だけ載せます。

DIERYA T68SE 60% Gaming Mechanical Keyboard
全く同じ商品がおすすめされました。
これは偶然なのかシステム的に必然なのかは気になりますね。

まとめ

今回はCAMELフレームワークを基盤としたOWL(Optimized Workforce Learning)について紹介しました。このツールは以下の主要な特徴を備えています:

  • マルチエージェントコラボレーション:複数のAIエージェントが連携して複雑なタスクを解決する仕組み
  • 多様な外部ツール連携:検索エンジン、ブラウザ自動化、ドキュメント解析など幅広いツールキットを活用
  • マルチモーダル処理:テキストだけでなく、画像・動画・音声データの処理にも対応
  • カスタマイズ性:ローカルスクリプトの修正によりモデルやツールの調整が可能

コマンドライン版とWebUI版の両方を試してみた実践からは、以下のような知見が得られました:

  • コマンドライン版:シンプルな実行環境でスクリプトベースの利用が可能。複数エージェントの動作は確認できるものの、処理の過程が非常に詳細でデバッグ用途に適している印象。
  • WebUI版:視覚的に理解しやすく、エージェント間のやり取りが整理されて表示されるためコマンドラインでの実行に比べて実用性が高い。また処理結果(Pythonファイルやグラフなど)も確認しやすい。

manusAIのオープンソース代替製品との前情報でしたが、まだリリースされて1ヶ月程度のツールであり、発展途上の段階にあります。ドキュメントも整備されておらず開発のスピード感に周辺の整備が追いついていないという状況かもしれません。
一方で機能開発が活発に行われているため、今後の進化が楽しみなプロジェクトです。ぜひ皆様もこの記事を参考にOWLを試してみてください。

追記(2025/03/28)

有志の方が日本語訳したweb UIを追加してくれました。
https://github.com/camel-ai/owl/pull/408

今現在、配布されているdocker imageにはまだ該当の差分が取り込まれていないため、ご自身でimageをbuildする必要があります。
build手順は以下に記載されている手順で行えばよいです。

https://github.com/camel-ai/owl/blob/main/README.md#option-2-building-image-locally

また、README.mdにも有志の方が日本語訳を追加してくださっています。
https://github.com/camel-ai/owl/pull/410

2
MIXI DEVELOPERS Tech Blog

Discussion

ログインするとコメントできます