Skip to content

The Autonomous Investment Committee: A Multi-Agent System for Hybrid Asset Analysis & Interactive Visualization.

Notifications You must be signed in to change notification settings

creosB/Cofinance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ“ˆ Cofinance Analyst

Streamlit App Python Phidata Gemini

Cofinance

The Autonomous Investment Committee that lives in your browser.


πŸ’‘ The Pitch

The Problem

Retail investors are drowning in noise. To analyze a single asset, you need to switch between TradingView for charts, Yahoo Finance for fundamentals, and Twitter/News for sentiment. It's a fragmented, cognitive nightmare that leads to bad decisions.

The Solution

Cofinance Analyst is not just a chatbotβ€”it's an Agentic Orchestrator. It unifies the entire financial research workflow into a single conversation. By coordinating a team of specialized AI agents, it delivers institutional-grade analysis, interactive visuals, and real-time data without you ever leaving the chat.

The Value

  • Context-Aware Intelligence: Automatically switches strategies based on asset class (e.g., analyzing P/E for Stocks vs. Volatility for Crypto).
  • Zero Hallucination Risk: Agents are physically incapable of guessing data; they must use Python tools to fetch real-time prices and news.
  • Visual Alpha: Generates interactive Plotly charts on the fly, bridging the gap between text and technical analysis.

πŸ€– Architecture

Cofinance uses a Hub-and-Spoke architecture where a central "Manager Agent" directs specialized workers.

sequenceDiagram
    participant U as πŸ‘€ User
    participant M as 🧠 Manager Agent
    participant D as πŸ“‰ Data Analyst
    participant N as πŸ“° News Researcher
  
    U->>M: "Should I buy Bitcoin?"
    Note over M: πŸ’­ Strategy: Detected Crypto.<br/>Activating Risk Guardian Mode.
  
    par Parallel Execution
        M->>D: Get Price & Volatility
        D->>D: yFinance API
        M->>N: Get Sentiment & FUD
        N->>N: DuckDuckGo Search
    end
  
    D-->>M: Price: $95k, Volatility: High
    N-->>M: Sentiment: Extreme Greed
  
    Note over M: βš–οΈ Synthesis: Price is up,<br/>but risk is too high.
  
    M->>U: "Bitcoin is up, but overextended. Wait for pullback."
Loading

✨ Key Features

1. Hybrid Asset Intelligence 🧠

The system is smart enough to treat assets differently:

  • Stocks (AAPL, NVDA): Focuses on Earnings, Revenue, and P/E Ratios.
  • Crypto (BTC, SOL): Switches to Risk Management Mode, analyzing Fear & Greed Index, Distance from ATH, and Volatility.

2. Interactive "Living" Charts πŸ“Š

No more static images. The Data Agent writes and executes Python code to generate interactive Plotly charts that you can zoom, pan, and hover over for exact price points.

3. Persistent Portfolio Memory πŸ’Ύ

Unlike standard LLM chats that forget you instantly, Cofinance uses an SQLite Database to maintain your personal "Watchlist" across sessions.

  • Ask: "How is my portfolio doing?"
  • Action: Agent queries the DB, checks your specific tickers, and summarizes the news.

πŸ› οΈ Technical Implementation

This project demonstrates mastery of Agentic AI concepts:

  • Multi-Agent Orchestration: Implemented via phidata using a Team Lead/Worker pattern.
  • Tool Use (Function Calling): Custom Python tools for yfinance, duckduckgo_search, and sqlite3.
  • Structured Output: Enforces strict "Strategy -> Data -> News -> Verdict" response formats using System Prompt Engineering.
  • Observability: Full visibility into agent thought processes via Streamlit expanders.

πŸ“Έ Screenshots

Feature Screenshot
Summary Summary
Deep Think Deep Think
Response Response
Watchlist Watchlist
Compare Compare

Video

Watch the video


πŸš€ Quick Start

Prerequisites

  • Python 3.9+
  • A Google Gemini API Key or LLM Studio or OpenRouter API Key

Installation

  1. Clone the repo

    git clone [https://github.com/creosb/Cofinance-analyst.git](https://github.com/cresoB/Cofinance.git)
    cd Cofinance-analyst
  2. Create a Virtual Environment (Windows)

    python -m venv .venv
    .\.venv\Scripts\Activate.ps1
  3. Install Dependencies

    pip install -r requirements.txt
  4. Set Up Keysexport GOOGLE_API_KEY="your_api_key_here"

  5. Run the App

    python -m streamlit run app.py --browser.gatherUsageStats false

πŸ§ͺ Testing

We use pytest to ensure our data tools are robust (especially the crypto-fallback logic).

pytest -q

πŸ“‚ Project Structure

Cofinance-analyst/
β”œβ”€β”€ agents/             # Agent definitions (Manager, Data, News)
β”œβ”€β”€ tools/              # Custom Python tools (yfinance, plotly)
β”œβ”€β”€ storage/            # SQLite database logic
β”œβ”€β”€ tests/              # Unit tests for tools
β”œβ”€β”€ app.py              # Main Streamlit application
β”œβ”€β”€ requirements.txt    # Pinned dependencies
└── README.md           # Documentation

πŸ† Hackathon Submission Details

  • Track: Finance Agent / Multi-Agent Systems
  • Framework: Phidata
  • Model: Google Gemini 2.5 Flash - Qwen 3 4b - gpt oss 20b

Built with ❀️ by Creos

License


Please contact me first to share or make changes anywhere.


This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0


About

The Autonomous Investment Committee: A Multi-Agent System for Hybrid Asset Analysis & Interactive Visualization.

Topics

Resources

Stars

Watchers

Forks

Languages