💡 Inspiration
Conducting deep fundamental equity research is overwhelmingly tedious. Analysts and retail investors alike must manually dig through 100+ page SEC or BSE filings, track live market sentiment across disparate news sources, and manually calculate complex financial metrics.
While generative AI offers speed, it is notoriously dangerous for finance because it suffers from hallucinations (inventing numbers) and lacks verifiable citations. We were inspired to build EquAiLens to bridge this gap: to marry deterministic financial mathematics with probabilistic AI, creating an autonomous agent that can generate Wall Street-level research reports where every single claim is cited and mathematically sound.
⚙️ How we built it
EquAiLens is a full-stack, autonomous AI equity research analyst built with a modern, high-performance stack:
- Backend & APIs: We used FastAPI (Python) to handle core routing and natively integrated with both the US SEC EDGAR and BSE India databases to download raw regulatory filings.
- AI & Orchestration: We used LangGraph to model the research process as a multi-agent state machine (Planner, Evidence Gatherer, Analyst, Verifier). We utilized OpenAI for the LLM reasoning and
text-embedding-3-smallfor semantic chunking. - Vector Database: We implemented Qdrant to store and query the embedded document chunks for the Retrieval-Augmented Generation (RAG) pipeline.
- Frontend: A stunning, premium dark-mode UI built with React (Vite) utilizing custom Glassmorphism CSS for the Dashboard, Screener, and Chatbot interfaces.
🚧 Challenges we ran into
1. LLM Hallucinations with Financial Math
Early on, relying on the LLM to calculate ratios resulted in frequent arithmetic errors. We solved this by completely decoupling the math from the AI. We built a deterministic Python engine that calculates the ratios natively, while the LLM is restricted to interpreting those metrics.
For example, instead of asking the AI to calculate the P/E ratio, our engine computes it directly: $$ \text{P/E Ratio} = \frac{\text{Share Price}}{\text{Earnings Per Share (EPS)}} $$ $$ \text{EV/EBITDA} = \frac{\text{Market Cap} + \text{Total Debt} - \text{Cash}}{\text{EBITDA}} $$ The LLM then receives these mathematically guaranteed inputs to analyze the valuation.
2. Orchestrating Asynchronous Data Streams
Gathering data from SEC PDFs, RSS news feeds, live market APIs, and vector databases simultaneously caused massive state-management headaches. Implementing LangGraph allowed us to orchestrate parallel execution nodes and gracefully manage timeouts.
3. Parsing Unstructured Financial Filings
Standard text splitters destroyed the tabular data inside balance sheets. We had to build custom, layout-aware extraction pipelines using PyMuPDF (for complex BSE PDFs) and BeautifulSoup (for SEC HTML filings) to ensure the LLM received contextually complete paragraphs rather than broken, meaningless numbers.
🏆 Accomplishments that we're proud of
- Successfully unifying two entirely different financial markets (US SEC and Indian BSE) into a single, seamless user interface.
- Building a dedicated Verification Node in our LangGraph pipeline that extracts factual claims from the AI's generated text and performs a secondary vector search to cross-check them against the source documents, virtually eliminating hallucinations.
- Designing a highly responsive React frontend that handles multi-format file serving (embedded PDFs and raw HTML viewing) beautifully.
🧠 What we learned
We learned that in fintech applications, you cannot trust an LLM to do everything. Combining deterministic code (for math and data fetching) with probabilistic AI (for reasoning and synthesis) is the key to building reliable agentic systems. We also gained deep experience with graph-based LLM orchestration and learned how to optimize document chunking strategies for highly structured financial documents.
🚀 What's next for EquAiLens
- Portfolio-Level Analysis: Expanding the agent to monitor and optimize an entire portfolio of stocks simultaneously, rebalancing recommendations based on macro-economic news.
- Alternative Data Integrations: Integrating alternative datasets like satellite imagery analysis of retail parking lots or supply chain shipping logs to give the AI an edge beyond standard 10-Ks.
- Multi-Modal RAG: Upgrading the parsing engine to natively understand charts and graphs inside annual reports using vision models.
Built With
- ai
- fastapi
- langgraph
- qdrant
- rag
- react
Log in or sign up for Devpost to join the conversation.