Content
# A-Scope Research - Financial Intelligence Team
Based on MCP (Model Context Protocol), an intelligent analysis system for China's A-share market, providing comprehensive analysis support for investment decisions through collaboration and debate among multiple professional intelligent agents.
## 🌟 System Features
### 🤖 Professional Intelligent Agent Team
- **Technical Analyst**: Focuses on technical indicators, chart patterns, and trend analysis
- **Fundamental Analyst**: Concerned with financial data, company value, and industry analysis
- **Quantitative Analyst**: Employs mathematical models, statistical methods, and risk quantification
- **Market Sentiment Analyst**: Analyzes investor sentiment, market psychology, and public opinion
- **Risk Manager**: Assesses investment risk and formulates risk control strategies
### 🔄 Intelligent Collaboration Process
1. **Parallel Analysis**: Each intelligent agent independently analyzes target stocks from a professional perspective
2. **Team Debate**: Multi-round discussions, exchanging views and questioning assumptions
3. **Final Decision**: Investment advice based on consensus from 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, Tongyi Qianwen, etc.
- **Real-time Web Interface**: Intelligent agent dialogue interface similar to WeChat group chat
- **Flexible Configuration**: Supports YAML configuration file customization of 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: "Technical Analyst"
model: "gpt-3.5-turbo" # or other supported models
api_key: "your_api_key_here" # replace with your API key
base_url: "https://api.openai.com/v1" # or other API addresses
temperature: 0.7
max_tokens: 2000
# ... other intelligent agent configurations
```
#### Supported Model Service Providers
| Service Provider | base_url | Model Examples |
|--------|----------|----------|
| OpenAI | `https://api.openai.com/v1` | `gpt-3.5-turbo`, `gpt-4` |
| Zhipu GLM | `https://open.bigmodel.cn/api/paas/v4/` | `glm-4`, `glm-3-turbo` |
| Tongyi Qianwen | `https://dashscope.aliyuncs.com/compatible-mode/v1` | `qwen-turbo`, `qwen-plus` |
| Moonshot | `https://api.moonshot.cn/v1` | `moonshot-v1-8k`, `moonshot-v1-32k` |
| DeepSeek | `https://api.deepseek.com/v1` | `deepseek-chat`, `deepseek-coder` |
### 3. Operation Mode
#### 🌐 Web Interface Mode (Recommended)
```bash
python main.py --mode web
```
Access `http://localhost:8501` to open the Web interface
#### 💻 Command Line Mode
```bash
# Analyze a specified stock
python main.py --mode cli --stock 000001
```
#### 🎭 Demo Mode
```bash
# Interactive demo
python main.py --mode demo
```
## 📊 Web Interface Functionality
### Main Functions
- **Real-time Team Status**: Displays the initialization status and tool count of 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 advice and risk assessment
- **Result Export**: Complete analysis report in JSON format
### Interface Features
- 🎨 **Intelligent Agent Avatars**: Each intelligent agent has a unique emoji avatar
- 🎨 **Color Differentiation**: Different roles use different color themes
- ⏰ **Timestamp Display**: Complete analysis timeline
- 🔧 **Tool Invocation Display**: Real-time display of MCP tool invocation process
- 📱 **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 packages
├── README.md # Project documentation
├── src/
│ ├── __init__.py
│ ├── agents/ # Intelligent agent module
│ │ ├── __init__.py
│ │ ├── base_agent.py # Basic intelligent agent class
│ │ └── team_manager.py # Team manager
│ ├── prompts/ # Intelligent agent prompts
│ │ ├── __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)
```
## 🎯 Usage Scenarios
### Individual Investors
- Obtain multi-angle professional analysis opinions
- Understand the pros and cons of different investment strategies
- Make more rational investment decisions
### Investment Institutions
- Assist in the decision-making process of research teams
- Provide 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 thought process of professional analysts
## 🔍 Analysis Example
### Input
```
Stock Code: 000001 (Ping An Bank)
```
### Output Example
#### Technical Analyst's View
> 📈 From a technical perspective, 000001 is currently in an upward channel, with effective MA20 support and a clear MACD golden cross signal, suggesting buying on dips...
#### Fundamental Analyst's View
> 📋 Ping An Bank's Q3 financial report shows a stable ROE above 13%, well-controlled non-performing loan ratio, relatively reasonable valuation, and long-term investment value...
#### Quantitative Analyst's View
> 🔢 Based on historical data backtesting, the risk-adjusted return at the current price level is 1.8, with volatility at the historical median, suggesting standard position allocation...
#### Market Sentiment Analyst's View
> 😊 The recent banking sector sentiment has warmed up, with significant institutional fund inflows, but attention should be paid to policy expectations and their impact on sentiment...
#### Risk Manager's View
> 🛡️ The main risk comes from interest rate policy changes and credit cycle fluctuations, suggesting setting an 8% stop-loss level and not exceeding 15% of the portfolio...
## ⚙️ Advanced Configuration
### Custom Intelligent Agents
You can customize the behavior and professional strengths of intelligent agents by modifying files in the `src/prompts/` directory.
### MCP Tool Extension
Add new MCP servers 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 Failure**
- Check if the API key is correct
- Verify the base_url format
- Confirm the network connection is normal
2. **MCP Tool Connection Failure**
- Check the accessibility of the MCP server URL
- Verify firewall settings
- Confirm reasonable timeout settings
3. **Dependency Package Installation Failure**
- Use a domestic mirror source: `pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt`
- Upgrade pip version: `pip install --upgrade pip`
### Debug Mode
Enable detailed log output:
```bash
# Set environment variable
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 inspection
flake8 src/
# Type checking
mypy src/
# Run tests
pytest
```
## 📄 License
This project adopts the MIT license, see [LICENSE](LICENSE) file for details.
## 🙏 Acknowledgments
- [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 questions or suggestions, please contact us through:
- Submit [GitHub Issue](https://github.com/guangxiangdebizi/A-Scope-Research/issues)
- Send email to: guangxiangdebizi@gmail.com
---
**Disclaimer**: This system is for learning and research purposes only and does not constitute investment advice. Investment carries risks, 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.
Vibe-Trading
Vibe-Trading: Your Personal Trading Agent
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...
tradingview-mcp
AI-assisted TradingView chart analysis — connect Claude Code to your...