Skip to content

ChidambaraRaju/capital-compass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Capital Compass Logo

Capital Compass 🧭

An AI-powered investment research application that generates comprehensive financial reports by synthesizing market data and news sentiment using a multi-agent workflow.

Python Version Streamlit LangChain License


πŸ“œ About The Project

Capital Compass is an advanced tool designed to automate and enhance the tedious process of investment research.
By entering a stock ticker, users can generate a detailed, professional-grade financial report in seconds.

The application leverages a sophisticated multi-agent system built with LangGraph to perform parallel data fetching, specialized analysis, critical review, and final report synthesisβ€”providing a balanced and data-driven investment thesis.


✨ Key Features

  • AI-Powered Analysis – Multiple specialized LLMs for financial analysis, sentiment analysis, and final reporting ensure nuanced, high-quality output.
  • Comprehensive Data Synthesis – Combines quantitative financial metrics from Alpha Vantage with qualitative news sentiment for a holistic view.
  • Robust Agentic Workflow – Implements multi-step reasoning: specialist agents analyze, a "critic" agent challenges, and a final "advisor" synthesizes into a balanced report.
  • Decisive Recommendations – Designed with advanced prompting techniques to overcome neutrality bias and provide clear, actionable insights.
  • Interactive UI – A clean, intuitive interface built with Streamlit.

πŸš€ Live Demo

Demo


πŸ› οΈ How It Works (Architecture)

The core of Capital Compass is a stateful graph built with LangGraph. This orchestrates a sophisticated workflow between specialized AI agents to ensure a robust and nuanced analysis.

1. Parallel Information Gathering

The process begins by simultaneously gathering three distinct types of information:

  • πŸ“Š Financial Overview: Fetches quantitative financial data from Alpha Vantage.
  • πŸ“° News & Market Sentiment: Fetches qualitative news and sentiment from Alpha Vantage.
  • πŸ” Forward-Looking Insights: Performs a targeted web search for analyst ratings and price targets.

2. Specialized Analysis

The raw data is then processed in parallel by three specialist agents:

  • πŸ‘¨β€πŸ’Ό Financial Analyst Agent β†’ Interprets financial metrics.
  • 🧠 Sentiment Analyst Agent β†’ Evaluates news and market perception.
  • 🌐 Web Research Agent β†’ Summarizes findings from the web search.

3. Balanced Review

All three analyses are passed to the Risk & Opportunity Analyst.

  • 🎯 Role: Distill everything into:
    • The most compelling reason to invest.
    • The most significant risk.

4. Final Synthesis

Finally, the Senior Advisor Agent receives:

  • The specialist analyses
  • The balanced review

It then weighs the core opportunity against the significant risk to produce a structured, decisive investment report.


🎯 Workflow Diagram

%%{init: {
  "theme": "dark",
  "themeVariables": {
    "primaryColor": "#0b1220",
    "primaryTextColor": "#E5E7EB",
    "primaryBorderColor": "#93C5FD",
    "lineColor": "#93C5FD",
    "tertiaryColor": "#111827",
    "fontSize": "14px",
    "fontFamily": "Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto"
  }
}}%%

graph TD
    A[Start:<br/>User Enters Ticker] --> B[Fetch:<br/>Financial Overview]
    A --> C[Fetch:<br/>News & Sentiment]
    A --> I[Fetch:<br/>Web Search]

    B --> D{Analyze:<br/>Financials}
    C --> E{Analyze:<br/>Sentiment}
    I --> J{Summarize:<br/>Web Research}

    D --> F[Balanced Review:<br/>Risk & Opportunity]
    E --> F
    J --> F

    F --> G[Final Synthesis:<br/>Generate Report]
    G --> H[End:<br/>Display Report]

    %% Dark-friendly styles
    classDef fetch fill:#0F172A,stroke:#818CF8,color:#E5E7EB,stroke-width:2px
    classDef websearch fill:#1E1B4B,stroke:#A5B4FC,color:#E0E7FF,stroke-width:2px
    classDef analyze fill:#111827,stroke:#60A5FA,color:#E5E7EB,stroke-width:2px
    classDef critic fill:#1F0A0A,stroke:#FCA5A5,color:#FEE2E2,stroke-width:2px
    classDef final fill:#052E2B,stroke:#34D399,color:#D1FAE5,stroke-width:2px
    classDef default fill:#0B1220,stroke:#93C5FD,color:#E5E7EB,stroke-width:1.5px

    class B,C fetch
    class I websearch
    class J analyze
    class D,E analyze
    class F critic
    class G final

Loading

πŸ’» Technology Stack

  • Frontend: Streamlit
  • AI Orchestration: LangChain / LangGraph
  • LLM Provider: Groq (multi-model support)
  • Data Source: Alpha Vantage API
  • Core Language: Python

βš™οΈ Setup and Installation

Follow these steps to get a local copy running:

Prerequisites

  • Python 3.11+
  • Alpha Vantage API Key
  • Groq API Key

Installation

Clone the repository:

git clone https://github.com/ChidambaraRaju/capital-compass
cd capital-compass

Create a virtual environment:

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

Install dependencies:

pip install -r requirements.txt

Set up environment variables:

Create a .env file in the project root with:

ALPHAVANTAGE_API_KEY="YOUR_ALPHA_VANTAGE_KEY"
GROQ_API_KEY="YOUR_GROQ_API_KEY"
TAVILY_API_KEY = "YOUR_TAVILY_API_KEY"

▢️ Usage

Run the Streamlit app from the root directory:

streamlit run main.py

πŸ“ Project Structure

.
β”œβ”€β”€ assets/
β”‚   └── logo.png
β”œβ”€β”€ capital_compass/
β”‚   β”œβ”€β”€ agents/
β”‚   β”‚   β”œβ”€β”€ analysis_agents.py
β”‚   β”‚   └── data_fetcher.py
β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”œβ”€β”€ alpha_vantage_client.py
        └── tavily_search_tool.py
β”‚   β”œβ”€β”€ exceptions.py
β”‚   β”œβ”€β”€ graph.py
β”‚   └── state.py
β”œβ”€β”€ .env
β”œβ”€β”€ main.py
└── requirements.txt

πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.


✨ Acknowledgements

Made with ❀️ and Python

About

Capital Compass is an AI-powered investment research app that generates comprehensive financial reports by combining financial data and news sentiment. Built with Streamlit and LangGraph, it uses a multi-agent workflow to deliver clear, data-driven investment insights in seconds.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors