Inspiration

The idea behind FinAI was driven by a vision to make financial insights more accessible and leverage AI for fast, efficient analysis. For many, the financial landscape can be complex, especially those new to investing or market trends. My goal was to develop a tool that simplifies market data, news, and expert opinions, presenting them in a clear and actionable manner. Additionally, this project was fueled by AI’s ability to process vast amounts of financial information, uncovering patterns and opportunities with speed and precision. Imagine having an AI-powered assistant that gathers and analyzes the latest financial data for you, delivering tailored insights and recommendations effortlessly. This Multi-AI-Agent-powered application does exactly that!

What it does

The project leverages the phi-agent library to create a multi-agent system. This system is composed of three key agents:

  1. Web Search Agent: Responsible for gathering the latest financial news and analysis from the web using tools like DuckDuckGo.
  2. Finance AI Agent: Specializes in providing comprehensive stock analysis using the yfinance library, including market data, financial metrics, and company news.
  3. Multi-AI Agent: Acts as a coordinator, combining the insights from the other two agents to provide a coherent and structured response to user queries.

The project is built using Python and the Streamlit framework for the user interface. The user can select from different Large Language Models (LLMs) such as Ollama, OpenAI, and Deepseek(using Groq). When OpenAI or Groq are selected, the user is asked to provide their API key. The agents use the selected LLM to process data, generate insights, and communicate with the user.

Key libraries and technologies used include:

  1. streamlit: For creating the interactive web application.
  2. phi-agent: For building and managing the AI agent system.
  3. yfinance: For retrieving financial data from Yahoo Finance.
  4. DuckDuckGo: For web searching capabilities.
  5. Ollama, OpenAI, Groq: Providing the language models for the agents. Used Deepseek-r1 with Groq.

Challenges I ran into

  1. API Key Management: Securely handling and managing API keys for different LLMs (OpenAI, Groq) was a key concern.
  2. Error Handling: Implementing robust error handling to gracefully manage issues such as invalid API keys, network errors, and unexpected responses from the LLMs.
  3. LLM Integration: Dealing with the nuances of integrating different LLMs, each with its own API and response format.
  4. Stream Processing: Implementing streaming of the LLM responses to provide a more interactive and responsive user experience.
  5. Rate Limiting: Avoiding rate limits with the different APIs being used (yfinance, DuckDuckGo, LLM APIs).

Accomplishments that I'm proud of

  1. Seamless LLM Integration: Successfully integrating multiple LLMs (Ollama, OpenAI, Groq) and allowing users to switch between them based on their preferences and API availability.
  2. Multi-Agent System Design: Creating an effective multi-agent system that leverages the strengths of different AI agents to provide comprehensive financial analysis.
  3. Real-time Data Streaming: Implementing real-time streaming of LLM responses to provide users with an interactive and responsive experience.

What I learned

  1. AI Agent Architectures: Gained practical experience in designing and implementing multi-agent systems for complex tasks.
  2. Financial Data Analysis: Developed a deeper understanding of financial data sources and analysis techniques.
  3. LLM Integration: Improved my skills in integrating and working with different LLMs using APIs.
  4. Streamlit Development: Enhanced my ability to create interactive and user-friendly web applications using Streamlit.
  5. Working with APIs for LLM powered applications.

What's next for FinAI: Your AI Finance Navigator

  1. Incorporate newer, more capable language models for enhanced financial analysis.
  2. Integrate additional financial APIs for broader data coverage.
  3. Create a mobile application for on-the-go access.

Built With

Share this project:

Updates