# 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.
Sign in to leave a comment
No comments yet. Be the first!