Content
# A-Scope Research - 金融智能体团队
Based on MCP (Model Context Protocol), this is an intelligent analysis system for the Chinese A-share market. Through the collaboration and debate of multiple professional intelligent agents, it provides comprehensive analysis support for investment decisions.
## 🌟 System Features
### 🤖 Professional Intelligent Agent Team
- **Technical Analyst (Li Jishu)**: Focuses on technical indicators, chart patterns, and trend analysis
- **Fundamental Analyst (Wang Jiben)**: Focuses on financial data, company value, and industry analysis
- **Quantitative Analyst (Zhang Lianghua)**: Uses mathematical models, statistical methods, and risk quantification
- **Market Sentiment Analyst (Chen Qingxu)**: Analyzes investor sentiment, market psychology, and public opinion
- **Risk Manager (Liu Fengkong)**: Assesses investment risks and formulates risk control strategies
### 🔄 Intelligent Collaboration Process
1. **Parallel Analysis**: Each intelligent agent independently analyzes the target stock from a professional perspective
2. **Team Debate**: Multiple rounds of debate to exchange views and question assumptions
3. **Final Decision**: Investment recommendations are made based on the consensus of the debate
4. **Risk Assessment**: Comprehensive risk analysis and control recommendations
### 🛠️ Technical Architecture
- **MCP Protocol Integration**: Real-time access to A-share market data and analysis tools
- **Multi-Model Support**: Compatible with mainstream large models such as OpenAI, Zhipu GLM, and Tongyi Qianwen
- **Real-time Web Interface**: Intelligent agent dialogue interface similar to WeChat group chat
- **Flexible Configuration**: Supports YAML configuration files to customize models and parameters
## 🚀 Quick Start
### 1. Environment Preparation
```bash
# Clone the project
git clone <repository-url>
cd A-Scope-Research
# Create a virtual environment (recommended)
python -m venv .venv
# Activate the virtual environment
# Windows
.venv\Scripts\activate
# Linux/Mac
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
```
### 2. Configuration Settings
#### Edit `config.yaml`
```yaml
agents:
technical_analyst:
name: "李技术"
model: "gpt-3.5-turbo" # 或其他支持的模型
api_key: "your_api_key_here" # 替换为您的API密钥
base_url: "https://api.openai.com/v1" # 或其他API地址
temperature: 0.7
max_tokens: 2000
# ... Other intelligent agent configurations
```
#### Supported Model Providers
| Service Provider | base_url | Model Example |
|--------|----------|----------|
| OpenAI | `https://api.openai.com/v1` | `gpt-3.5-turbo`, `gpt-4` |
| 智谱GLM | `https://open.bigmodel.cn/api/paas/v4/` | `glm-4`, `glm-3-turbo` |
| 通义千问 | `https://dashscope.aliyuncs.com/compatible-mode/v1` | `qwen-turbo`, `qwen-plus` |
| 月之暗面 | `https://api.moonshot.cn/v1` | `moonshot-v1-8k`, `moonshot-v1-32k` |
| DeepSeek | `https://api.deepseek.com/v1` | `deepseek-chat`, `deepseek-coder` |
### 3. Running Methods
#### 🌐 Web Interface Mode (Recommended)
```bash
python main.py --mode web
```
Visit `http://localhost:8501` to open the Web interface
#### 💻 Command Line Mode
```bash
# Analyze the specified stock
python main.py --mode cli --stock 000001
```
#### 🎭 Demo Mode
```bash
# Interactive demo
python main.py --mode demo
```
## 📊 Web Interface Features
### Main Features
- **Real-time Team Status**: Displays the initialization status and number of tools for each intelligent agent
- **Stock Analysis Input**: Supports 6-digit A-share code input
- **Analysis Result Display**: Professional analysis reports from each intelligent agent
- **Debate Process Visualization**: Real-time debate interface similar to group chat
- **Final Decision Summary**: Investment recommendations and risk assessment
- **Result Export**: Complete analysis report in JSON format
### Interface Features
- 🎨 **Intelligent Agent Avatar**: Each intelligent agent has a unique emoji avatar
- 🎨 **Color Differentiation**: Different roles use different color themes
- ⏰ **Timestamp Display**: Complete analysis timeline
- 🔧 **Tool Call Display**: Real-time display of MCP tool calls
- 📱 **Responsive Design**: Adapts to different screen sizes
## 🔧 Project Structure
```
A-Scope-Research/
├── main.py # Main entry file
├── config.yaml # Intelligent agent configuration file
├── mcp.json # MCP server configuration
├── requirements.txt # Python dependency package
├── README.md # Project documentation
├── src/
│ ├── __init__.py
│ ├── agents/ # Intelligent agent module
│ │ ├── __init__.py
│ │ ├── base_agent.py # Base intelligent agent class
│ │ └── team_manager.py # Team manager
│ ├── prompts/ # Intelligent agent Prompt
│ │ ├── __init__.py
│ │ ├── technical_analyst.py # Technical analyst
│ │ ├── fundamental_analyst.py # Fundamental analyst
│ │ ├── quantitative_analyst.py # Quantitative analyst
│ │ ├── sentiment_analyst.py # Sentiment analyst
│ │ └── risk_manager.py # Risk manager
│ └── ui/ # User interface
│ ├── __init__.py
│ └── streamlit_app.py # Streamlit Web application
└── .venv/ # Virtual environment (automatically generated)
```
## 🎯 Use Cases
### Individual Investors
- Obtain multi-faceted professional analysis opinions
- Understand the advantages and disadvantages of different investment strategies
- Make more rational investment decisions
### Investment Institutions
- Assist the decision-making process of the investment research team
- Provide a standardized analysis framework
- Reduce analysis bias from a single perspective
### Financial Education
- Learn the application of different analysis methods
- Understand the complexity of investment decisions
- Observe the thinking process of professional analysts
## 🔍 Analysis Example
### Input
```
Stock Code: 000001 (Ping An Bank)
```
### Output Example
#### Technical Analyst View
> 📈 From a technical perspective, 000001 is currently in an upward channel, MA20 support is effective, MACD golden cross signal is clear, it is recommended to buy on dips...
#### Fundamental Analyst View
> 📋 Ping An Bank's Q3 financial report shows that ROE is stable above 13%, the non-performing loan ratio is well controlled, and the valuation is relatively reasonable, with long-term investment value...
#### Quantitative Analyst View
> 🔢 Based on historical data backtesting, the risk-adjusted return at the current price is 1.8, and the volatility is at the historical median, it is recommended to allocate a standard position...
#### Market Sentiment Analyst View
> 😊 Recently, sentiment in the banking sector has rebounded, and institutional funds have flowed in significantly, but it is necessary to be wary of the impact of policy expectation changes on sentiment...
#### Risk Manager View
> 🛡️ The main risks come from changes in interest rate policies and the credit cycle. It is recommended to set an 8% stop loss and the position should not exceed 15% of the portfolio...
## ⚙️ Advanced Configuration
### Customize Intelligent Agents
You can customize the behavior and professional expertise of intelligent agents by modifying the files in the `src/prompts/` directory.
### MCP Tool Extension
Add a new MCP server in `mcp.json` to extend data sources and analysis tools.
### Model Parameter Tuning
Adjust the `temperature` and `max_tokens` parameters of each intelligent agent in `config.yaml` to optimize output quality.
## 🐛 Troubleshooting
### Common Issues
1. **Model Connection Failed**
- Check if the API key is correct
- Verify the base_url format
- Confirm that the network connection is normal
2. **MCP Tool Connection Failed**
- Check the accessibility of the MCP server URL
- Verify firewall settings
- Confirm that the timeout setting is reasonable
3. **Dependency Package Installation Failed**
- Use a domestic mirror source: `pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt`
- Upgrade the pip version: `pip install --upgrade pip`
### Debug Mode
Enable detailed log output:
```bash
# Set environment variables
export LOG_LEVEL=DEBUG
python main.py --mode cli --stock 000001
```
## 🤝 Contribution Guide
Welcome to submit Issues and Pull Requests to improve the project!
### Development Environment Setup
```bash
# Install development dependencies
pip install -r requirements.txt
pip install pytest black flake8 mypy
# Code formatting
black src/
# Code check
flake8 src/
# Type check
mypy src/
# Run tests
pytest
```
## 📄 License
This project is licensed under the MIT License, see the [LICENSE](LICENSE) file for details.
## 🙏 Acknowledgements
- [LangChain](https://github.com/langchain-ai/langchain) - Large model application framework
- [MCP](https://github.com/modelcontextprotocol) - Model Context Protocol
- [Streamlit](https://streamlit.io/) - Web application framework
## 📞 Contact Information
If you have any questions or suggestions, please contact us through the following methods:
- Submit a [GitHub Issue](https://github.com/guangxiangdebizi/A-Scope-Research/issues)
- Send an email to: guangxiangdebizi@gmail.com
---
**Disclaimer**: This system is for learning and research purposes only and does not constitute investment advice. Investment is risky, and decisions should be made with caution.
Connection Info
You Might Also Like
valuecell
Valuecell is a Python project for efficient data management.
hexstrike-ai
HexStrike AI is an AI-powered MCP cybersecurity automation platform with 150+ tools.
AP2
AP2 provides code samples and demos for the Agent Payments Protocol.
YC-Killer
YC-Killer is an AI agents library by Singularity Research, open-sourcing...
Vibe-Trading
Vibe-Trading: Your Personal Trading Agent
tradingview-mcp
AI-assisted TradingView chart analysis — connect Claude Code to your...