A modular financial analysis system that extracts and analyzes financial information from 10-K and 10-Q SEC filings.
Before running the application, you need to set up your API keys:
-
Fill in your API keys in the
finagent_keys.jsonfile in the project directory:DEEPSEEK_API_KEY(at least one of DeepSeek or OpenAI is required)OPENAI_API_KEY(at least one of DeepSeek or OpenAI is required)TAVILY_API_KEY(required for web search functionality)
-
The application will automatically load these keys when it starts.
You can obtain these API keys from:
- DeepSeek: https://platform.deepseek.com/
- OpenAI: https://platform.openai.com/
- Tavily: https://tavily.com/
The project follows a modular architecture:
finagent/ # Package directory
├── models/ # Pydantic data models
├── providers/ # LLM providers and configurations
├── extractors/ # PDF and section extraction logic
├── analyzers/ # Financial analysis components
├── workers/ # Specialized worker modules (web_search.py)
├── workflows/ # Graph definitions and workflow
├── main.py # Main entry point
└── README.md # Package documentation
run_finagent.py # Main runner script
# Install dependencies
pip install -r finagent/requirements.txt# Install the package in development mode (not required for normal use)
pip install -e .The recommended way to run FinAgent is using the run_finagent.py script in the main directory:
# Run using the run script (from the main FinAgent directory)
python run_finagent.py
# the pdf_file path can be modified in run_finagent.pyWhen prompted, enter the path to a 10-K or 10-Q PDF file. The system will:
- Extract relevant sections from the filing
- Ask for any specific analysis requirements
- Generate an analysis of the Income Statement, Cash Flow Statement, and MD&A
- Output a markdown report in the
output/folder
There are a few 10Q files in files. Right now the agent does not support 10K files
- Models: Define the state model used throughout the workflow
- Providers: Configure LLM clients with appropriate settings
- Extractors: Handle PDF text extraction and locate financial sections
- Analyzers: Process financial data to generate insights
- Workflows: Define the processing graph and execution flow
To add new functionality:
- Add new extractors in
extractors/for different data sources - Create new analyzers in
analyzers/for different types of analysis - Update the graph in
workflows/graphs.pyto include new nodes
The system supports multiple LLM providers:
- DeepSeek (default)
- OpenAI
To switch providers, update the default_llm in providers/llm.py.