owl Documentation

OWL: Optimized Workforce Learning for General Multi-Agent Assistance in Real-World Task Automation

RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy owl on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name owl --restart always camel-ai/owl:latest

File: README.md

๐Ÿฆ‰ OWL: Optimized Workforce Learning for General Multi-Agent Assistance in Real-World Task Automation


๐Ÿ“‹ Table of Contents

๐Ÿ”ฅ News

  • [2025.09.22]: Exicited to announce that OWL has been accepted by NeurIPS 2025!๐Ÿš€ Check the latest paper here.
  • [2025.07.21]: We open-sourced the training dataset and model checkpoints of OWL project. Training code coming soon. huggingface link.
  • [2025.05.27]: We released the technical report of OWL, including more details on the workforce (framework) and optimized workforce learning (training methodology). paper.
  • [2025.05.18]: We open-sourced an initial version for replicating workforce experiment on GAIA here.
  • [2025.04.18]: We uploaded OWL's new GAIA benchmark score of 69.09%, ranking #1 among open-source frameworks. Check the technical report here.
  • [2025.03.27]: Integrate SearxNGToolkit performing web searches using SearxNG search engine.
  • [2025.03.26]: Enhanced Browser Toolkit with multi-browser support for "chrome", "msedge", and "chromium" channels.
  • [2025.03.25]: Supported Gemini 2.5 Pro, added example run code
  • [2025.03.21]: Integrated OpenRouter model platform, fix bug with Gemini tool calling.
  • [2025.03.20]: Accept header in MCP Toolkit, support automatic playwright installation.
  • [2025.03.16]: Support Bing search, Baidu search.
  • [2025.03.12]: Added Bocha search in SearchToolkit, integrated Volcano Engine model platform, and enhanced Azure and OpenAI Compatible models with structured output and tool calling.
  • [2025.03.11]: We added MCPToolkit, FileWriteToolkit, and TerminalToolkit to enhance OWL agents with MCP tool calling, file writing capabilities, and terminal command execution.
  • [2025.03.09]: We added a web-based user interface that makes it easier to interact with the system.
  • [2025.03.07]: We open-sourced the codebase of the ๐Ÿฆ‰ OWL project.
  • [2025.03.03]: OWL achieved the #1 position among open-source frameworks on the GAIA benchmark with a score of 58.18.

๐ŸŽฌ Demo Video

https://github.com/user-attachments/assets/2a2a825d-39ea-45c5-9ba1-f9d58efbc372

https://private-user-images.githubusercontent.com/55657767/420212194-e813fc05-136a-485f-8df3-f10d9b4e63ec.mp4

This video demonstrates how to install OWL locally and showcases its capabilities as a cutting-edge framework for multi-agent collaboration: https://www.youtube.com/watch?v=8XlqVyAZOr8

โœจ๏ธ Core Features

  • Online Search: Support for multiple search engines (including Wikipedia, Google, DuckDuckGo, Baidu, Bocha, etc.) for real-time information retrieval and knowledge acquisition.
  • Multimodal Processing: Support for handling internet or local videos, images, and audio data.
  • Browser Automation: Utilize the Playwright framework for simulating browser interactions, including scrolling, clicking, input handling, downloading, navigation, and more.
  • Document Parsing: Extract content from Word, Excel, PDF, and PowerPoint files, converting them into text or Markdown format.
  • Code Execution: Write and execute Python code using interpreter.
  • Built-in Toolkits: Access to a comprehensive set of built-in toolkits including:
    • Model Context Protocol (MCP): A universal protocol layer that standardizes AI model interactions with various tools and data sources
    • Core Toolkits: ArxivToolkit, AudioAnalysisToolkit, CodeExecutionToolkit, DalleToolkit, DataCommonsToolkit, ExcelToolkit, GitHubToolkit, GoogleMapsToolkit, GoogleScholarToolkit, ImageAnalysisToolkit, MathToolkit, NetworkXToolkit, NotionToolkit, OpenAPIToolkit, RedditToolkit, SearchToolkit, SemanticScholarToolkit, SymPyToolkit, VideoAnalysisToolkit, WeatherToolkit, BrowserToolkit, and many more for specialized tasks

๐Ÿ› ๏ธ Installation

**Prerequisites**

Install Python

Before installing OWL, ensure you have Python installed (version 3.10, 3.11, or 3.12 is supported):

Note for GAIA Benchmark Users: When running the GAIA benchmark evaluation, please use the gaia58.18 branch which includes a customized version of the CAMEL framework in the owl/camel directory. This version contains enhanced toolkits with improved stability specifically optimized for the GAIA benchmark compared to the standard CAMEL installation.

bash
# Check if Python is installed
python --version

# If not installed, download and install from https://www.python.org/downloads/
# For macOS users with Homebrew:
brew install [email protected]

# For Ubuntu/Debian:
sudo apt update
sudo apt install python3.10 python3.10-venv python3-pip

**Installation Options**

OWL supports multiple installation methods to fit your workflow preferences.

bash
# Clone github repo
git clone https://github.com/camel-ai/owl.git

# Change directory into project directory
cd owl

# Install uv if you don't have it already
pip install uv

# Create a virtual environment and install dependencies
uv venv .venv --python=3.10

# Activate the virtual environment
# For macOS/Linux
source .venv/bin/activate
# For Windows
.venv\Scripts\activate

# Install CAMEL with all dependencies
uv pip install -e .

Option 2: Using venv and pip

bash
# Clone github repo
git clone https://github.com/camel-ai/owl.git

# Change directory into project directory
cd owl

# Create a virtual environment
# For Python 3.10 (also works with 3.11, 3.12)
python3.10 -m venv .venv

# Activate the virtual environment
# For macOS/Linux
source .venv/bin/activate
# For Windows
.venv\Scripts\activate

# Install from requirements.txt
pip install -r requirements.txt --use-pep517

Option 3: Using conda

bash
# Clone github repo
git clone https://github.com/camel-ai/owl.git

# Change directory into project directory
cd owl

# Create a conda environment
conda create -n owl python=3.10

# Activate the conda environment
conda activate owl

# Option 1: Install as a package (recommended)
pip install -e .

# Option 2: Install from requirements.txt
pip install -r requirements.txt --use-pep517

Option 4: Using Docker

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

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

**Building Image Locally**

bash
# For users who need to customize the Docker image or cannot access Docker Hub:
# 1. Open docker-compose.yml
# 2. Comment out the "image: mugglejinx/owl:latest" line
# 3. Uncomment the "build:" section and its nested properties
# 4. Then run:
docker compose up -d --build

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

**Using Convenience Scripts**

bash
# Navigate to container directory
cd .container

# Make the script executable and build the Docker image
chmod +x build_docker.sh
./build_docker.sh

# Run OWL with your question
./run_in_docker.sh "your question"

**Setup Environment Variables**

OWL requires various API keys to interact with different services.

Setting Environment Variables Directly

You can set environment variables directly in your terminal:

  • macOS/Linux (Bash/Zsh):

    bash
    export OPENAI_API_KEY="your-openai-api-key-here"
    # Add other required API keys as needed
  • Windows (Command Prompt):

    batch
    set OPENAI_API_KEY=your-openai-api-key-here
  • Windows (PowerShell):

    powershell
    $env:OPENAI_API_KEY = "your-openai-api-key-here"

Note: Environment variables set directly in the terminal will only persist for the current session.

Alternative: Using a `.env` File

If you prefer using a .env file instead, you can:

  1. Copy and Rename the Template:

    bash
    # For macOS/Linux
    cd owl
    cp .env_template .env
    
    # For Windows
    cd owl
    copy .env_template .env

    Alternatively, you can manually create a new file named .env in the owl directory and copy the contents from .env_template.

  2. Configure Your API Keys:
    Open the .env file in your preferred text editor and insert your API keys in the corresponding fields.

Note: For the minimal example (examples/run_mini.py), you only need to configure the LLM API key (e.g., OPENAI_API_KEY).

**MCP Desktop Commander Setup**

If using MCP Desktop Commander within Docker, run:

bash
npx -y @wonderwhy-er/desktop-commander setup --force-file-protocol

For more detailed Docker usage instructions, including cross-platform support, optimized configurations, and troubleshooting, please refer to DOCKER_README.md.

๐Ÿš€ Quick Start

Basic Usage

After installation and setting up your environment variables, you can start using OWL right away:

bash
python examples/run.py

Running with Different Models

Model Requirements

  • Tool Calling: OWL requires models with robust tool calling capabilities to interact with various toolkits. Models must be able to understand tool descriptions, generate appropriate tool calls, and process tool outputs.

  • Multimodal Understanding: For tasks involving web interaction, image analysis, or video processing, models with multimodal capabilities are required to interpret visual content and context.

Supported Models

For information on configuring AI models, please refer to our CAMEL models documentation.

Note: For optimal performance, we strongly recommend using OpenAI models (GPT-4 or later versions). Our experiments show that other models may result in significantly lower performance on complex tasks and benchmarks, especially those requiring advanced multi-modal understanding and tool use.

OWL supports various LLM backends, though capabilities may vary depending on the model's tool calling and multimodal abilities. You can use the following scripts to run with different models:

bash
# Run with Claude model
python examples/run_claude.py

# Run with Qwen model
python examples/run_qwen_zh.py

# Run with Deepseek model
python examples/run_deepseek_zh.py

# Run with other OpenAI-compatible models
python examples/run_openai_compatible_model.py

# Run with Gemini model
python examples/run_gemini.py

# Run with Azure OpenAI
python examples/run_azure_openai.py

# Run with Ollama
python examples/run_ollama.py

For a simpler version that only requires an LLM API key, you can try our minimal example:

bash
python examples/run_mini.py

You can run OWL agent with your own task by modifying the examples/run.py script:

python
# Define your own task
task = "Task description here."

society = construct_society(question)
answer, chat_history, token_count = run_society(society)

print(f"\033[94mAnswer: {answer}\033[0m")

For uploading files, simply provide the file path along with your question:

python
# Task with a local file (e.g., file path: `tmp/example.docx`)
task = "What is in the given DOCX file? Here is the file path: tmp/example.docx"

society = construct_society(question)
answer, chat_history, token_count = run_society(society)
print(f"\033[94mAnswer: {answer}\033[0m")

OWL will then automatically invoke document-related tools to process the file and extract the answer.

Example Tasks

Here are some tasks you can try with OWL:

  • "Find the latest stock price for Apple Inc."
  • "Analyze the sentiment of recent tweets about climate change"
  • "Help me debug this Python code: [your code here]"
  • "Summarize the main points from this research paper: [paper URL]"
  • "Create a data visualization for this dataset: [dataset path]"

๐Ÿงฐ Toolkits and Capabilities

Model Context Protocol (MCP)

OWL's MCP integration provides a standardized way for AI models to interact with various tools and data sources:

Before using MCP, you need to install Node.js first.

**Install Node.js**

Windows

Download the official installer: Node.js.

Check "Add to PATH" option during installation.

Linux

bash
sudo apt update
sudo apt install nodejs npm -y

Mac

bash
brew install node

**Install Playwright MCP Service**

bash
npm install @executeautomation/playwright-mcp-server
npx playwright install-deps

Try our comprehensive MCP examples:

  • examples/run_mcp.py - Basic MCP functionality demonstration (local call, requires dependencies)
  • examples/run_mcp_sse.py - Example using the SSE protocol (Use remote services, no dependencies)

Available Toolkits

Important: Effective use of toolkits requires models with strong tool calling capabilities. For multimodal toolkits (Web, Image, Video), models must also have multimodal understanding abilities.

OWL supports various toolkits that can be customized by modifying the tools list in your script:

python
# Configure toolkits
tools = [
    *BrowserToolkit(headless=False).get_tools(),  # Browser automation
    *VideoAnalysisToolkit(model=models["video"]).get_tools(),
    *AudioAnalysisToolkit().get_tools(),  # Requires OpenAI Key
    *CodeExecutionToolkit(sandbox="subprocess").get_tools(),
    *ImageAnalysisToolkit(model=models["image"]).get_tools(),
    SearchToolkit().search_duckduckgo,
    SearchToolkit().search_google,  # Comment out if unavailable
    SearchToolkit().search_wiki,
    SearchToolkit().search_bocha,
    SearchToolkit().search_baidu,
    *ExcelToolkit().get_tools(),
    *DocumentProcessingToolkit(model=models["document"]).get_tools(),
    *FileWriteToolkit(output_dir="./").get_tools(),
]

Available Toolkits

Key toolkits include:

Multimodal Toolkits (Require multimodal model capabilities)

  • BrowserToolkit: Browser automation for web interaction and navigation
  • VideoAnalysisToolkit: Video processing and content analysis
  • ImageAnalysisToolkit: Image analysis and interpretation

Text-Based Toolkits

  • AudioAnalysisToolkit: Audio processing (requires OpenAI API)
  • CodeExecutionToolkit: Python code execution and evaluation
  • SearchToolkit: Web searches (Google, DuckDuckGo, Wikipedia)
  • DocumentProcessingToolkit: Document parsing (PDF, DOCX, etc.)

Additional specialized toolkits: ArxivToolkit, GitHubToolkit, GoogleMapsToolkit, MathToolkit, NetworkXToolkit, NotionToolkit, RedditToolkit, WeatherToolkit, and more. For a complete list, see the CAMEL toolkits documentation.

Customizing Your Configuration

To customize available tools:

python
# 1. Import toolkits
from camel.toolkits import BrowserToolkit, SearchToolkit, CodeExecutionToolkit

# 2. Configure tools list
tools = [
    *BrowserToolkit(headless=True).get_tools(),
    SearchToolkit().search_wiki,
    *CodeExecutionToolkit(sandbox="subprocess").get_tools(),
]

# 3. Pass to assistant agent
assistant_agent_kwargs = {"model": models["assistant"], "tools": tools}

Selecting only necessary toolkits optimizes performance and reduces resource usage.

๐ŸŒ Web Interface

Starting the Web UI

bash
# Start the Chinese version
python owl/webapp_zh.py

# Start the English version
python owl/webapp.py

# Start the Japanese version
python owl/webapp_jp.py

Features

  • Easy Model Selection: Choose between different models (OpenAI, Qwen, DeepSeek, etc.)
  • Environment Variable Management: Configure your API keys and other settings directly from the UI
  • Interactive Chat Interface: Communicate with OWL agents through a user-friendly interface
  • Task History: View the history and results of your interactions

The web interface is built using Gradio and runs locally on your machine. No data is sent to external servers beyond what's required for the model API calls you configure.

๐Ÿงช Experiments

To reproduce OWL's GAIA benchmark score:

We also provide an enhanced OWL in the main branch, so you can directly benefit from upgraded toolkits and increased stability even without switching branches.
For the original GAIA-specific performance, we recommend our gaia69 branch.

When running the benchmark evaluation:

  1. Switch to the gaia69 branch:

    bash
    git checkout gaia69
  2. Run the evaluation script:

    bash
    python run_gaia_workforce_claude.py

This will execute the same configuration that achieved our top-ranking performance on the GAIA benchmark.

๐Ÿ“„ License

The source code is licensed under Apache 2.0.

๐Ÿค Contributing

We welcome contributions from the community! Here's how you can help:

  1. Read our Contribution Guidelines
  2. Check open issues or create new ones
  3. Submit pull requests with your improvements

Current Issues Open for Contribution:

To take on an issue, simply leave a comment stating your interest.

๐Ÿ”ฅ Community

Join us (Discord or WeChat) in pushing the boundaries of finding the scaling laws of agents.

Join us for further discussions!

โ“ FAQ

General Questions

Q: Why don't I see Chrome running locally after starting the example script?

A: If OWL determines that a task can be completed using non-browser tools (such as search or code execution), the browser will not be launched. The browser window will only appear when OWL determines that browser-based interaction is necessary.

Q: Which Python version should I use?

A: OWL supports Python 3.10, 3.11, and 3.12.

Q: How can I contribute to the project?

A: See our Contributing section for details on how to get involved. We welcome contributions of all kinds, from code improvements to documentation updates.

Experiment Questions

Q: Which CAMEL version should I use for replicate the role playing result?

A: We provide a modified version of CAMEL (owl/camel) in the gaia58.18 branch. Please make sure you use this CAMEL version for your experiments.

Q: Why are my experiment results lower than the reported numbers?

A: Since the GAIA benchmark evaluates LLM agents in a realistic world, it introduces a significant amount of randomness. Based on user feedback, one of the most common issues for replication is, for example, agents being blocked on certain webpages due to network reasons.
We have uploaded a keywords matching script to help quickly filter out these errors here.
You can also check this technical report for more details when evaluating LLM agents in realistic open-world environments.

๐Ÿ“š Exploring CAMEL Dependency

OWL is built on top of the CAMEL Framework, here's how you can explore the CAMEL source code and understand how it works with OWL:

Accessing CAMEL Source Code

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

๐Ÿ–Š๏ธ Cite

If you find this repo useful, please cite:

text
@misc{hu2025owl,
      title={OWL: Optimized Workforce Learning for General Multi-Agent Assistance in Real-World Task Automation},
      author={Mengkang Hu and Yuhang Zhou and Wendong Fan and Yuzhou Nie and Bowei Xia and Tao Sun and Ziyu Ye and Zhaoxuan Jin and Yingru Li and Qiguang Chen and Zeyu Zhang and Yifeng Wang and Qianshuo Ye and Bernard Ghanem and Ping Luo and Guohao Li},
      year={2025},
      eprint={2505.23885},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2505.23885},
}

โญ Star History


File: community_usecase/Airbnb-MCP/README.md

๐Ÿก CAMEL-AI + MCP: Airbnb Use Case

This example demonstrates how to use the CAMEL-AI OWL framework and MCP (Model Context Protocol) to search for Airbnb listings using a custom MCP server (@openbnb/mcp-server-airbnb). Agents in the OWL framework coordinate to perform tool-augmented travel research in a structured, automated way.


โœจ Use Case

โ€œFind me the best Airbnb in Gurugram with a check-in date of 2025-06-01 and a check-out date of 2025-06-07 for 2 adults. Return the top 5 listings with their names, prices, and locations.โ€

Agents leverage an MCP server to execute real-time Airbnb queries and return formatted results.


๐Ÿ“ฆ Setup

1. Clone and install dependencies

bash
git clone https://github.com/camel-ai/owl
cd owl
pip install -r requirements.txt

2. Configure MCP Server

In your mcp_servers_config.json, add the following:

json
{
  "mcpServers": {
    "airbnb": {
      "command": "npx",
      "args": [
        "-y",
        "@openbnb/mcp-server-airbnb",
        "--ignore-robots-txt"
      ]
    }
  }
}

๐Ÿ› ๏ธ You will need Node.js and NPM installed. Run npx will automatically fetch the Airbnb MCP server.


3. Run the Example Script

bash
python community_usecase/Airbnb_MCP

You can also customize the prompt inside the script itself. Edit the default_task section of Airbnb_MCP.py like this:

python
# Replace this line:
default_task = (
    "here you need to add the task"
)

# Example:
default_task = (
    "Find me the best Airbnb in Gurugram with a check-in date of 2025-06-01 "
    "and a check-out date of 2025-06-07 for 2 adults. Return the top 5 listings with their names, "
    "prices, and locations."
)

This allows agents to work from your hardcoded task without passing anything via command line.


๐Ÿง  How It Works

  • MCPToolkit reads the config and connects to the @openbnb/mcp-server-airbnb.
  • OWL RolePlaying Agents simulate a conversation between a content_curator and a research_assistant.
  • The assistant agent calls the MCP Airbnb server to fetch listings.
  • The results are processed, formatted, and printed.


๐Ÿšง Notes

  • This script uses GPT-4o via OpenAI for both user and assistant roles.
  • Supports async execution and graceful cleanup of agents and MCP sessions.
  • Add retries and fallback logic for production use.

๐Ÿ“Œ References

text
---

## File: community_usecase/a_share_investment_agent_camel/README.md

<h1 align="center">
	๐Ÿฆ‰A่‚กๆŠ•่ต„ไปฃ็†็ณป็ปŸ
</h1>





[English](README_EN.md) |
[ไธญๆ–‡](README.md) |
[่‡ด่ฐข](#-่‡ด่ฐข) |
[็คบไพ‹่ฟ่กŒ็ป“ๆžœ](#-็คบไพ‹่ฟ่กŒ็ป“ๆžœ)

</h4>




## ๐Ÿ“‹ ้กน็›ฎ็ฎ€ไป‹

ๆœฌ้กน็›ฎๆ˜ฏไธ€ไธชๅŸบไบŽOWLๆก†ๆžถๅ’ŒCamelๆก†ๆžถ(v0.2.36)็š„ๅคšไปฃ็†A่‚กๆŠ•่ต„ๅˆ†ๆž็ณป็ปŸ๏ผŒ้€š่ฟ‡ๅคšไธชไธ“ไธš่ง’่‰ฒไปฃ็†ๅไฝœๅฎŒๆˆๆŠ•่ต„ๅˆ†ๆž๏ผŒไธบ็”จๆˆทๆไพ›ๆŠ•่ต„ๅ†ณ็ญ–ๅปบ่ฎฎใ€‚็ณป็ปŸ้‡‡็”จๅคšๆจกๅž‹ๆ”ฏๆŒ๏ผŒๅฏ็ตๆดปไฝฟ็”จไธๅŒ็š„ๅคง่ฏญ่จ€ๆจกๅž‹๏ผˆๅฆ‚Geminiใ€OpenAIใ€Qwen๏ผ‰่ฟ›่กŒๅˆ†ๆžใ€‚

ๆœฌ้กน็›ฎๅ‚ไธŽไบ†OWL็คพๅŒบ็”จไพ‹ๆŒ‘ๆˆ˜่ต›๏ผŒๆ˜ฏๅฏนๅผ€ๆบ้กน็›ฎ[A_Share_investment_Agent](https://github.com/24mlight/A_Share_investment_Agent)็š„ๆ”น่ฟ›็‰ˆๆœฌ๏ผŒไฝฟ็”จOWLๅ’ŒCamelๆก†ๆžถ้‡ๆž„ๅฎž็Žฐใ€‚

### ๐ŸŒŸ ๆ ธๅฟƒ็‰น็‚น

- **ๅคšไปฃ็†ๅไฝœไฝ“็ณป**: ้€š่ฟ‡10ไธชไธ“ไธš่ง’่‰ฒไปฃ็†ๅไฝœ่ฟ›่กŒๅˆ†ๆž๏ผŒๅฎž็Žฐๆ›ดๅ…จ้ขใ€ไธ“ไธš็š„ๆŠ•่ต„ๅ†ณ็ญ–
- **ๅคšๆจกๅž‹ๆ”ฏๆŒ**: ๆ”ฏๆŒGeminiใ€OpenAIใ€Qwen็ญ‰ๅคš็งๅคง่ฏญ่จ€ๆจกๅž‹๏ผŒ็ตๆดปๅˆ‡ๆข
- **A่‚กๅธ‚ๅœบ็‰นๅŒ–**: ไธ“ไธบA่‚กๅธ‚ๅœบ่ฎพ่ฎก๏ผŒๅ…ณๆณจไธญๅ›ฝ่‚กๅธ‚็‰นๆ€งๅ’Œๆ•ฐๆฎ
- **่พฉ่ฎบไธŽๅ†ณ็ญ–ๆœบๅˆถ**: ๅˆ›ๆ–ฐ็š„ๅคš็ฉบ่ง‚็‚น่พฉ่ฎบๆœบๅˆถ๏ผŒๅนณ่กกๅˆ†ๆž่ง‚็‚น
- **ๅฎŒๆ•ด็š„ๆ•ฐๆฎๅค„็†ๆตๆฐด็บฟ**: ไปŽๆ•ฐๆฎๆ”ถ้›†ๅˆฐๅˆ†ๆžๅ†ๅˆฐๅ†ณ็ญ–็š„ๅ…จๆต็จ‹ๆ”ฏๆŒ

## ๐Ÿ—๏ธ ็ณป็ปŸๆžถๆž„

็ณป็ปŸๆžถๆž„ๅŒ…ๅซไปฅไธ‹ๅ‡ ไธชๆ ธๅฟƒไปฃ็†๏ผš

### ๐Ÿ“Š ๆ•ฐๆฎไธŽๅˆ†ๆžๅฑ‚
1. **ๅธ‚ๅœบๆ•ฐๆฎไปฃ็†** (Market Data Agent) - ่ดŸ่ดฃๆ”ถ้›†ๅ’Œ้ข„ๅค„็†ๅธ‚ๅœบๆ•ฐๆฎ
2. **ๆŠ€ๆœฏๅˆ†ๆžไปฃ็†** (Technical Analyst) - ๅˆ†ๆžๆŠ€ๆœฏๆŒ‡ๆ ‡ๅนถ็”Ÿๆˆไบคๆ˜“ไฟกๅท
3. **ๅŸบๆœฌ้ขๅˆ†ๆžไปฃ็†** (Fundamentals Analyst) - ๅˆ†ๆžๅŸบๆœฌ้ขๆ•ฐๆฎๅนถ็”Ÿๆˆไบคๆ˜“ไฟกๅท
4. **ๆƒ…็ปชๅˆ†ๆžไปฃ็†** (Sentiment Analyst) - ๅˆ†ๆžๅธ‚ๅœบๆƒ…็ปชๅนถ็”Ÿๆˆไบคๆ˜“ไฟกๅท
5. **ไปทๅ€ผ่ฏ„ไผฐไปฃ็†** (Valuation Analyst) - ่ฎก็ฎ—่‚ก็ฅจๅ†…ๅœจไปทๅ€ผๅนถ็”Ÿๆˆไบคๆ˜“ไฟกๅท

### ๐Ÿ” ็ ”็ฉถไธŽ่พฉ่ฎบๅฑ‚
6. **ๅคšๅคด็ ”็ฉถๅ‘˜** (Researcher Bull) - ๆไพ›็œ‹ๅคš่ง’ๅบฆๅˆ†ๆž
7. **็ฉบๅคด็ ”็ฉถๅ‘˜** (Researcher Bear) - ๆไพ›็œ‹็ฉบ่ง’ๅบฆๅˆ†ๆž
8. **่พฉ่ฎบๅฎค** (Debate Room) - ๆ•ดๅˆๅคš็ฉบ่ง‚็‚นๅฝขๆˆๆœ€็ปˆ่ง‚็‚น

### ๐Ÿงฎ ๅ†ณ็ญ–ๅฑ‚
9. **้ฃŽ้™ฉ็ฎก็†ไปฃ็†** (Risk Manager) - ่ฎก็ฎ—้ฃŽ้™ฉๆŒ‡ๆ ‡ๅนถ่ฎพ็ฝฎไป“ไฝ้™ๅˆถ
10. **ๆŠ•่ต„็ป„ๅˆ็ฎก็†ไปฃ็†** (Portfolio Manager) - ๅˆถๅฎšๆœ€็ปˆไบคๆ˜“ๅ†ณ็ญ–ๅนถ็”Ÿๆˆ่ฎขๅ•

## ๐Ÿ’ป ๅฎ‰่ฃ…ๆŒ‡ๅ—

### ๅ‰ๆๆกไปถ

- Python 3.9+
- ็›ธๅ…ณAPIๅฏ†้’ฅ๏ผˆGemini/OpenAI/Qwen๏ผ‰

### ๅฎ‰่ฃ…ๆญฅ้ชค

1. ๅ…‹้š†OWLไป“ๅบ“ๅนถ่ฟ›ๅ…ฅ้กน็›ฎ็›ฎๅฝ•
```bash
git clone https://github.com/camel-ai/owl.git
cd owl/community_usecase/a_share_investment_agent_camel
```

2. ๅฎ‰่ฃ…ไพ่ต–
```bash
pip install -r requirements.txt
```

3. ้…็ฝฎ็Žฏๅขƒๅ˜้‡๏ผˆๅˆ›ๅปบ.envๆ–‡ไปถ๏ผ‰
```
# Gemini้…็ฝฎ
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-1.5-flash

# OpenAI้…็ฝฎ
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4o

# Qwen้…็ฝฎ
QWEN_API_KEY=your_qwen_api_key
QWEN_MODEL=qwen-max
QWEN_API_URL=https://your-qwen-api-endpoint
```

### Docker ไฝฟ็”จๆ–นๆณ•

ไธบไบ†็ฎ€ๅŒ–ๅฎ‰่ฃ…ๆต็จ‹๏ผŒๆˆ‘ไปฌๆไพ›ไบ†Dockerๆ”ฏๆŒใ€‚

1. ๆž„ๅปบDocker้•œๅƒ
```bash
docker build -t a-share-investment-agent .
```

2. ๅˆ›ๅปบๅŒ…ๅซAPIๅฏ†้’ฅ็š„.envๆ–‡ไปถ
```bash
# ๅˆ›ๅปบไธŽไธŠ่ฟฐ็›ธๅŒๆ ผๅผ็š„.envๆ–‡ไปถ
touch .env
# ็ผ–่พ‘.envๆ–‡ไปถๆทปๅŠ ๆ‚จ็š„APIๅฏ†้’ฅ
```

## ๐Ÿš€ ไฝฟ็”จๆ–นๆณ•

### ๅŸบๆœฌ็”จๆณ•

```bash
python src/main.py --ticker 000001 --model qwen
```

### ๆต‹่ฏ•ๆจกๅผ

```bash
# ไฝฟ็”จ้ป˜่ฎคๅ‚ๆ•ฐ๏ผˆQwenๆจกๅž‹ๅ’Œ000001่‚ก็ฅจ๏ผ‰่ฟ›่กŒๆต‹่ฏ•
python src/main.py --test

# ๆŒ‡ๅฎš่‚ก็ฅจ่ฟ›่กŒๆต‹่ฏ•
python src/main.py --test --ticker 600036
```

### ๅ‚ๆ•ฐ่ฏดๆ˜Ž

- `--ticker`: ่‚ก็ฅจไปฃ็ 
- `--start-date`: ๅผ€ๅง‹ๆ—ฅๆœŸ (YYYY-MM-DD)
- `--end-date`: ็ป“ๆŸๆ—ฅๆœŸ (YYYY-MM-DD)
- `--show-reasoning`: ๆ˜พ็คบๅˆ†ๆžๆŽจ็†่ฟ‡็จ‹
- `--num-of-news`: ๆƒ…็ปชๅˆ†ๆžไฝฟ็”จ็š„ๆ–ฐ้—ปๆ•ฐ้‡
- `--initial-capital`: ๅˆๅง‹็Žฐ้‡‘้‡‘้ข
- `--initial-position`: ๅˆๅง‹่‚ก็ฅจๆŒไป“
- `--model`: ไฝฟ็”จ็š„ๆจกๅž‹ (gemini, openai, qwen)
- `--test`: ไฝฟ็”จ้ข„่ฎพๅ‚ๆ•ฐ่ฟ่กŒๆต‹่ฏ•ๅŠŸ่ƒฝ

### ็คบไพ‹่ฟ่กŒ็ป“ๆžœ

ไปฅไธ‹ๆ˜ฏ้’ˆๅฏนๅฏ’ๆญฆ็บช-U(688256)่‚ก็ฅจๅœจ2025/01/04-2025/03/24ๆœŸ้—ด็š„ๅˆ†ๆž็ป“ๆžœ็คบไพ‹๏ผš

```bash
python src/main.py --ticker 688256 --start-date 2025-01-04 --end-date 2025-03-24 --model qwen --show-reasoning
```

#### ๅ„ไปฃ็†ๅˆ†ๆžๆ—ฅๅฟ—

**ๅธ‚ๅœบๆ•ฐๆฎไปฃ็†**:
```json
{
"trend": "็ŸญๆœŸ่ถ‹ๅŠฟๅ‘ไธ‹๏ผŒไฝ†้•ฟๆœŸ่ถ‹ๅŠฟไป้œ€่ง‚ๅฏŸ",
"judgment": "ๅฝ“ๅ‰ไปทๆ ผๅค„ไบŽๅธƒๆž—ๅธฆไธญ่ฝจไธ‹ๆ–น๏ผŒRSIๆŽฅ่ฟ‘ไธญๆ€งๆฐดๅนณ๏ผŒMACD็บฟๅœจไฟกๅท็บฟไธ‹ๆ–น๏ผŒ่กจๆ˜Ž็ŸญๆœŸๅฏ่ƒฝ็ปง็ปญ่ฐƒๆ•ดใ€‚ไฝ†่€ƒ่™‘ๅˆฐไน‹ๅ‰็š„ๅคงๅน…ไธŠๆถจ๏ผŒ้•ฟๆœŸ่ถ‹ๅŠฟไป้œ€่ฟ›ไธ€ๆญฅ่ง‚ๅฏŸใ€‚ๅปบ่ฎฎๅ…ณๆณจๆ”ฏๆ’‘ไฝ670.66ๅ’Œ้˜ปๅŠ›ไฝ747.57ใ€‚"
}
```

**ๆŠ€ๆœฏๅˆ†ๆžไปฃ็†**:
```json
{
  "signal": "bearish",
  "confidence": 0.8,
  "reasoning": "ไปŽๆŠ€ๆœฏๆŒ‡ๆ ‡ๆฅ็œ‹๏ผŒ่ฏฅ่‚ก็ฅจ็›ฎๅ‰ๅค„ไบŽไธ€ไธช็›ธๅฏนๅผฑๅŠฟ็š„็Šถๆ€ใ€‚้ฆ–ๅ…ˆ๏ผŒ5ๆ—ฅๅ‡็บฟ๏ผˆ718.856๏ผ‰ๅทฒ็ปไธ‹็ฉฟ10ๆ—ฅๅ‡็บฟ๏ผˆ743.927๏ผ‰ๅ’Œ20ๆ—ฅๅ‡็บฟ๏ผˆ747.574๏ผ‰๏ผŒ่ฟ™่กจๆ˜Ž็ŸญๆœŸ่ถ‹ๅŠฟๆญฃๅœจ่ตฐๅผฑใ€‚MACDๆŒ‡ๆ ‡ไนŸๆ˜พ็คบไบ†็ฑปไผผ็š„่ถ‹ๅŠฟ๏ผŒMACD็บฟ๏ผˆ8.994๏ผ‰ไฝŽไบŽไฟกๅท็บฟ๏ผˆ20.004๏ผ‰๏ผŒๅนถไธ”MACDๆŸฑ็Šถๅ›พ๏ผˆ-11.009๏ผ‰ไธบ่ดŸๅ€ผ๏ผŒ่กจๆ˜Žๅธ‚ๅœบๅŠจ่ƒฝๆญฃๅœจๅ‡ๅผฑใ€‚RSIๆŒ‡ๆ ‡๏ผˆ48.676๏ผ‰ๅค„ไบŽไธญๆ€งๅŒบๅŸŸ๏ผŒไฝ†ๆŽฅ่ฟ‘่ถ…ๅ–ๅŒบๅŸŸ๏ผŒ่ฟ™ๅฏ่ƒฝ้ข„็คบ็€็ŸญๆœŸๅ†…ๅฏ่ƒฝไผšๆœ‰ๅๅผน๏ผŒไฝ†ๆ•ดไฝ“่ถ‹ๅŠฟไป็„ถๅๅผฑใ€‚ๅธƒๆž—ๅธฆๆ–น้ข๏ผŒๅฝ“ๅ‰ไปทๆ ผ๏ผˆ685.05๏ผ‰ๆŽฅ่ฟ‘ๅธƒๆž—ๅธฆไธ‹่ฝจ๏ผˆ670.657๏ผ‰๏ผŒ่ฟ™ๅฏ่ƒฝๆไพ›ไธ€ๅฎš็š„ๆ”ฏๆ’‘๏ผŒไฝ†่€ƒ่™‘ๅˆฐๅ…ถไป–ๆŒ‡ๆ ‡็š„ๅผฑๅŠฟ่กจ็Žฐ๏ผŒๆ”ฏๆ’‘ๅŠ›ๅบฆๅฏ่ƒฝๆœ‰้™ใ€‚็ปผๅˆๆฅ็œ‹๏ผŒๅฝ“ๅ‰็š„ๅธ‚ๅœบ็Žฏๅขƒๅ’ŒๆŠ€ๆœฏๆŒ‡ๆ ‡ๅ‡ๆŒ‡ๅ‘ไธ€ไธชๅ็ฉบ็š„่ถ‹ๅŠฟใ€‚"
}
```

**ๅŸบๆœฌ้ขๅˆ†ๆžไปฃ็†**:
```json
{
  "signal": "bearish",
  "confidence": 0.8,
  "reasoning": "ๅฏ’ๆญฆ็บช-U็š„่ดขๅŠก็Šถๅ†ตๅ’ŒไธšๅŠก่กจ็Žฐๆ˜พ็คบๅ‡บๆ˜Žๆ˜พ็š„่ดŸ้ข่ถ‹ๅŠฟใ€‚้ฆ–ๅ…ˆ๏ผŒๅ…ฌๅธ็š„ๅ‡€ๅˆฉๆถฆๆŒ็ปญไธบ่ดŸ๏ผŒไธ”ไบๆŸ้ขๅœจๆœ€่ฟ‘ๅ‡ ไธชๅญฃๅบฆๆœ‰ๆ‰€ๅขžๅŠ ๏ผŒ่ฟ™่กจๆ˜Žๅ…ฌๅธๅœจ็›ˆๅˆฉ่ƒฝๅŠ›ๆ–น้ขๅญ˜ๅœจไธฅ้‡้—ฎ้ข˜ใ€‚ๅ…ถๆฌก๏ผŒๅ…ฌๅธ็š„่ฅไธšๆ”ถๅ…ฅ่™ฝ็„ถๅœจ2023ๅนด็ฌฌๅ››ๅญฃๅบฆๆœ‰ๆ‰€ๅขž้•ฟ๏ผŒไฝ†้šๅŽๅ‡ ไธชๅญฃๅบฆๅ‡บ็Žฐไบ†ๆ˜พ่‘—ไธ‹้™๏ผŒ่ฟ™ๅฏ่ƒฝๆ„ๅ‘ณ็€ๅธ‚ๅœบ้œ€ๆฑ‚ๆˆ–ๅ…ฌๅธๅธ‚ๅœบไปฝ้ข็š„ๅ‡ๅฐ‘ใ€‚ๆญคๅค–๏ผŒๅ…ฌๅธ็š„ๅธ‚็›ˆ็އไธบ่ดŸ๏ผŒๅธ‚ๅ‡€็އ้ซ˜่พพ52.58๏ผŒ่กจๆ˜Žๅธ‚ๅœบๅฏนๅ…ถไผฐๅ€ผ่ฟ‡้ซ˜๏ผŒๅญ˜ๅœจ่พƒๅคง็š„ๆณกๆฒซ้ฃŽ้™ฉใ€‚ไปŽ่ดขๅŠกๅฅๅบท็Šถๅ†ตๆฅ็œ‹๏ผŒๅฐฝ็ฎกๅ…ฌๅธ็š„่ต„ไบง่ดŸๅ€บ็އ่พƒไฝŽ๏ผŒไฝ†ๅ…ถ็ป่ฅ็Žฐ้‡‘ๆตๆŒ็ปญไธบ่ดŸ๏ผŒ่กจๆ˜Žๅ…ฌๅธๅœจ่ฟ่ฅ่ฟ‡็จ‹ไธญ้ขไธด่พƒๅคง็š„่ต„้‡‘ๅŽ‹ๅŠ›ใ€‚็ปผๅˆไปฅไธŠๅ› ็ด ๏ผŒๆˆ‘ไปฌ่ฎคไธบๅฏ’ๆญฆ็บช-U็š„่‚ก็ฅจ็›ฎๅ‰ๅค„ไบŽ็œ‹่ทŒ็Šถๆ€ใ€‚"
}
```

**ๆƒ…็ปชๅˆ†ๆžไปฃ็†**:
```json
{
  "signal": "bullish",
  "confidence": 0.8,
  "reasoning": "ไปŽๆ–ฐ้—ปๆ•ฐๆฎๆฅ็œ‹๏ผŒๆ•ดไฝ“ๅธ‚ๅœบๆƒ…็ปชๅๅ‘็งฏๆž๏ผŒ็งฏๆžๆ–ฐ้—ปๆ•ฐ้‡่ฟœๅคšไบŽๆถˆๆžๆ–ฐ้—ปใ€‚ๅฐฝ็ฎกๆœ‰ไธ€ๆกๆ–ฐ้—ปๆๅˆฐ่Šฏ็‰‡ETFๅ’Œๅฏ’ๆญฆ็บช-U็š„ไธ‹่ทŒ๏ผŒไฝ†ๅคงๅคšๆ•ฐๆ–ฐ้—ป้ƒฝๅผบ่ฐƒไบ†ๅฏ’ๆญฆ็บช-UๅŠๅ…ถๆ‰€ๅœจๆฟๅ—็š„็งฏๆž่กจ็Žฐ๏ผŒๅŒ…ๆ‹ฌ่‚กไปทไธŠๆถจๅ’ŒๆŠ€ๆœฏ็ช็ ด็ญ‰ใ€‚ๆญคๅค–๏ผŒๅฏ’ๆญฆ็บช-U่ขซ็บณๅ…ฅๅฏŒๆ—ถไธญๅ›ฝA50ๆŒ‡ๆ•ฐ็š„ๆถˆๆฏไนŸ่กจๆ˜Žๅธ‚ๅœบๅฏนๅ…ถ้•ฟๆœŸๅ‰ๆ™ฏๆŒไน่ง‚ๆ€ๅบฆใ€‚็คพไบคๅช’ไฝ“่ฎจ่ฎบไนŸไธป่ฆ้›†ไธญๅœจๅ…ฌๅธ็š„็งฏๆžๅ‘ๅฑ•ไธŠ๏ผŒ่ฟ›ไธ€ๆญฅๆ”ฏๆŒไบ†็œ‹ๆถจ็š„่ง‚็‚นใ€‚",
  "key_events": [
    "ๅฏ’ๆญฆ็บช-U่ขซ็บณๅ…ฅๅฏŒๆ—ถไธญๅ›ฝA50ๆŒ‡ๆ•ฐ",
    "ๅฏ’ๆญฆ็บช-U่‚กไปทๅคšๆฌกไธŠๆถจ",
    "ไบบๅทฅๆ™บ่ƒฝAIETFๆŒไป“่‚กๅฏ’ๆญฆ็บช-Uๅคงๆถจ",
    "ๆ™บๅ…ƒๅฏๅ…ƒๅคงๆจกๅž‹ๅ‘ๅธƒ"
  ]
}
```

**ไผฐๅ€ผๅˆ†ๆžไปฃ็†**:
```json
{
  "signal": "bearish",
  "confidence": 0.85,
  "reasoning": "ๅฏ’ๆญฆ็บช-U็š„่ดขๅŠก็Šถๅ†ตๅ’ŒไธšๅŠก่กจ็Žฐๆ˜พ็คบๅ‡บๆ˜Žๆ˜พ็š„่ดŸ้ข่ถ‹ๅŠฟใ€‚้ฆ–ๅ…ˆ๏ผŒๅ…ฌๅธ็š„ๅ‡€ๅˆฉๆถฆๆŒ็ปญไธบ่ดŸ๏ผŒไธ”ไบๆŸ้ขๅœจๆœ€่ฟ‘ๅ‡ ไธชๅญฃๅบฆๆœ‰ๆ‰€ๅขžๅŠ ๏ผŒ่ฟ™่กจๆ˜Žๅ…ฌๅธๅœจ็›ˆๅˆฉ่ƒฝๅŠ›ๆ–น้ขๅญ˜ๅœจไธฅ้‡้—ฎ้ข˜ใ€‚ๅ…ถๆฌก๏ผŒๅ…ฌๅธ็š„่ฅไธšๆ”ถๅ…ฅ่™ฝ็„ถๅœจ2023ๅนด็ฌฌๅ››ๅญฃๅบฆๆœ‰ๆ‰€ๅขž้•ฟ๏ผŒไฝ†้šๅŽๅ‡ ไธชๅญฃๅบฆๅ‡บ็Žฐไบ†ๆ˜พ่‘—ไธ‹้™๏ผŒ่ฟ™ๅฏ่ƒฝๆ„ๅ‘ณ็€ๅธ‚ๅœบ้œ€ๆฑ‚ๆˆ–ๅ…ฌๅธๅธ‚ๅœบไปฝ้ข็š„ๅ‡ๅฐ‘ใ€‚ๆญคๅค–๏ผŒๅ…ฌๅธ็š„ๅธ‚็›ˆ็އไธบ่ดŸ๏ผŒๅธ‚ๅ‡€็އ้ซ˜่พพ52.58๏ผŒ่กจๆ˜Žๅธ‚ๅœบๅฏนๅ…ถไผฐๅ€ผ่ฟ‡้ซ˜๏ผŒๅญ˜ๅœจ่พƒๅคง็š„ๆณกๆฒซ้ฃŽ้™ฉใ€‚ไปŽ่ดขๅŠกๅฅๅบท็Šถๅ†ตๆฅ็œ‹๏ผŒๅฐฝ็ฎกๅ…ฌๅธ็š„่ต„ไบง่ดŸๅ€บ็އ่พƒไฝŽ๏ผŒไฝ†ๅ…ถ็ป่ฅ็Žฐ้‡‘ๆตๆŒ็ปญไธบ่ดŸ๏ผŒ่กจๆ˜Žๅ…ฌๅธๅœจ่ฟ่ฅ่ฟ‡็จ‹ไธญ้ขไธด่พƒๅคง็š„่ต„้‡‘ๅŽ‹ๅŠ›ใ€‚็ปผๅˆไปฅไธŠๅ› ็ด ๏ผŒๆˆ‘ไปฌ่ฎคไธบๅฏ’ๆญฆ็บช-U็š„่‚ก็ฅจ็›ฎๅ‰ๅค„ไบŽ็œ‹่ทŒ็Šถๆ€ใ€‚ๆญคๅค–๏ผŒ้€š่ฟ‡DCFๆจกๅž‹ๅ’Œ็›ธๅฏนไผฐๅ€ผๆณ•่ฎก็ฎ—๏ผŒๅ…ฌๅธ็š„ๅ†…ๅœจไปทๅ€ผๆ˜พ่‘—ไฝŽไบŽๅฝ“ๅ‰ๅธ‚ๅœบไปทๆ ผ๏ผŒ่ฟ›ไธ€ๆญฅๆ”ฏๆŒไบ†็œ‹่ทŒ็š„่ง‚็‚นใ€‚",
  "fair_value": 200.0,
  "key_metrics": [
    "ๅธ‚็›ˆ็އ",
    "ๅธ‚ๅ‡€็އ",
    "่ฅไธšๆ”ถๅ…ฅ",
    "ๅ‡€ๅˆฉๆถฆ",
    "็ป่ฅ็Žฐ้‡‘ๆต"
  ]
}
```

**ๅคšๅคด็ ”็ฉถๅ‘˜**:
```json
{
  "key_points": [
    "ๅธ‚ๅœบๆƒ…็ปช็งฏๆž๏ผŒๆ–ฐ้—ปๅ’Œ็คพไบคๅช’ไฝ“่ฎจ่ฎบๅๅ‘ไน่ง‚",
    "ๅฏ’ๆญฆ็บช-U่ขซ็บณๅ…ฅๅฏŒๆ—ถไธญๅ›ฝA50ๆŒ‡ๆ•ฐ๏ผŒ่กจๆ˜Žๅธ‚ๅœบๅฏนๅ…ถ้•ฟๆœŸๅ‰ๆ™ฏๆŒไน่ง‚ๆ€ๅบฆ",
    "ๆŠ€ๆœฏ็ช็ ดๅ’Œ่‚กไปทไธŠๆถจ็š„็งฏๆžๆ–ฐ้—ป",
    "ๅฐฝ็ฎกๆŠ€ๆœฏ้ขๅ’ŒๅŸบๆœฌ้ขๆ˜พ็คบๅผฑๅŠฟ๏ผŒไฝ†ๅธ‚ๅœบๆƒ…็ปชๅ’Œๆฝœๅœจๅ‚ฌๅŒ–ๅ‰‚ๅฏ่ƒฝๆŽจๅŠจ่‚กไปทๅๅผน"
  ],
  "confidence": 0.6,
  "reasoning": "ๅฐฝ็ฎกๆŠ€ๆœฏ้ขๅ’ŒๅŸบๆœฌ้ขๅˆ†ๆžๆ˜พ็คบๅฏ’ๆญฆ็บช-U็›ฎๅ‰ๅค„ไบŽๅผฑๅŠฟ็Šถๆ€๏ผŒไฝ†ๅธ‚ๅœบๆƒ…็ปชๅ’Œๆฝœๅœจๅ‚ฌๅŒ–ๅ‰‚ๅฏ่ƒฝๆŽจๅŠจ่‚กไปทๅๅผนใ€‚ๅฏ’ๆญฆ็บช-U่ขซ็บณๅ…ฅๅฏŒๆ—ถไธญๅ›ฝA50ๆŒ‡ๆ•ฐ๏ผŒ่กจๆ˜Žๅธ‚ๅœบๅฏนๅ…ถ้•ฟๆœŸๅ‰ๆ™ฏๆŒไน่ง‚ๆ€ๅบฆใ€‚ๆญคๅค–๏ผŒๅ…ฌๅธ่ฟ‘ๆœŸ็š„ๆŠ€ๆœฏ็ช็ ดๅ’Œ่‚กไปทไธŠๆถจ็š„็งฏๆžๆ–ฐ้—ปไนŸๆ”ฏๆŒไบ†็œ‹ๆถจ็š„่ง‚็‚นใ€‚่™ฝ็„ถๅฝ“ๅ‰็š„่ดขๅŠก็Šถๅ†ตๅ’Œไผฐๅ€ผ่พƒ้ซ˜๏ผŒไฝ†ๅธ‚ๅœบๆƒ…็ปชๅ’Œๆฝœๅœจ็š„็งฏๆžๅ› ็ด ๅฏ่ƒฝไธบ่‚กไปทๆไพ›ๆ”ฏๆ’‘ใ€‚ๅ› ๆญค๏ผŒๆˆ‘ไปฌๅปบ่ฎฎๅœจ็ŸญๆœŸๅ†…ไฟๆŒ่ฐจๆ…Ž๏ผŒไฝ†้•ฟๆœŸๆฅ็œ‹๏ผŒๅฏ’ๆญฆ็บช-Uไปๅ…ทๆœ‰ๆŠ•่ต„ๆฝœๅŠ›ใ€‚"
}
```

**็ฉบๅคด็ ”็ฉถๅ‘˜**:
```json
{
  "key_points": [
    "ๆŠ€ๆœฏๆŒ‡ๆ ‡ๆ˜พ็คบ็ŸญๆœŸ่ถ‹ๅŠฟ่ตฐๅผฑ",
    "ๅ‡€ๅˆฉๆถฆๆŒ็ปญไธบ่ดŸไธ”ไบๆŸๅขžๅŠ ",
    "่ฅไธšๆ”ถๅ…ฅไธ‹้™่กจๆ˜Žๅธ‚ๅœบ้œ€ๆฑ‚ๅ‡ๅฐ‘",
    "ๅธ‚ๅ‡€็އ้ซ˜่พพ52.58๏ผŒไผฐๅ€ผ่ฟ‡้ซ˜",
    "็ป่ฅ็Žฐ้‡‘ๆตๆŒ็ปญไธบ่ดŸ๏ผŒ่ต„้‡‘ๅŽ‹ๅŠ›ๅคง",
    "DCFๆจกๅž‹ๅ’Œ็›ธๅฏนไผฐๅ€ผๆณ•ๆ˜พ็คบๅ†…ๅœจไปทๅ€ผไฝŽไบŽๅธ‚ๅœบไปทๆ ผ"
  ],
  "confidence": 0.8,
  "reasoning": "็ปผๅˆๆŠ€ๆœฏๅˆ†ๆžใ€ๅŸบๆœฌ้ขๅˆ†ๆžใ€ๅธ‚ๅœบๆƒ…็ปชๅˆ†ๆžๅ’Œไผฐๅ€ผๅˆ†ๆž๏ผŒๅฏ’ๆญฆ็บช-U็š„่‚ก็ฅจ็›ฎๅ‰ๅค„ไบŽ็œ‹่ทŒ็Šถๆ€ใ€‚ๆŠ€ๆœฏๆŒ‡ๆ ‡ๆ˜พ็คบ็ŸญๆœŸ่ถ‹ๅŠฟ่ตฐๅผฑ๏ผŒๅŸบๆœฌ้ขๅˆ†ๆžๆ˜พ็คบๅ…ฌๅธ็›ˆๅˆฉ่ƒฝๅŠ›ๅทฎใ€ๅธ‚ๅœบ้œ€ๆฑ‚ๅ‡ๅฐ‘ใ€ไผฐๅ€ผ่ฟ‡้ซ˜ไธ”่ต„้‡‘ๅŽ‹ๅŠ›ๅคงใ€‚ๅฐฝ็ฎกๅธ‚ๅœบๆƒ…็ปชๅๅ‘็งฏๆž๏ผŒไฝ†่ฟ™ไบ›็งฏๆžๆƒ…็ปชไธป่ฆ้›†ไธญๅœจ็ŸญๆœŸไบ‹ไปถไธŠ๏ผŒๆ— ๆณ•ๆŽฉ็›–้•ฟๆœŸๅŸบๆœฌ้ข้—ฎ้ข˜ใ€‚ไผฐๅ€ผๅˆ†ๆž่ฟ›ไธ€ๆญฅๆ”ฏๆŒไบ†็œ‹่ทŒ็š„่ง‚็‚น๏ผŒๅ†…ๅœจไปทๅ€ผๆ˜พ่‘—ไฝŽไบŽๅฝ“ๅ‰ๅธ‚ๅœบไปทๆ ผใ€‚ๅ› ๆญค๏ผŒๅปบ่ฎฎๅ–ๅ‡บๅฏ’ๆญฆ็บช-U็š„่‚ก็ฅจใ€‚"
}
```

**่พฉ่ฎบๅฎค**:
```json
{
  "signal": "neutral",
  "confidence": 0.7,
  "reasoning": "ๅคšๅคดๅ’Œ็ฉบๅคด็ ”็ฉถๅ‘˜็š„่ง‚็‚น้ƒฝๆœ‰ๅ…ถๅˆ็†ๆ€งๅ’Œไพๆฎใ€‚ๅคšๅคด็ ”็ฉถๅ‘˜ๅผบ่ฐƒๅธ‚ๅœบๆƒ…็ปช็งฏๆžใ€ๅฏ’ๆญฆ็บช-U่ขซ็บณๅ…ฅๅฏŒๆ—ถไธญๅ›ฝA50ๆŒ‡ๆ•ฐไปฅๅŠๆŠ€ๆœฏ็ช็ ดๅ’Œ่‚กไปทไธŠๆถจ็š„็งฏๆžๆ–ฐ้—ป๏ผŒ่ฟ™ไบ›ๅ› ็ด ๅฏ่ƒฝๅœจ็ŸญๆœŸๅ†…ไธบ่‚กไปทๆไพ›ๆ”ฏๆ’‘ใ€‚็„ถ่€Œ๏ผŒ็ฉบๅคด็ ”็ฉถๅ‘˜ๆŒ‡ๅ‡บๆŠ€ๆœฏๆŒ‡ๆ ‡ๆ˜พ็คบ็ŸญๆœŸ่ถ‹ๅŠฟ่ตฐๅผฑ๏ผŒๅŸบๆœฌ้ขๅˆ†ๆžๆ˜พ็คบๅ…ฌๅธ็›ˆๅˆฉ่ƒฝๅŠ›ๅทฎใ€ๅธ‚ๅœบ้œ€ๆฑ‚ๅ‡ๅฐ‘ใ€ไผฐๅ€ผ่ฟ‡้ซ˜ไธ”่ต„้‡‘ๅŽ‹ๅŠ›ๅคงใ€‚ๅฐฝ็ฎกๅธ‚ๅœบๆƒ…็ปชๅๅ‘็งฏๆž๏ผŒไฝ†่ฟ™ไบ›็งฏๆžๆƒ…็ปชไธป่ฆ้›†ไธญๅœจ็ŸญๆœŸไบ‹ไปถไธŠ๏ผŒๆ— ๆณ•ๆŽฉ็›–้•ฟๆœŸๅŸบๆœฌ้ข้—ฎ้ข˜ใ€‚็ปผๅˆๆฅ็œ‹๏ผŒ็ŸญๆœŸๅ†…ๅธ‚ๅœบๆƒ…็ปชๅ’ŒๆŠ€ๆœฏ็ช็ ดๅฏ่ƒฝๆŽจๅŠจ่‚กไปทๅๅผน๏ผŒไฝ†้•ฟๆœŸๅŸบๆœฌ้ข้—ฎ้ข˜ไป็„ถๅญ˜ๅœจ๏ผŒๅ› ๆญคๅปบ่ฎฎไฟๆŒไธญ็ซ‹ๆ€ๅบฆ๏ผŒ็ญ‰ๅพ…ๆ›ดๅคšๆ˜Ž็กฎไฟกๅทใ€‚",
  "final_verdict": "ๅปบ่ฎฎๆŠ•่ต„่€…ๅœจ็ŸญๆœŸๅ†…ไฟๆŒ่ฐจๆ…Ž๏ผŒๅ…ณๆณจๅธ‚ๅœบๆƒ…็ปชๅ’ŒๆŠ€ๆœฏ็ช็ ด็š„ๆŒ็ปญๆ€งใ€‚้•ฟๆœŸๆฅ็œ‹๏ผŒ้œ€่ฆๅฏ†ๅˆ‡ๅ…ณๆณจๅ…ฌๅธ็š„ๅŸบๆœฌ้ขๆ”นๅ–„ๆƒ…ๅ†ต๏ผŒ็‰นๅˆซๆ˜ฏ็›ˆๅˆฉ่ƒฝๅŠ›ใ€ๅธ‚ๅœบ้œ€ๆฑ‚ๅ’Œ่ต„้‡‘ๅŽ‹ๅŠ›็ญ‰ๆ–น้ขใ€‚ๅœจๆฒกๆœ‰ๆ›ดๅคšๆ˜Ž็กฎไฟกๅทไน‹ๅ‰๏ผŒๅปบ่ฎฎไฟๆŒไธญ็ซ‹ๆ€ๅบฆ๏ผŒ้ฟๅ…่ฟ‡ๅบฆไน่ง‚ๆˆ–ๆ‚ฒ่ง‚ใ€‚"
}
```

**้ฃŽ้™ฉ็ฎก็†ไปฃ็†**:
```json
{
  "max_position_size": 0.2,
  "volatility": 0.15,
  "risk_score": 0.7,
  "max_drawdown": 0.25,
  "suggested_position_size": 0.15,
  "reasoning": "้‰ดไบŽ่‚ก็ฅจ688256่พƒ้ซ˜็š„ๆณขๅŠจๆ€งๅ’ŒๅŸบๆœฌ้ข้ฃŽ้™ฉ๏ผŒๅปบ่ฎฎ้‡‡ๅ–่ฐจๆ…Žๆ€ๅบฆใ€‚่™ฝ็„ถ็ŸญๆœŸๅ†…ๅญ˜ๅœจๆŠ€ๆœฏ็ช็ ด็š„ๅฏ่ƒฝๆ€ง๏ผŒไฝ†้•ฟๆœŸๆฅ็œ‹ๅ…ฌๅธ้ขไธด็›ˆๅˆฉ่ƒฝๅŠ›ๅทฎ็ญ‰้—ฎ้ข˜ใ€‚ๅ› ๆญค๏ผŒๅปบ่ฎฎๆŽงๅˆถๆŒไป“ๆฏ”ไพ‹ไธ่ถ…่ฟ‡20%๏ผŒๅนถ่ฎพ็ฝฎ้€‚ๅฝ“็š„ๆญขๆŸ็‚นไปฅไฟๆŠค่ต„ๆœฌใ€‚ๅŒๆ—ถ๏ผŒ้€š่ฟ‡ๅคšๆ ทๅŒ–ๆŠ•่ต„ๆฅๅˆ†ๆ•ฃ้ฃŽ้™ฉใ€‚"
}
```

**ๆŠ•่ต„็ป„ๅˆ็ฎก็†ไปฃ็†๏ผˆๆœ€็ปˆๅ†ณ็ญ–๏ผ‰**:
```json
{
  "action": "hold",
  "quantity": 0,
  "confidence": 0.8,
  "reasoning": "็ปผๅˆ่€ƒ่™‘ๅ„็ฑปๅˆ†ๆžๅธˆ็š„ไบคๆ˜“ไฟกๅทใ€่พฉ่ฎบ็ป“ๆžœใ€้ฃŽ้™ฉๅˆ†ๆžใ€ๅฝ“ๅ‰ๆŠ•่ต„็ป„ๅˆ็Šถๅ†ตไปฅๅŠๆœ€ๆ–ฐๅธ‚ๅœบไปทๆ ผ๏ผŒๆˆ‘ไปฌๅ†ณๅฎšๅฏน่‚ก็ฅจ688256้‡‡ๅ–ๆŒๆœ‰็ญ–็•ฅใ€‚ๆŠ€ๆœฏๅˆ†ๆžๅ’ŒๅŸบๆœฌ้ขๅˆ†ๆžๅ‡ๆ˜พ็คบ่ฏฅ่‚ก็ฅจๅค„ไบŽๅผฑๅŠฟ็Šถๆ€๏ผŒๆŠ€ๆœฏๆŒ‡ๆ ‡ๆ˜พ็คบ็ŸญๆœŸ่ถ‹ๅŠฟ่ตฐๅผฑ๏ผŒๅŸบๆœฌ้ขๆ˜พ็คบๅ…ฌๅธ็›ˆๅˆฉ่ƒฝๅŠ›ๅทฎใ€ๅธ‚ๅœบ้œ€ๆฑ‚ๅ‡ๅฐ‘ใ€ไผฐๅ€ผ่ฟ‡้ซ˜ไธ”่ต„้‡‘ๅŽ‹ๅŠ›ๅคงใ€‚ๅฐฝ็ฎกๆƒ…็ปชๅˆ†ๆžๆ˜พ็คบๅธ‚ๅœบๆƒ…็ปชๅๅ‘็งฏๆž๏ผŒไฝ†่ฟ™ไบ›็งฏๆžๆƒ…็ปชไธป่ฆ้›†ไธญๅœจ็ŸญๆœŸไบ‹ไปถไธŠ๏ผŒๆ— ๆณ•ๆŽฉ็›–้•ฟๆœŸๅŸบๆœฌ้ข้—ฎ้ข˜ใ€‚่พฉ่ฎบ็ป“ๆžœไนŸๅปบ่ฎฎๅœจ็ŸญๆœŸๅ†…ไฟๆŒ่ฐจๆ…Ž๏ผŒๅ…ณๆณจๅธ‚ๅœบๆƒ…็ปชๅ’ŒๆŠ€ๆœฏ็ช็ ด็š„ๆŒ็ปญๆ€งใ€‚้•ฟๆœŸๆฅ็œ‹๏ผŒ้œ€่ฆๅฏ†ๅˆ‡ๅ…ณๆณจๅ…ฌๅธ็š„ๅŸบๆœฌ้ขๆ”นๅ–„ๆƒ…ๅ†ตใ€‚้ฃŽ้™ฉๅˆ†ๆžๅปบ่ฎฎๆŽงๅˆถๆŒไป“ๆฏ”ไพ‹ไธ่ถ…่ฟ‡20%๏ผŒๅนถ่ฎพ็ฝฎ้€‚ๅฝ“็š„ๆญขๆŸ็‚นไปฅไฟๆŠค่ต„ๆœฌใ€‚ๅ› ๆญค๏ผŒๆˆ‘ไปฌๅ†ณๅฎšๆš‚ๆ—ถๆŒๆœ‰่ฏฅ่‚ก็ฅจ๏ผŒ็ญ‰ๅพ…ๆ›ดๅคšๆ˜Ž็กฎไฟกๅทใ€‚"
}
```

#### ็ปผๅˆ็ป“่ฎบ

**ๆœ€็ปˆๆŠ•่ต„ๅ†ณ็ญ–**: ๆŒๆœ‰ (็ฝฎไฟกๅบฆ: 0.8)

ๅคšไธชไธ“ไธšไปฃ็†็š„ๅˆ†ๆž็ป“ๆžœ่กจๆ˜Ž๏ผŒๅฏ’ๆญฆ็บช-U(688256)่‚ก็ฅจ็›ฎๅ‰ๅค„ไบŽๆŠ€ๆœฏๅ’ŒๅŸบๆœฌ้ข็š„ๅผฑๅŠฟ็Šถๆ€๏ผŒไฝ†ๅธ‚ๅœบๆƒ…็ปชๅ’Œ็ŸญๆœŸไบ‹ไปถๅฏ่ƒฝไธบ่‚กไปทๆไพ›ๆ”ฏๆ’‘ใ€‚็ปผๅˆ่€ƒ่™‘ๅ„ๆ–น้ขๅ› ็ด ๏ผŒ็ณป็ปŸๅปบ่ฎฎๅฏน่ฏฅ่‚ก็ฅจ้‡‡ๅ–ๆŒๆœ‰็ญ–็•ฅ๏ผŒๅฏ†ๅˆ‡ๅ…ณๆณจๅŽ็ปญๅŸบๆœฌ้ขๅ˜ๅŒ–ๅ’Œๅธ‚ๅœบๆƒ…็ปชๅ˜ๅŒ–ใ€‚ๅŒๆ—ถ๏ผŒ้ฃŽ้™ฉ็ฎก็†ๅปบ่ฎฎๅฐ†่ฏฅ่‚ก็ฅจ็š„ๆœ€ๅคงๆŒไป“ๆฏ”ไพ‹ๆŽงๅˆถๅœจๆŠ•่ต„็ป„ๅˆ็š„20%ไปฅๅ†…๏ผŒๅนถ่ฎพ็ฝฎ้€‚ๅฝ“็š„ๆญขๆŸ็‚นไปฅๆŽงๅˆถ้ฃŽ้™ฉใ€‚

## ๐Ÿ”„ ๆ•ฐๆฎๆต็จ‹่ฏดๆ˜Ž

็ณป็ปŸ็š„ๆ•ฐๆฎๆต็จ‹้ตๅพชไปฅไธ‹ๆญฅ้ชค๏ผš

1. **ๆ•ฐๆฎ้‡‡้›†**: ๅธ‚ๅœบๆ•ฐๆฎไปฃ็†้€š่ฟ‡akshare APIๆ”ถ้›†A่‚กๅธ‚ๅœบๆ•ฐๆฎๅ’Œๆ–ฐ้—ป
2. **ๅคš็ปดๅˆ†ๆž**: ็”ฑ4ไธชไธ“ไธšๅˆ†ๆžไปฃ็†๏ผˆๆŠ€ๆœฏใ€ๅŸบๆœฌ้ขใ€ๆƒ…็ปชใ€ไผฐๅ€ผ๏ผ‰็‹ฌ็ซ‹่ฟ›่กŒๅˆ†ๆž
3. **ๆญฃๅ็ ”็ฉถ**: ๅคšๅคดๅ’Œ็ฉบๅคด็ ”็ฉถๅ‘˜ๅˆ†ๅˆซไปŽ็œ‹ๅคšๅ’Œ็œ‹็ฉบ่ง’ๅบฆๆไพ›ๅˆ†ๆžๆŠฅๅ‘Š
4. **่พฉ่ฎบๆ•ดๅˆ**: ่พฉ่ฎบๅฎคๆ•ดๅˆๅคš็ฉบ่ง‚็‚นๅฝขๆˆๆœ€็ปˆๅˆ†ๆžๆ„่ง
5. **้ฃŽ้™ฉ่ฏ„ไผฐ**: ้ฃŽ้™ฉ็ฎก็†ไปฃ็†่ฏ„ไผฐๆŠ•่ต„้ฃŽ้™ฉๅนถ่ฎพ็ฝฎไบคๆ˜“้™ๅˆถ
6. **ๆœ€็ปˆๅ†ณ็ญ–**: ๆŠ•่ต„็ป„ๅˆ็ฎก็†ไปฃ็†ๅˆถๅฎšๆœ€็ปˆไบคๆ˜“ๅ†ณ็ญ–ๅนถ็”Ÿๆˆ่ฎขๅ•



## ๐Ÿ“‹ ้กน็›ฎ็ป“ๆž„

```
community_usecase/a_share_investment_agent_camel/
โ”œโ”€โ”€ src/                       # ๆบไปฃ็ ็›ฎๅฝ•
โ”‚   โ”œโ”€โ”€ agents/                # ไปฃ็†ๅฎž็Žฐ
โ”‚   โ”‚   โ”œโ”€โ”€ base_agent.py      # ไปฃ็†ๅŸบ็ฑป
โ”‚   โ”‚   โ”œโ”€โ”€ market_data_agent.py  # ๅธ‚ๅœบๆ•ฐๆฎไปฃ็†
โ”‚   โ”‚   โ”œโ”€โ”€ technical_analyst.py  # ๆŠ€ๆœฏๅˆ†ๆžไปฃ็†
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ tools/                 # ๅทฅๅ…ทๆจกๅ—
โ”‚   โ”‚   โ””โ”€โ”€ data_helper.py     # ๆ•ฐๆฎ่พ…ๅŠฉๅทฅๅ…ท
โ”‚   โ”œโ”€โ”€ utils/                 # ๅฎž็”จๅทฅๅ…ท
โ”‚   โ”‚   โ””โ”€โ”€ logging_utils.py   # ๆ—ฅๅฟ—ๅทฅๅ…ท
โ”‚   โ”œโ”€โ”€ models.py              # ๆ•ฐๆฎๆจกๅž‹ๅฎšไน‰
โ”‚   โ”œโ”€โ”€ roles.py               # ่ง’่‰ฒๅฎšไน‰
โ”‚   โ””โ”€โ”€ main.py                # ไธป็จ‹ๅบ
โ”œโ”€โ”€ tests/                     # ๆต‹่ฏ•็›ฎๅฝ•
โ”œโ”€โ”€ logs/                      # ๆ—ฅๅฟ—ๆ–‡ไปถ
โ”œโ”€โ”€ .env                       # ็Žฏๅขƒๅ˜้‡
โ”œโ”€โ”€ pyproject.toml             # Poetry้…็ฝฎ
โ”œโ”€โ”€ requirements.txt           # ไพ่ต–้กน
โ””โ”€โ”€ README.md                  # ่ฏดๆ˜Žๆ–‡ๆกฃ
```

## ๐Ÿ” ไปฃ็ ๅฎž็Žฐไบฎ็‚น

### 1. ๅคšไปฃ็†ๅไฝœๆžถๆž„

ๆœฌ้กน็›ฎๅฎž็Žฐไบ†10ไธชไธ“ไธš่ง’่‰ฒ็š„ไปฃ็†๏ผŒๆฏไธชไปฃ็†่ดŸ่ดฃๆŠ•่ต„ๅˆ†ๆžๆต็จ‹ไธญ็š„็‰นๅฎšไปปๅŠกใ€‚ไปฃ็†ไน‹้—ด้€š่ฟ‡ๆถˆๆฏไผ ้€’่ฟ›่กŒๅไฝœ๏ผŒๅฝขๆˆๅฎŒๆ•ด็š„ๅˆ†ๆžๅ†ณ็ญ–้“พๆกใ€‚

```python
# ๅˆ›ๅปบไปฃ็†
market_data_agent = MarketDataAgent(show_reasoning=show_reasoning, model_name=model_name)
technical_analyst = TechnicalAnalystAgent(show_reasoning=show_reasoning, model_name=model_name)
fundamentals_analyst = FundamentalsAnalystAgent(show_reasoning=show_reasoning, model_name=model_name)
sentiment_analyst = SentimentAnalystAgent(show_reasoning=show_reasoning, model_name=model_name)
valuation_analyst = ValuationAnalystAgent(show_reasoning=show_reasoning, model_name=model_name)
researcher_bull = ResearcherBullAgent(show_reasoning=show_reasoning, model_name=model_name)
researcher_bear = ResearcherBearAgent(show_reasoning=show_reasoning, model_name=model_name)
debate_room = DebateRoomAgent(show_reasoning=show_reasoning, model_name=model_name)
risk_manager = RiskManagerAgent(show_reasoning=show_reasoning, model_name=model_name)
portfolio_manager = PortfolioManagerAgent(show_reasoning=show_reasoning, model_name=model_name)
```

### 2. ็ตๆดป็š„ๅคšๆจกๅž‹ๆ”ฏๆŒ

็ณป็ปŸๆ”ฏๆŒๅŒ…ๆ‹ฌGeminiใ€OpenAIๅ’ŒQwenๅœจๅ†…็š„ๅคš็งๅคง่ฏญ่จ€ๆจกๅž‹๏ผŒ้€š่ฟ‡็ปŸไธ€็š„ๆŽฅๅฃๅฎž็Žฐ็ตๆดปๅˆ‡ๆขใ€‚

```python
def get_llm_client(model_name: str):
    """่Žทๅ–ๆŒ‡ๅฎš็š„LLMๅฎขๆˆท็ซฏ"""
    if model_name.lower() == 'gemini':
        return GeminiClient()
    elif model_name.lower() == 'openai':
        return OpenAIClient()
    elif model_name.lower() == 'qwen':
        return QwenClient()
    else:
        raise ValueError(f"ไธๆ”ฏๆŒ็š„ๆจกๅž‹: {model_name}")
```



## ๐Ÿ“ ๆ”น่ฟ›ไธŽๅˆ›ๆ–ฐ

็›ธ่พƒไบŽๅŽŸๅง‹็‰ˆๆœฌ๏ผŒๅŸบไบŽCamelๆก†ๆžถ้‡ๆž„็š„็ณป็ปŸๅ…ทๆœ‰ไปฅไธ‹ๅˆ›ๆ–ฐๅ’Œๆ”น่ฟ›๏ผš

1. **ๆจกๅ—ๅŒ–่ฎพ่ฎก**: ๆ›ดๆธ…ๆ™ฐ็š„ไปฃ็†ๅฎšไน‰ๅ’Œ็ณป็ปŸ็ป“ๆž„๏ผŒไพฟไบŽๆ‰ฉๅฑ•ๅ’Œ็ปดๆŠค
2. **ๅคšๆจกๅž‹ๆ”ฏๆŒ**: ็ตๆดปๆ”ฏๆŒๅคš็งLLMๆจกๅž‹๏ผŒๆ้ซ˜็ณป็ปŸ้€‚ๅบ”ๆ€ง
3. **ๅฎŒๅ–„็š„ๆ—ฅๅฟ—็ณป็ปŸ**: ่ฏฆ็ป†่ฎฐๅฝ•ๅ„ไปฃ็†็š„ๅทฅไฝœ่ฟ‡็จ‹๏ผŒไพฟไบŽ่ฐƒ่ฏ•ๅ’Œๅˆ†ๆž


## โš ๏ธ ๅ…่ดฃๅฃฐๆ˜Ž

ๆœฌ้กน็›ฎไป…็”จไบŽ**ๆ•™่‚ฒๅ’Œ็ ”็ฉถ็›ฎ็š„**ใ€‚

- ไธ้€‚็”จไบŽๅฎž้™…ไบคๆ˜“ๆˆ–ๆŠ•่ต„
- ไธๆไพ›ไปปไฝ•ไฟ่ฏ
- ่ฟ‡ๅพ€ไธš็ปฉไธไปฃ่กจๆœชๆฅ่กจ็Žฐ
- ๅˆ›ๅปบ่€…ไธๆ‰ฟๆ‹…ไปปไฝ•่ดขๅŠกๆŸๅคฑ่ดฃไปป
- ๆŠ•่ต„ๅ†ณ็ญ–่ฏทๅ’จ่ฏขไธ“ไธš็†่ดข้กพ้—ฎ

ไฝฟ็”จๆœฌ่ฝฏไปถๅณ่กจ็คบๆ‚จๅŒๆ„ไป…ๅฐ†ๅ…ถ็”จไบŽๅญฆไน ็›ฎ็š„ใ€‚

## ๐Ÿ“š ็›ธๅ…ณ่ต„ๆบ

- [OWLๆก†ๆžถๅฎ˜ๆ–นๆ–‡ๆกฃ](https://github.com/camel-ai/owl)
- [Camelๆก†ๆžถๅฎ˜ๆ–นๆ–‡ๆกฃ](https://github.com/camel-ai/camel)
- [A_Share_investment_Agent](https://github.com/24mlight/A_Share_investment_Agent)

## ๐Ÿ™ ่‡ด่ฐข

ๆœฌ้กน็›ฎๅŸบไบŽไปฅไธ‹ๅผ€ๆบ้กน็›ฎ่ฟ›่กŒๆ”น่ฟ›๏ผš

1. [A_Share_investment_Agent](https://github.com/24mlight/A_Share_investment_Agent) - ๅŽŸๅง‹A่‚กๆŠ•่ต„ไปฃ็†้กน็›ฎ๏ผŒไธบๆœฌ้กน็›ฎๆไพ›ไบ†ๅŸบ็ก€ๆžถๆž„ๅ’ŒๆŠ•่ต„ๅˆ†ๆžๆ€่ทฏ๏ผŒ็‰นๅˆซๆ„Ÿ่ฐขๅ…ถๅœจA่‚กๆ•ฐๆฎๅค„็†ๅ’Œๅˆ†ๆž็ญ–็•ฅๆ–น้ข็š„ๅˆ›ๆ–ฐ่ฎพ่ฎกใ€‚
2. [ai-hedge-fund](https://github.com/virattt/ai-hedge-fund.git) - ๅŽŸๅง‹็พŽ่‚กๆŠ•่ต„ไปฃ็†้กน็›ฎ
3. [Camelๆก†ๆžถ](https://github.com/camel-ai/camel) - ๅคšไปฃ็†ๅฏน่ฏๆก†ๆžถ
4. [OWLๆก†ๆžถ](https://github.com/camel-ai/owl) - ๅผ€ๆบๅคšๆ™บ่ƒฝไฝ“ๅไฝœๆก†ๆžถ

ๆ„Ÿ่ฐขๆ‰€ๆœ‰ๅŽŸไฝœ่€…็š„่ดก็Œฎๅ’Œๅฏๅ‘๏ผŒไธบๆœฌ้กน็›ฎๆไพ›ไบ†ๅšๅฎž็š„ๅŸบ็ก€ใ€‚

---

## File: community_usecase/a_share_investment_agent_camel/README_EN.md

<h1 align="center">
	๐Ÿฆ‰A-Share Investment Agent System
</h1>





[English](README_EN.md) |
[ไธญๆ–‡](README.md) |
[Acknowledgements](#-acknowledgements) |
[Example Results](#-example-results)

</h4>




## ๐Ÿ“‹ Project Introduction

This project is a multi-agent A-share investment analysis system based on the OWL framework and Camel framework (v0.2.36), which completes investment analysis through multiple professional role agents working together to provide investment decision recommendations for users. The system adopts multi-model support and can flexibly use different large language models (such as Gemini, OpenAI, Qwen) for analysis.

This project participated in the OWL community use case challenge and is an improved version of the open-source project [A_Share_investment_Agent](https://github.com/24mlight/A_Share_investment_Agent), restructured using the OWL and Camel frameworks.

### ๐ŸŒŸ Core Features

- **Multi-agent Collaboration System**: Analysis through 10 professional role agents working together to achieve more comprehensive and professional investment decisions
- **Multi-model Support**: Support for multiple large language models such as Gemini, OpenAI, Qwen, with flexible switching
- **A-share Market Specialization**: Designed specifically for the A-share market, focusing on Chinese stock market characteristics and data
- **Debate and Decision Mechanism**: Innovative bull and bear perspective debate mechanism to balance analytical viewpoints
- **Complete Data Processing Pipeline**: Full process support from data collection to analysis to decision-making

## ๐Ÿ—๏ธ System Architecture

The system architecture includes the following core agents:

### ๐Ÿ“Š Data and Analysis Layer
1. **Market Data Agent** - Responsible for collecting and preprocessing market data
2. **Technical Analyst** - Analyzes technical indicators and generates trading signals
3. **Fundamentals Analyst** - Analyzes fundamental data and generates trading signals
4. **Sentiment Analyst** - Analyzes market sentiment and generates trading signals
5. **Valuation Analyst** - Calculates the intrinsic value of stocks and generates trading signals

### ๐Ÿ” Research and Debate Layer
6. **Researcher Bull** - Provides bullish perspective analysis
7. **Researcher Bear** - Provides bearish perspective analysis
8. **Debate Room** - Integrates bull and bear perspectives to form a final viewpoint

### ๐Ÿงฎ Decision Layer
9. **Risk Manager** - Calculates risk indicators and sets position limits
10. **Portfolio Manager** - Formulates the final trading decision and generates orders

## ๐Ÿ’ป Installation Guide

### Prerequisites

- Python 3.9+
- Related API keys (Gemini/OpenAI/Qwen)

### Installation Steps

1. Clone the OWL repository and enter the project directory
```bash
git clone https://github.com/camel-ai/owl.git
cd owl/community_usecase/a_share_investment_agent_camel
```

2. Install dependencies
```bash
pip install -r requirements.txt
```

3. Configure environment variables (create .env file)
```
# Gemini Configuration
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-1.5-flash

# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4o

# Qwen Configuration
QWEN_API_KEY=your_qwen_api_key
QWEN_MODEL=qwen-max
QWEN_API_URL=https://your-qwen-api-endpoint
```

### Docker Usage Method

To simplify the installation process, we provide Docker support.

1. Build Docker image
```bash
docker build -t a-share-investment-agent .
```

2. Create a .env file containing API keys
```bash
# Create a .env file with the same format as above
touch .env
# Edit the .env file to add your API keys
```

## ๐Ÿš€ Usage

### Basic Usage

```bash
python src/main.py --ticker 000001 --model qwen
```

### Test Mode

```bash
# Use default parameters (Qwen model and 000001 stock) for testing
python src/main.py --test

# Specify stock for testing
python src/main.py --test --ticker 600036
```

### Parameter Description

- `--ticker`: Stock code
- `--start-date`: Start date (YYYY-MM-DD)
- `--end-date`: End date (YYYY-MM-DD)
- `--show-reasoning`: Display analysis reasoning process
- `--num-of-news`: Number of news used for sentiment analysis
- `--initial-capital`: Initial cash amount
- `--initial-position`: Initial stock position
- `--model`: Model to use (gemini, openai, qwen)
- `--test`: Run test function with preset parameters

## ๐Ÿš€ Example Results

### Analysis Results

Below is an example of the analysis results for Cambricon-U (688256) stock during the period 2025/01/04-2025/03/24:

```bash
python src/main.py --ticker 688256 --start-date 2025-01-04 --end-date 2025-03-24 --model qwen --show-reasoning
```

#### Agent Analysis Logs

**Market Data Agent**:
```json
{
"trend": "Short-term trend is downward, but long-term trend still needs observation",
"judgment": "Current price is below the middle Bollinger band, RSI is close to neutral level, MACD line is below the signal line, indicating short-term adjustment may continue. However, considering the previous significant rise, the long-term trend still needs further observation. Recommend paying attention to support level 670.66 and resistance level 747.57."
}
```

**Technical Analyst**:
```json
{
  "signal": "bearish",
  "confidence": 0.8,
  "reasoning": "From technical indicators, the stock is currently in a relatively weak state. First, the 5-day moving average (718.856) has crossed below the 10-day (743.927) and 20-day (747.574) moving averages, indicating the short-term trend is weakening. The MACD indicator also shows a similar trend, with the MACD line (8.994) below the signal line (20.004), and the MACD histogram (-11.009) negative, indicating market momentum is weakening. The RSI indicator (48.676) is in neutral territory but approaching oversold territory, which may indicate a short-term rebound, but the overall trend remains weak. On the Bollinger Bands, the current price (685.05) is close to the lower band (670.657), which may provide some support, but considering the weakness shown by other indicators, the support may be limited. Overall, the current market environment and technical indicators point toward a bearish trend."
}
```

**Fundamentals Analyst**:
```json
{
  "signal": "bearish",
  "confidence": 0.8,
  "reasoning": "Cambricon-U's financial condition and business performance show clear negative trends. First, the company's net profit continues to be negative, and the loss amount has increased in recent quarters, indicating serious problems with profitability. Second, although the company's operating revenue increased in the fourth quarter of 2023, it experienced a significant decline in subsequent quarters, which may indicate a decrease in market demand or company market share. Additionally, the company's P/E ratio is negative, and its P/B ratio is as high as 52.58, indicating overvaluation in the market with significant bubble risk. From a financial health perspective, although the company has a low debt-to-asset ratio, its operating cash flow continues to be negative, indicating the company faces significant financial pressure in operations. Considering these factors, we believe Cambricon-U's stock is currently bearish."
}
```

**Sentiment Analyst**:
```json
{
  "signal": "bullish",
  "confidence": 0.8,
  "reasoning": "From the news data, the overall market sentiment is positive, with positive news far outnumbering negative news. Although one news item mentions the decline of chip ETFs and Cambricon-U, most news emphasizes the positive performance of Cambricon-U and its sector, including stock price increases and technological breakthroughs. Additionally, the news of Cambricon-U being included in the FTSE China A50 Index indicates the market's optimistic outlook for its long-term prospects. Social media discussions also mainly focus on the company's positive developments, further supporting the bullish view.",
  "key_events": [
    "Cambricon-U included in FTSE China A50 Index",
    "Cambricon-U stock price rises multiple times",
    "AI AIETF holding stock Cambricon-U surges",
    "ZhiYuan QiYuan large model released"
  ]
}
```

**Valuation Analyst**:
```json
{
  "signal": "bearish",
  "confidence": 0.85,
  "reasoning": "Cambricon-U's financial condition and business performance show clear negative trends. First, the company's net profit continues to be negative, and the loss amount has increased in recent quarters, indicating serious problems with profitability. Second, although the company's operating revenue increased in the fourth quarter of 2023, it experienced a significant decline in subsequent quarters, which may indicate a decrease in market demand or company market share. Additionally, the company's P/E ratio is negative, and its P/B ratio is as high as 52.58, indicating overvaluation in the market with significant bubble risk. From a financial health perspective, although the company has a low debt-to-asset ratio, its operating cash flow continues to be negative, indicating the company faces significant financial pressure in operations. Considering these factors, we believe Cambricon-U's stock is currently bearish. Furthermore, calculated through DCF model and relative valuation methods, the company's intrinsic value is significantly lower than the current market price, further supporting the bearish view.",
  "fair_value": 200.0,
  "key_metrics": [
    "P/E Ratio",
    "P/B Ratio",
    "Operating Revenue",
    "Net Profit",
    "Operating Cash Flow"
  ]
}
```

**Researcher Bull**:
```json
{
  "key_points": [
    "Market sentiment is positive, news and social media discussions lean optimistic",
    "Cambricon-U included in FTSE China A50 Index, indicating market's optimistic outlook for its long-term prospects",
    "Positive news of technological breakthroughs and stock price increases",
    "Despite weakness in technical and fundamental aspects, market sentiment and potential catalysts may drive stock price rebound"
  ],
  "confidence": 0.6,
  "reasoning": "Despite technical and fundamental analysis showing Cambricon-U is currently in a weak state, market sentiment and potential catalysts may drive stock price rebound. Cambricon-U being included in the FTSE China A50 Index indicates the market's optimistic outlook for its long-term prospects. Additionally, recent positive news about technological breakthroughs and stock price increases also support the bullish view. Although current financial conditions and valuations are high, market sentiment and potential positive factors may provide support for the stock price. Therefore, we recommend maintaining caution in the short term, but in the long term, Cambricon-U still has investment potential."
}
```

**Researcher Bear**:
```json
{
  "key_points": [
    "Technical indicators show short-term trend weakening",
    "Net profit continues to be negative and losses increase",
    "Declining operating revenue indicates decreased market demand",
    "P/B ratio as high as 52.58, overvalued",
    "Operating cash flow continues to be negative, significant financial pressure",
    "DCF model and relative valuation methods show intrinsic value lower than market price"
  ],
  "confidence": 0.8,
  "reasoning": "Combining technical analysis, fundamental analysis, market sentiment analysis, and valuation analysis, Cambricon-U's stock is currently bearish. Technical indicators show short-term trend weakening, fundamental analysis shows poor profitability, decreased market demand, overvaluation, and significant financial pressure. Although market sentiment leans positive, these positive sentiments mainly focus on short-term events and cannot mask long-term fundamental issues. Valuation analysis further supports the bearish view, with intrinsic value significantly lower than current market price. Therefore, selling Cambricon-U stock is recommended."
}
```

**Debate Room**:
```json
{
  "signal": "neutral",
  "confidence": 0.7,
  "reasoning": "Both bull and bear researchers' views have rationality and basis. The bull researcher emphasizes positive market sentiment, Cambricon-U's inclusion in the FTSE China A50 Index, and positive news about technological breakthroughs and stock price increases, which may provide support for the stock price in the short term. However, the bear researcher points out technical indicators show short-term trend weakening, fundamental analysis shows poor profitability, decreased market demand, overvaluation, and significant financial pressure. Although market sentiment leans positive, these positive sentiments mainly focus on short-term events and cannot mask long-term fundamental issues. Overall, in the short term, market sentiment and technological breakthroughs may drive stock price rebound, but long-term fundamental issues still exist, so maintaining a neutral attitude and waiting for more clear signals is recommended.",
  "final_verdict": "Investors are advised to remain cautious in the short term and pay attention to the continuity of market sentiment and technological breakthroughs. In the long term, close attention should be paid to the company's fundamental improvements, especially in areas such as profitability, market demand, and financial pressure. Before more clear signals emerge, maintaining a neutral attitude and avoiding excessive optimism or pessimism is recommended."
}
```

**Risk Manager**:
```json
{
  "max_position_size": 0.2,
  "volatility": 0.15,
  "risk_score": 0.7,
  "max_drawdown": 0.25,
  "suggested_position_size": 0.15,
  "reasoning": "Given stock 688256's high volatility and fundamental risks, a cautious approach is recommended. Although there is potential for technical breakthrough in the short term, the company faces issues such as poor profitability in the long term. Therefore, it is recommended to control position ratio not exceeding 20% and set appropriate stop-loss points to protect capital. At the same time, diversify investments to spread risk."
}
```

**Portfolio Manager (Final Decision)**:
```json
{
  "action": "hold",
  "quantity": 0,
  "confidence": 0.8,
  "reasoning": "Considering various analysts' trading signals, debate results, risk analysis, current portfolio status, and latest market price, we decide to adopt a holding strategy for stock 688256. Technical analysis and fundamental analysis both show the stock is in a weak state, with technical indicators showing short-term trend weakening, and fundamentals showing poor profitability, decreased market demand, overvaluation, and significant financial pressure. Although sentiment analysis shows positive market sentiment, these positive sentiments mainly focus on short-term events and cannot mask long-term fundamental issues. The debate result also recommends caution in the short term, paying attention to the continuity of market sentiment and technological breakthroughs. In the long term, close attention should be paid to the company's fundamental improvements. Risk analysis recommends controlling position ratio not exceeding 20% and setting appropriate stop-loss points to protect capital. Therefore, we decide to temporarily hold the stock and wait for more clear signals."
}
```

#### Comprehensive Conclusion

**Final Investment Decision**: Hold (Confidence: 0.8)

The analysis results from multiple professional agents indicate that Cambricon-U (688256) stock is currently in a weak state in terms of technicals and fundamentals, but market sentiment and short-term events may provide support for the stock price. Considering all factors, the system recommends adopting a holding strategy for this stock and closely monitoring subsequent changes in fundamentals and market sentiment. At the same time, risk management recommends controlling the maximum position ratio of this stock to within 20% of the portfolio and setting appropriate stop-loss points to control risk.

## ๐Ÿ”„ Data Process Description

The system's data process follows these steps:

1. **Data Collection**: Market data agent collects A-share market data and news through akshare API
2. **Multi-dimensional Analysis**: Four professional analysis agents (technical, fundamental, sentiment, valuation) conduct analysis independently
3. **Bull/Bear Research**: Bull and bear researchers provide analysis reports from bullish and bearish perspectives respectively
4. **Debate Integration**: Debate room integrates bull and bear perspectives to form a final analytical opinion
5. **Risk Assessment**: Risk manager assesses investment risk and sets trading restrictions
6. **Final Decision**: Portfolio manager formulates the final trading decision and generates orders


## ๐Ÿ“‹ Project Structure

```
community_usecase/a_share_investment_agent_camel/
โ”œโ”€โ”€ src/                       # Source code directory
โ”‚   โ”œโ”€โ”€ agents/                # Agent implementations
โ”‚   โ”‚   โ”œโ”€โ”€ base_agent.py      # Base agent class
โ”‚   โ”‚   โ”œโ”€โ”€ market_data_agent.py  # Market data agent
โ”‚   โ”‚   โ”œโ”€โ”€ technical_analyst.py  # Technical analyst agent
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ tools/                 # Tool modules
โ”‚   โ”‚   โ””โ”€โ”€ data_helper.py     # Data helper tools
โ”‚   โ”œโ”€โ”€ utils/                 # Utility tools
โ”‚   โ”‚   โ””โ”€โ”€ logging_utils.py   # Logging tools
โ”‚   โ”œโ”€โ”€ models.py              # Data model definitions
โ”‚   โ”œโ”€โ”€ roles.py               # Role definitions
โ”‚   โ””โ”€โ”€ main.py                # Main program
โ”œโ”€โ”€ tests/                     # Test directory
โ”œโ”€โ”€ logs/                      # Log files
โ”œโ”€โ”€ .env                       # Environment variables
โ”œโ”€โ”€ pyproject.toml             # Poetry configuration
โ”œโ”€โ”€ requirements.txt           # Dependencies
โ””โ”€โ”€ README.md                  # Documentation
```

## ๐Ÿ” Code Implementation Highlights

### 1. Multi-agent Collaboration Architecture

This project implements 10 professional role agents, with each agent responsible for specific tasks in the investment analysis process. Agents collaborate through message passing, forming a complete analysis decision chain.

```python
# Create agents
market_data_agent = MarketDataAgent(show_reasoning=show_reasoning, model_name=model_name)
technical_analyst = TechnicalAnalystAgent(show_reasoning=show_reasoning, model_name=model_name)
fundamentals_analyst = FundamentalsAnalystAgent(show_reasoning=show_reasoning, model_name=model_name)
sentiment_analyst = SentimentAnalystAgent(show_reasoning=show_reasoning, model_name=model_name)
valuation_analyst = ValuationAnalystAgent(show_reasoning=show_reasoning, model_name=model_name)
researcher_bull = ResearcherBullAgent(show_reasoning=show_reasoning, model_name=model_name)
researcher_bear = ResearcherBearAgent(show_reasoning=show_reasoning, model_name=model_name)
debate_room = DebateRoomAgent(show_reasoning=show_reasoning, model_name=model_name)
risk_manager = RiskManagerAgent(show_reasoning=show_reasoning, model_name=model_name)
portfolio_manager = PortfolioManagerAgent(show_reasoning=show_reasoning, model_name=model_name)
```

### 2. Flexible Multi-model Support

The system supports multiple large language models including Gemini, OpenAI, and Qwen, implementing flexible switching through a unified interface.

```python
def get_llm_client(model_name: str):
    """Get the specified LLM client"""
    if model_name.lower() == 'gemini':
        return GeminiClient()
    elif model_name.lower() == 'openai':
        return OpenAIClient()
    elif model_name.lower() == 'qwen':
        return QwenClient()
    else:
        raise ValueError(f"Unsupported model: {model_name}")
```



## ๐Ÿ“ Improvements and Innovations

Compared to the original version, the system restructured based on the Camel framework has the following innovations and improvements:

1. **Modular Design**: Clearer agent definitions and system structure, facilitating extension and maintenance
2. **Multi-model Support**: Flexible support for multiple LLM models, improving system adaptability
3. **Comprehensive Logging System**: Detailed recording of each agent's work process, facilitating debugging and analysis


## โš ๏ธ Disclaimer

This project is for **educational and research purposes only**.

- Not suitable for actual trading or investment
- No guarantees provided
- Past performance does not represent future performance
- Creators bear no responsibility for any financial losses
- Consult professional financial advisors for investment decisions

By using this software, you agree to use it for learning purposes only.

## ๐Ÿ“š Related Resources

- [OWL Framework Official Documentation](https://github.com/camel-ai/owl)
- [Camel Framework Official Documentation](https://github.com/camel-ai/camel)
- [A_Share_investment_Agent](https://github.com/24mlight/A_Share_investment_Agent)

## ๐Ÿ™ Acknowledgements

This project is improved based on the following open-source projects:

1. [A_Share_investment_Agent](https://github.com/24mlight/A_Share_investment_Agent) - Original A-share investment agent project, providing the foundation architecture and investment analysis ideas for this project. Special thanks for its innovative design in A-share data processing and analysis strategies.
2. [ai-hedge-fund](https://github.com/virattt/ai-hedge-fund.git) - Original US stock investment agent project
3. [Camel Framework](https://github.com/camel-ai/camel) - Multi-agent dialogue framework
4. [OWL Framework](https://github.com/camel-ai/owl) - Open-source multi-agent collaboration framework

Thanks to all the original authors for their contributions and inspiration, providing a solid foundation for this project.

---

## File: community_usecase/cooking-assistant/README.md

# Personal Dietician

This code example searches for recipes on the internet based on the ingredients you have, refines the content based on a dieterary restriction and generates shopping lists.

## How to use

1. Set up the OPENAI api key in the .env file

```bash
OPENAI_API_KEY = 'xxx'
```

2. Copy the python script to the owl/examples folder.

3. Run the script

```bash
python run_gpt4o.py
```

4. You can find the entire thought process of the agent within the log file.

5. Demo Link - https://drive.google.com/drive/folders/10LnMEMf_xQGojHyTAS57vI7oOmjvuKPE?usp=sharing

---

## File: community_usecase/excel_analyzer/README.md

# Excel Analyzer  
[ไธญๆ–‡](README_zh.md)

This project uses **Owl** for data analysis and visualization.

## Features

- Provides both English and Chinese versions of the raw data and prompts
- Utilizes **CodeExecutionToolkit**, **ExcelToolkit**, and **FileWriteToolkit** to complete related tasks  
- Implements **ExcelRolePlaying** based on **OwlRolePlaying**, which overrides the `system_prompt` with a cleaner, more focused version tailored for data analysis scenarios  
- tested using `gpt-4o` and `deepseek-v3`
- The analysis and visualization of this Excel file involve:
    - Complex headers (merged rows)
    - Nan value handling
    - Complex group calculations
    - Visualization

## How to Use  
1. Set up the environment according to Owl's official instructions
2. Run the following commands:  
    ```bash
    cd community_usecase/excel_analyzer

    # Chinese version, using deepseek-v3
    python excel_analyzer_zh.py

    # English version, using gpt-4o
    python excel_analyzer_zh.py
    ```
3. The analysis results will be saved in the current directory

---

## File: community_usecase/excel_analyzer/README_zh.md

# Excel Analyzer
่ฟ™ไธช้กน็›ฎไฝฟ็”จowlๆฅๅšๆ•ฐๆฎๅˆ†ๆžๅ’Œๅฏ่ง†ๅŒ–


## Features
- ๆไพ›ไบ†่‹ฑๆ–‡๏ผŒไธญๆ–‡ไธคไธช็‰ˆๆœฌ็š„ๅŽŸๅง‹ๆ•ฐๆฎๅ’Œprompt๏ผŒๆ–นไพฟ็†่งฃ
- ไฝฟ็”จ**CodeExecutionToolkit**๏ผŒ**ExcelToolkit**๏ผŒ**FileWriteToolkit**ๆฅๅฎŒๆˆ็›ธๅ…ณๅทฅไฝœ
- ๅœจ**OwlRolePlaying**ๅŸบ็ก€ไน‹ไธŠๅฎž็Žฐไบ†**ExcelRolePalying**๏ผŒๅฎƒ้‡ๅ†™ไบ†system_prompt๏ผŒๆ›ด็ฎ€ๆด๏ผŒ่š็„ฆๅœจๆ•ฐๆฎๅˆ†ๆžๅœบๆ™ฏ
- ็ป่ฟ‡ๆต‹่ฏ•๏ผŒๅœจ`gpt-4o`ๅ’Œ`deepseek-v3`ไธ‹ๅ‡ๅฏไปฅ่พพๅˆฐ้ข„ๆœŸๆ•ˆๆžœ
- ๅฏน่ฏฅexcel่ฟ›่กŒๅˆ†ๆžๅ’Œๅฏ่ง†ๅŒ–ๆ—ถๆถ‰ๅŠๅˆฐ็š„ๅ†…ๅฎนๆœ‰๏ผš
    - ๅคๆ‚่กจๅคด๏ผˆๅˆๅนถ่กŒ๏ผ‰
    - ็ผบๅคฑๅ€ผๅค„็†
    - ๅคๆ‚็š„ๅˆ†็ป„่ฎก็ฎ—
    - ๅฏ่ง†ๅŒ–

## How to use 
1. ๆŒ‰็…งowl็š„ๅฎ˜ๆ–นๆต็จ‹ๆญๅปบๅฅฝ็Žฏๅขƒ
2. ่ฟ่กŒ
    ```
    cd community_usecase/excel_analyzer

    # Chinese version, using deepseek-v3
    python excel_analyzer_zh.py

    # English version, using gpt-4o
    python excel_analyzer_zh.py
    ```
3. ๆ•ฐๆฎ้›†ๅˆ†ๆž็š„็ป“ๆžœๅฐ†ไผšๅœจๅ‡บๅญ˜ๅœจๅฝ“ๅ‰็›ฎๅฝ•ไธ‹

---

## File: community_usecase/learning-assistant/README.md

# Learning Assistant

This code example searches the internet for relevant learning materials depending on the user's knowledge level and devises a concrete learning roadmap all tailored to the user.

## How to use

1. Set up the OPENAI api key in the .env file

```bash
OPENAI_API_KEY = 'xxx'
```

2. Copy the python script to the owl/examples folder.

3. Run the script

```bash
python run_gpt4o.py
```

4. You can find the entire thought process of the agent within the log file.

5. Video demo - https://drive.google.com/drive/folders/1msrNNwjeZ0DKhSXCi2w1ljz_hULSusa_?usp=sharing

---

## File: community_usecase/Mcp_use_case/Readme.md

# Autonomous Website Scraping with OWL + FireCrawl MCP
 
This project leverages OWL (Optimized Workforce Learning) and FireCrawl MCP (Model Context Protocol) to automate content curation. The system scrapes top tech news websites, extracts relevant information, and compiles a summary report.

## Features

- Uses **FireCrawl MCP Server** for performing web scraping.
- Implements **OwlRolePlaying** for enhanced multi-agent task execution.
- Scrapes **TechCrunch, The Verge, and Wired** using **FireCrawl**.
- Extracts and summarizes **headlines, article summaries, and publication dates**.
- Generates a digest report **(Latest_tech_digest.md)** based on trends from these sources.
- Runs a default scraping task which can be updated before running the Script.

## Installation

1. Clone this repository:
   ```sh
   git clone https://github.com/camel-ai/owl.git
   cd owl
   ```
2. Install dependencies:
   ```sh
   pip install -r requirements.txt
   ```
3. Set up environment variables:
   - Create a `.env` file and add your API keys/configuration as needed.

## Usage

Navigate to the community use case directory before running the script:

```sh
cd community_usecase/Mcp_use_Case
```

Run the script using:

```sh
python Content_curator.py 
```
The script automatically executes the default task without taking additional input from the terminal.

## Configuration

- The script reads from `mcp_servers_config.json`, which is located in the same folder as Mcp_use_case.
- Modify the `default_task` section in `Content_curator.py` to adjust scraping and summarization behavior.

## Improvements & Customization

- The current implementation runs a **default task** and does not take task input from the terminal.
- To modify the scraping target or change the extracted details, update the `default_task` in `Content_curator.py`.
- The project is stored in the `Mcp_use_Case` folder inside `community_usecase` in the OWL directory.

## Error Handling

- Ensures **graceful cleanup** in case of failures.
- Implements **try-except** blocks to handle tool execution errors.
- Cancels running async tasks to **prevent memory leaks**.
- Supports **KeyboardInterrupt** for a safe shutdown.

## Cleanup & Shutdown

- The script **automatically disconnects MCP** after execution.
- Cancels remaining async tasks to **prevent memory leaks**.
- Special handling for **Windows platforms** is included to ensure smooth termination.

## Repository

For more details, visit the OWL repository: [OWL GitHub Repo](https://github.com/camel-ai/owl)

---

## File: community_usecase/Notion-MCP/README.md

# Notion Integration with OWL

This project demonstrates the integration of Notion with OWL (Optimized Workforce Learning) using the official Notion MCP server. It provides automated interaction with Notion workspaces through AI agents.

## Prerequisites

- Python >=3.10,<3.13
- Node.js and npm
- CAMEL framework installed
- A Notion account and integration

## Installation

#### 1. Clone this repository:
   ```sh
   git clone https://github.com/camel-ai/owl.git
   cd owl
   ```
#### 2. Install dependencies:
   ```sh
   pip install -r requirements.txt
   ```
#### 3. Set up environment variables:
   - Create a `.env` file and add your API keys/configuration as needed.

## Setup

#### 1. Install the required Node.js package:
   ```bash
   npm install @notionhq/notion-mcp-server@latest
   ```

#### 2. Set up your Notion integration:
   - Go to https://www.notion.so/profile/integrations
   - Create a new integration
   - Copy the integration token
   - Update `mcp_servers_config.json` with your token

#### 3. Connect your Notion pages:
   - Open each Notion page you want to work with
   - Click "..." (three dots) in the top right
   - Select "Add connections"
   - Choose your integration

#### 4. Visit official Notion MCP GitHub Repository
Visit the [Notion_MCP GitHub Repo](https://github.com/makenotion/notion-mcp-server) for detailed setup instructions.

## Usage

Navigate to the community use case directory before running the script:

```sh
cd community_usecase/Notion_MCP
```

#### Run the script using:
   ```bash
   python notion_manager.py
   ```
   This will run the default task which:
   - Searches for a specific page
   - Updates its properties
   - Adds a comment


## Supported Operations

The integration supports these Notion API operations:
- Searching for pages
- Reading page content
- Updating page properties
- Adding comments
- Creating new pages
- Retrieving database content

## Troubleshooting

If you encounter errors:

    1. Verify your Notion token is correct
    2. Check that pages are connected to your integration
    3. Ensure you have the required permissions
    4. Check the Notion API version in config matches the current version

## Error Handling

The script includes:
- Graceful connection handling
- Task execution error catching
- Proper cleanup on exit
- Windows-specific asyncio handling

## Repository

For more details, visit the OWL repository: [OWL GitHub Repo](https://github.com/camel-ai/owl)