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!

Project Tasks

39 workspace tasks
#1

Implement Navigation for Landing

35.15 cr estimated
To Do
#7

Implement CTASection for Landing

17.57 cr estimated
To Do
#26

Build Knowledge Base Ingestion

95.9 cr estimated
To Do
#33

Setup Global Theme Design System

70.3 cr estimated
To Do
#38

Synthetic Knowledge Base

180 cr estimated
To Do
#39

Setup Fast API Backend Structure

47.95 cr estimated
To Do
#2

Implement Hero Section for Landing

52.72 cr estimated
To Do
#3

Implement Stats Section for Landing

35.15 cr estimated
To Do
#4

Implement Features Section for Landing

35.15 cr estimated
To Do
#5

Implement How It Works Section for Landing

35.15 cr estimated
To Do
#6

Implement Companies Section for Landing

35.15 cr estimated
To Do
#8

Implement Footer for Landing

17.57 cr estimated
To Do
#9

Implement Navigation for Search

17.57 cr estimated
To Do
#27

Build Semantic Retrieval Service

83.92 cr estimated
To Do
#31

Implement GET /search Endpoint

59.94 cr estimated
To Do
#32

Implement GET /company/{ticker} Endpoint

71.93 cr estimated
To Do
#34

Setup Axios API Client

58.75 cr estimated
To Do
#10

Implement Search Header for Search

35.15 cr estimated
To Do
#11

Implement Search Bar for Search

52.72 cr estimated
To Do
#12

Implement Company Grid for Search

70.3 cr estimated
To Do
#14

Implement Recent Searches for Search

70.3 cr estimated
To Do
#15

Implement Financial Highlights for Stock Detail

17.57 cr estimated
To Do
#16

Implement Key Metrics for Stock Detail

35.15 cr estimated
To Do
#17

Implement Annual Report Summary for Stock Detail

17.57 cr estimated
To Do
#18

Implement Recent News Summary for Stock Detail

52.72 cr estimated
To Do
#19

Implement AIAssistant Preview for Stock Detail

17.57 cr estimated
To Do
#20

Implement Footer for Stock Detail

17.57 cr estimated
To Do
#28

Integrate Gemini LLM Response

95.9 cr estimated
To Do
#13

Implement Search Filters for Search

35.15 cr estimated
To Do
#21

Implement Query Input for AIAssistant

52.72 cr estimated
To Do
#22

Implement Response Display for AIAssistant

52.72 cr estimated
To Do
#23

Implement Citation Panel for AIAssistant

35.15 cr estimated
To Do
#24

Implement Comparison View for AIAssistant

70.3 cr estimated
To Do
#25

Implement Related Questions for AIAssistant

35.15 cr estimated
To Do
#29

Implement POST /chat Endpoint

83.92 cr estimated
To Do
#30

Implement POST /compare Endpoint

83.92 cr estimated
To Do
#37

Integrate Stock Detail Page Backend

100 cr estimated
To Do
#35

Integrate AIAssistant Chat Flow

120 cr estimated
To Do
#36

Integrate Search Page Backend

100 cr estimated
To Do
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
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