DeepAgents is an AI-powered stock research assistant. Built using LangChain's DeepAgent framework, it can provide very detailed financial analysis with results that are close to those of a professional analyst's report. This project is not like a normal chatbot, it has a more complex system inside. This system has "sub-intelligence bodies" specialized in different tasks, tools for planning, and integration of a variety of data tools, which can ultimately output professional-level stock analysis reports. At the heart of the system is the Deep Intelligence architecture, which specializes in complex and long-thinking tasks. It allows the AI to dive into a topic like an expert by using detailed system commands, task planning tools, sub-intelligences, and a file system, which are key components that work together. This stock research assistant is a concrete example of the application of this architecture, which is specifically designed to efficiently perform specialized financial analysis tasks.
Function List
- multidimensional analysis: Stocks can be evaluated in a comprehensive manner from three perspectives simultaneously: fundamentals, technical indicators and risk.
- Professional Sub-Intelligentsia: There are multiple independent AI intelligences within the system that play the role of experts in different fields, such as fundamental analysts, technical analysts, and risk assessors.
- Real-time data access:: Ability to access real-time stock prices, company financial statements and data on various technical indicators.
- Systematized workflow:: The research process follows a structured set of methodologies that ensure the integrity and systematization of the analysis.
- Web Interface: Provides an easy-to-use Gradio-based web interface for entering commands and viewing results.
- Generate professional reports: Once the analysis is complete, a professional research report with investment recommendations and target prices can be automatically generated.
- Improve analytical efficiency: Reduce research that used to take hours or even days to a few minutes.
Using Help
This tool is an AI application that runs on a local computer and relies on a local Large Language Model (LLM) to drive it. Some environment configuration and installation needs to be done before using it.
1. Environmental preparation
Your computer needs to meet the following conditions before you can use it:
- Python: Requires installation
3.8
or later versions of Python. - Ollama: This is a tool that allows you to run large language models locally, you need to install it first.
2. Installation process
Step 1: Install Ollama
Ollama lets you run powerful language models like Llama 2 on your own computer.
- Open a terminal (on macOS or Linux) or a command prompt (on Windows).
- Run the following command to download and install Ollama:
curl -fsSL https://ollama.ai/install.sh | sh
- Once the installation is complete, you will need to download a language model for use in driving the analysis. For example, download an open source
gpt-oss
Model:ollama pull gpt-oss
This process will download several gigabytes of model files, so please be patient.
Step 2: Download DeepAgents Program Code
- utilization
git
tool to clone the project's codebase. Open a terminal and run it:git clone https://github.com/sagar-n/deepagents.git
- Go to the project catalog:
cd deepagents
Step 3: Install Python Dependency Libraries
- All Python libraries needed for the project are documented in the
requirements.txt
file. You can use thepip
command for one-click installation:pip install -r requirements.txt
This command will automatically install the
deepagents
,langchain
,yfinance
and all other required libraries.
3. How to operate and use
Step 1: Launch the application
- Make sure all dependencies are installed and Ollama is running in the background.
- In the project root directory, run the following command to start the program:
python research_agent.py
- After the program starts, you will see output similar to the following in the terminal:
Running on local URL: http://127.0.0.1:7860
Step 2: Open the web interface
- Open your browser (e.g. Chrome, Firefox, etc.).
- Enter the address prompted by the terminal above in the address bar:
http://127.0.0.1:7860
maybehttp://localhost:7860
The - You'll see a clean web interface with a text input box and a button for submission.
Step 3: Enter the analysis instructions
- In the text box, you can enter the requirements you want to analyze in natural language. Your instructions can be written in more detail so that the AI can better understand your intentions.
Example of basic analysis:
If you want to do a thorough analysis of Apple Inc (ticker symbol AAPL) and plan to invest for 6 months, you can enter:
对苹果公司(AAPL)进行一次全面的分析,投资期限为6个月。请包括:
1. 当前的财务表现
2. 带有交易信号的技术分析
3. 风险评估
4. 包含目标价位的投资建议
Advanced Analytics Example:
- Portfolio analysis:
比较苹果(AAPL)、微软(MSFT)和谷歌(GOOGL),为我的投资组合分配提供建议。
- Industry Research:
分析一下2025年第一季度科技行业的前景。
- Specific risk assessment:
评估投资特斯拉(TSLA)的风险。
- Technical Indicator Analysis:
提供英伟达(NVDA)的技术分析和建议的入场点位。
Step 4: View the analysis report
- After entering the instructions, click the "Submit" button.
- The AI Intelligent Body system will start working. It would call up the subintelligences, split up to grab the data, analyze it, and ultimately summarize it into a complete report.
- The analysis process may take a few minutes. Upon completion, a detailed stock research report is displayed directly on the web interface. The report is clearly formatted and contains modules for summary, fundamental analysis, technical analysis and risk assessment.
application scenario
- Individual Investor Study
Individual investors can use this tool to quickly access professional-grade analysis reports on a particular stock to assist them in making more informed investment decisions. It saves a lot of time in manually collecting and analyzing data. - Financial Analyst Auxiliary
Financial analysts can use it as a tool for initial research, quickly generating basic reports on which they can then build deeper, more personalized analyses to increase productivity. - Student and researcher learning
This program is a great example for students or researchers studying finance and investments. It shows how AI technology can be applied to complex financial analysis scenarios that can be used to learn and practice. - Automated report generation
In scenarios where a large number of stock analysis reports need to be generated on a regular basis, the framework of this tool can be used for secondary development to automate and batch the report generation process.
QA
- Are the analytical results of this tool reliable?
The analysis results are generated based on real-time financial data and proven analytical models with high reference value. However, it is not a substitute for a professional financial advisor and all output is for educational and research purposes only and does not constitute financial advice. - Do I have to pay?
This project is open source and you can use it for free. But running it requires you to deploy Ollama and the big language model locally, which will take up your computer's computing resources (such as CPU or GPU). - Can I analyze A-shares or Hong Kong stocks?
The tool defaults to using theyfinance
The library gets the data, and the main support is for markets that can be accessed on Yahoo Finance, such as US stocks. If you want to analyze A-shares or Hong Kong stocks, you may need to modify the code, replace or add the data source interface suitable for the Chinese market. - Can I customize my analysis model or add new analysis tools?
Can. This project offers great extensibility. You can add custom tool functions to the code or create new sub-intelligences to perform specific analytical tasks, such as adding an analyst that specializes in evaluating environmental, social, and governance (ESG) factors.