FinRobot is a production-grade, agentic AI system that combines advanced reasoning with autonomous financial data retrieval.
It integrates two powerful systems:
- Agentic Reasoning Core: A structured cognitive pipeline (Planner → Thinker → Verifier) ensuring explainable and hallucinations-free answers.
- Autonomous RAG Engine: A control plane that automatically fetches, indexes, and maintains fresh financial data (SEC filings, Stock Prices, News) from the web.
- Autonomous Data Acquisition: Automatically detects tikers (e.g., "$AAPL") and fetches missing data (10-K, Prices) before answering.
- Verifiable Reasoning: Every answer goes through a self-verification loop to check for factual accuracy and compliance.
- Long-Term Memory: Remembers user preferences, risk tolerance, and past interactions.
- Hybrid Retrieval: Combines structured financial data with unstructured semantic search over filings.
FinRobot_Integrated/
│
├── chatbot_ui.py # Main Entry Point (Streamlit UI)
├── requirements.txt # Integrated Dependencies
├── .env # API Keys Configuration
│
├── agent/ # Agentic Cognitive Layer
│ ├── meta_agent.py # Orchestrator
│ ├── planner.py # Task Decomposition
│ ├── thinker.py # Reasoning & Synthesis
│ └── verifier.py # Safety & Fact Checking
│
├── rag_engine/ # Data & Retrieval Engine
│ ├── src/
│ │ ├── control_plane/ # Data Lifecycle (Fetch/Index)
│ │ ├── inference_plane/ # Read-Only Retrieval
│ │ └── orchestrate.py # RAG Entry Point
│
├── retrieval/ # Integration Layer
│ └── pinecone_client.py # Adapts RAG Engine for the Agent
│
├── memory/ # User Context & Long-term Memory
├── prompts/ # System Prompts
└── config/ # Settings & Rules
-
Clone & Enter Directory:
cd FinRobot_Integrated -
Create Environment:
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Environment: Create a
.envfile with the following keys:# LLM Providers OPENAI_API_KEY=sk-... (or GEMINI_API_KEY) # Vector Database PINECONE_API_KEY=... PINECONE_INDEX_NAME=financial-analysis (Ensure this index exists) PINECONE_ENV=us-east-1 # RAG Data Sources HUGGING_FACE_API_KEY=hf_... (For embeddings) NEWSAPI_KEY=... (Optional: For news)
Start the application:
streamlit run chatbot_ui.py- Login: Enter a User ID (e.g., "analyst_01").
- Profile: Set your risk tolerance and explanation depth.
- Ask: "Analyze the risk factors for Apple based on their latest 10-K."
- Agent Action:
- Identifies "AAPL".
- RAG Engine: Checks if 2025 10-K is indexed. If not, downloads from SEC EDGAR and segments it.
- Retrieval: Finds relevant risk sections.
- Thinker: Synthesizes an answer citing specific sections.
- Verifier: Double-checks the claims against the retrieved text.
- Response: Delivers the final answer to you.
The agent avoids "black box" generation by splitting the process:
- Planner: "I need to find Apple's 10-K and look for 'Risk Factors'."
- Thinker: Executes the retrieval and drafts a response.
- Verifier: "The draft claims revenue grew 5%, but the text says 3%. Correction needed."
A "Two-Plane" architecture ensures data integrity:
- Control Plane: Write-Only. Ensures data is fresh. Mirrors local disk to Pinecone.
- Inference Plane: Read-Only. Fast semantic search for the Agent.
MIT License