ai-research-assistant

byVinay Kumar

# AI Research Assistant (LLM-Powered RAG) - Complete Project Specification ## Project Overview This project is being built for a college placement hackathon organized by a fintech/brokerage company. The goal is to build an AI-powered financial research assistant capable of answering natural-language questions about Indian publicly listed companies. The assistant should provide accurate, grounded, citation-backed responses using Retrieval-Augmented Generation (RAG) instead of relying solely on the LLM's internal knowledge. The product is designed as an embedded AI assistant inside a stock brokerage application. --- # Primary Objectives The assistant should be able to answer questions like: * Summarize TCS's latest quarterly results. * Compare HDFC Bank and ICICI Bank. * What are the major risks facing Asian Paints? * What are Reliance's future growth drivers? * Explain Infosys revenue growth. * Summarize recent news about Tata Motors. * What are the key highlights from the latest annual report? Every answer must be grounded using retrieved documents and must include citations. --- # Companies Covered The project currently supports 20 large-cap Indian companies including: * Reliance * TCS * Infosys * HDFC Bank * ICICI Bank * SBI * Bharti Airtel * ITC * Asian Paints * Tata Motors * Maruti * L&T * Bajaj Finance * Kotak Bank * Axis Bank * Sun Pharma * NTPC * UltraTech Cement * Hindustan Unilever * Mahindra & Mahindra --- # Data Sources ## Synthetic Knowledge Base Synthetic data is allowed in the hackathon. Instead of downloading massive annual reports, a curated synthetic knowledge base has been created. Each company has three markdown documents. Example: knowledge_base/ TCS/ * company_knowledge.md * quarterly_results.md * recent_news.md AsianPaints/ * company_knowledge.md * quarterly_results.md * recent_news.md etc. --- ## company_knowledge.md Contains * Company Overview * Business Segments * Products & Services * Financial Highlights * Competitive Advantages * Risk Factors * Industry Outlook * Future Strategy --- ## quarterly_results.md Contains * Revenue * PAT * EBITDA * EPS * Operating Margins * Key Highlights * Management Commentary * Future Guidance --- ## recent_news.md Contains multiple realistic news articles including * Title * Date * Publisher * Summary This simulates Yahoo Finance news. --- # Backend Stack Python FastAPI MongoDB Google Gemini API Sentence Transformer Embedding Model --- # Frontend Stack React Vite Tailwind CSS Axios --- # RAG Pipeline Document Loader ↓ Read Markdown Files ↓ Metadata Extraction ↓ Chunking ↓ Embedding Generation ↓ Store Chunks in MongoDB ↓ Semantic Retrieval ↓ Prompt Builder ↓ Gemini ↓ Response + Citations --- # Chunking Strategy Chunk Size Approximately 500 words Overlap Approximately 100 words Chunks should preserve semantic meaning. Avoid splitting sections in the middle. --- # Metadata Each chunk should include metadata. Example { company: "TCS", ticker: "TCS", document_type: "company_knowledge", section: "Risk Factors", chunk_id: 21, source: "company_knowledge.md" } This metadata will later be used for citations and filtering. --- # MongoDB Structure Collection: documents Each document contains { company, ticker, document_type, chunk_id, section, text, embedding } --- # Retrieval Flow User asks a question ↓ Extract company names (if present) ↓ Retrieve relevant chunks ↓ Rank by semantic similarity ↓ Return Top-K chunks ↓ Pass retrieved context to Gemini --- # Prompt Design System Prompt "You are an AI Financial Research Assistant. Answer ONLY using the supplied context. Do not invent facts. If information is unavailable, clearly state that the context does not contain the answer. Always provide citations." --- # LLM Google Gemini Responsibilities * Read retrieved context * Generate grounded answer * Never hallucinate * Produce concise financial explanations * Add citations --- # Citations Each response should include citations like Source: Company Knowledge Section: Risk Factors or Quarterly Results Management Commentary --- # Frontend Requirements Pages Home Search Company Stock Detail Page AI Assistant Panel --- ## AI Assistant Chat interface User enters question ↓ Backend API ↓ Response displayed with citations --- # Suggested UI Left Company Information Center Stock Details Right AI Research Assistant Below answer Sources Used --- # Backend API POST /chat Input { "query":"Summarize TCS latest quarterly results." } Output { "answer":"...", "citations":[] } --- # Future APIs POST /compare POST /summarize POST /search --- # Expected Features Mandatory ✓ Question Answering ✓ Company Comparison ✓ Quarterly Report Summary ✓ News Summary ✓ Citation Support Stretch ✓ Streaming Responses ✓ Suggested Follow-up Questions ✓ Conversation Memory ✓ Bull vs Bear Analysis --- # Folder Structure project/ frontend/ backend/ knowledge_base/ TCS/ company_knowledge.md quarterly_results.md recent_news.md Infosys/ ... embeddings/ prompts/ models/ api/ docs/ README.md --- # Development Workflow Phase 1 Knowledge Base Completed Phase 2 Document Loader Chunking Metadata Extraction Embedding Generation Phase 3 MongoDB Storage Semantic Retrieval Phase 4 Gemini Integration Prompt Engineering Citation Generation Phase 5 Frontend React Vite Tailwind Chat UI Phase 6 Testing Presentation Demo --- # Success Criteria The assistant should * Answer questions correctly. * Use only retrieved context. * Produce concise financial summaries. * Cite sources. * Work with all 20 companies. * Respond in under 5 seconds. * Have a clean modern interface. The project should resemble an AI assistant integrated into a modern stock brokerage platform rather than a generic chatbot.

LandingStockDetailAIAssistantSearch
Landing

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document
Page 1 of 5

AI Research Assistant (LLM-Powered RAG)

Introduction

The AI Research Assistant project is designed to serve as an AI-powered financial research assistant capable of answering natural-language questions about Indian publicly listed companies. This project is being developed for a college placement hackathon organized by a fintech/brokerage company. The assistant will provide accurate, grounded, citation-backed responses using Retrieval-Augmented Generation (RAG) instead of relying solely on the LLM's internal knowledge. It is intended to be embedded within a stock brokerage application.

System Overview

The AI Research Assistant will support 20 large-cap Indian companies and provide users with the ability to query financial data, compare companies, and summarize reports and news. The system will utilize a synthetic knowledge base, a backend powered by Python and FastAPI, and a frontend built with React, Vite, and Tailwind CSS. The assistant will leverage the Google Gemini API for generating responses and MongoDB for data storage.

Page 2 of 5

Functional Requirements

  • As a User, I should be able to ask questions about the latest quarterly results of companies like TCS.
  • As a User, I should be able to compare financial metrics between companies such as HDFC Bank and ICICI Bank.
  • As a User, I should be able to inquire about major risks facing companies like Asian Paints.
  • As a User, I should be able to learn about future growth drivers for companies like Reliance.
  • As a User, I should be able to get explanations of revenue growth for companies like Infosys.
  • As a User, I should be able to receive summaries of recent news about companies like Tata Motors.
  • As a User, I should be able to view key highlights from the latest annual reports of supported companies.
  • As a User, I should receive responses that include citations from the retrieved documents.

User Personas

  • Research Analyst: Uses the assistant to gather detailed financial data and insights for analysis.
  • Investor: Seeks quick summaries and comparisons to make informed investment decisions.
  • Student: Participates in the hackathon and uses the assistant to learn about financial markets.

Core User Flows

  • User asks a question -> System extracts company names -> Retrieves relevant document chunks -> Ranks by semantic similarity -> Returns top-K chunks -> Passes context to Gemini -> Generates response with citations.
  • User compares companies -> System retrieves and compares financial metrics -> Displays comparison with citations.
Page 3 of 5

Visuals Colors and Theme

  • primary: #1E3A8A (Deep Blue)
  • primary_light: #3B82F6 (Light Blue)
  • secondary: #F97316 (Vibrant Orange)
  • accent: #10B981 (Emerald Green)
  • highlight: #F59E0B (Amber)
  • bg: #F3F4F6 (Light Gray)
  • surface: rgba(255, 255, 255, 0.8)
  • text: #111827 (Dark Gray)
  • text_muted: #6B7280 (Muted Gray)
  • border: rgba(209, 213, 219, 0.2)

Signature Design Concept

The homepage will feature an interactive financial dashboard that resembles a futuristic trading floor. Users can drag and drop company icons into a central analysis area where real-time data visualizations animate and update dynamically. The interface will use @react-three/fiber for 3D elements and framer-motion for smooth transitions and animations. As users interact, the dashboard will respond with kinetic typography and animated graphs that provide a tactile, engaging experience.

Interaction Model & Motion Direction

The landing page will employ a "parallax" interaction model, creating a layered depth effect as users scroll. This will be achieved with gsap for scroll-triggered animations, providing a visually rich first impression. Internal pages will maintain a "static" interaction model to prioritize readability and clarity.

Page 4 of 5

Non-Functional Requirements

  • The system should respond to queries in under 5 seconds.
  • The interface must be clean and modern, suitable for integration into a stock brokerage platform.
  • The assistant should work seamlessly with all 20 supported companies.

Tech Stack

  • Frontend: React, Vite, Tailwind CSS, Axios
  • Backend: Python, FastAPI
  • Database: MongoDB
  • AI Models: Google Gemini API, Sentence Transformer Embedding Model
  • AI Tools: Langchain
  • Orchestration: Docker, docker-compose

Assumptions and Constraints

  • The system will only cover the 20 specified large-cap Indian companies.
  • Synthetic data is permissible for the hackathon.
  • The assistant must be embedded within a stock brokerage application.
Page 5 of 5

Glossary

  • RAG: Retrieval-Augmented Generation
  • LLM: Large Language Model
  • PAT: Profit After Tax
  • EBITDA: Earnings Before Interest, Taxes, Depreciation, and Amortization
  • EPS: Earnings Per Share

This document outlines the comprehensive requirements and design for the AI Research Assistant project, ensuring alignment with the hackathon's objectives and the needs of its users.

Landing design preview
Landing: View Overview
Search: Select Company
StockDetail: View Highlights
AIAssistant: Get Summary
AIAssistant: View Citations
AIAssistant: Compare Stocks
AIAssistant: Review Metrics
AIAssistant: News Summary
AIAssistant: Investment Insights