NvidiaFinRAG: Dynamic Multi-Agent is a dynamic pipeline that provides specific curated information based on the user’s specific queries regarding Nvidia’s financial dataset. It utilizes Langchain as its foundation and operates with three distinct agents to serve its knowledge base.
- Snowflake Agent - Serving its stocks and visual analysis
- RAG Agent - Working to server from the extracted quarterly reports using embedding and vector database.
- Web Search - Provides the potential to fetch real time data analysis.
- Vedant Mane
- Abhinav Gangurde
- Yohan Markose
WE ATTEST THAT WE HAVEN’T USED ANY OTHER STUDENTS’ WORK IN OUR ASSIGNMENT AND ABIDE BY THE POLICIES LISTED IN THE STUDENT HANDBOOK
Application: Streamlit Deployment
Backend API: Google Cloud Run
Google Codelab: Codelab
Google Docs: Project Document
Video Walkthrough: Video
- Streamlit: Frontend Framework
- FastAPI: API Framework
- Google Cloud Run: Backend Deployment
- SerpAPI: Website Data Extraction Open Source Tool
- LangChain: Implementation of RAG agents
- Snowflake: Structured Data Strorage and Updation
- OpenAI: Retrieval-Augmented Generation
- Pinecone: Vector Database
-
Data Ingestion:
- (Unstructured) Extracted reports (PDFs) are from the previous workflow are utilized for further processing.
- For past 5 years worth of data has been processed and chunk are converted into OpenAI embeddings for semantic search.
- The embeddings are stored in Pinecone for cloud-based vector search.
- (Structured) Additional structured data has been has been scrapped and loaded from Yahoo Finance into 4 Snowflake tables.
-
Query Processing & Retrieval:
- Users interact with a Streamlit application, where they can:
- Select the Year and Quarter for the specific question.
- Choose agent from the RAG system they want the question to be answered with options such as Snowflake Agent , RAG Agent and Web Search agent.
- Submit a query related to the nvidia financial aspect.
- The query request is sent to FastAPI, which determines the retrieval method based on user selection.
- Users interact with a Streamlit application, where they can:
-
Agentic Multi-Agent System with LangGraph
- Using LangGraph, we have integrated and orchestrated the three specialized RAG agents to answer the query questions:
-
- Generic RAG Agent : Utilizing Pinecone and accessing filtered meta-data from stored Nvidia reports
-
- WebSearch Agent : Using SerpAPI and retriving information from top matching searches for any additional and latest context
-
- Snowflake Agent : Works on retrival of structured data scraped from Yahoo Finance for additional context from stocks preformace and visual representation
-
- Using LangGraph, we have integrated and orchestrated the three specialized RAG agents to answer the query questions:
-
Response Generation & Display:
- Retrieved information are intergrated to passed to an LLM in this case OpenAI, which generates a relevant consolidated response.
- The final output is sent back to the Streamlit UI, where users can view the extracted insights.
- User Input Users interact through the Streamlit UI, providing:
- Financial Queries: Users select the Year and Quarter for NVIDIA stock analysis.
- Agent Selection: Choose from Snowflake Agent, RAG Agent, or Web Search Agent for data retrieval.
- Frontend (Streamlit UI) The Streamlit application allows users to:
- Submit financial queries related to NVIDIA’s stock and reports.
- Select retrieval parameters (specific agent type).
- View AI-generated financial insights and stock visualizations.
- Backend (FastAPI as API Gateway) The FastAPI backend manages:
- Query Routing: Determines whether to use Snowflake, RAG, or Web Search.
- Data Processing: Retrieves structured/unstructured financial data.
- Response Generation: Integrates retrieved insights for AI-powered responses.
Step 1: Download and Install Google Cloud SDK
- Visit the Google Cloud SDK documentation for platform-specific installation instructions.
- Download the installer for your operating system (Windows, macOS, or Linux).
- Follow the installation steps provided for your system.
Step 2: Initialize Google Cloud SDK
- Open a terminal or command prompt.
- Run
gcloud init
to begin the setup process. - Follow the prompts to log in with your Google account and select a project.
Step 3: Verify Installation
- Run
gcloud --version
to confirm installation. - Use
gcloud config list
to check the active configuration.
- Build the Docker Image
# Build and tag your image (make sure you're in the project directory)
docker build --platform=linux/amd64 --no-cache -t gcr.io/<YOUR_PROJECT_ID>/fastapi-app .
- Test Locally (Optional but Recommended)
# Run the container locally
docker run -p 8080:8080 gcr.io/<YOUR_PROJECT_ID>/fastapi-app
# For Managing Environment Variables
docker run --env-file .env -p 8080:8080 gcr.io/<YOUR_PROJECT_ID>/fastapi-app
Visit http://localhost:8080/docs to verify the API works.
- Push to Google Container Registry
# Push the image
docker push gcr.io/<YOUR_PROJECT_ID>/fastapi-app
- Deploy to Cloud Run
gcloud run deploy fastapi-service \
--image gcr.io/<YOUR_PROJECT_ID>/fastapi-app \
--platform managed \
--region us-central1 \
--allow-unauthenticated
- Get your Service URL
gcloud run services describe fastapi-service \
--platform managed \
--region <REGION> \
--format 'value(status.url)'
- Check Application Logs
gcloud run services logs read fastapi-service --region <REGION>