Skip to content
Arian Khademi
All projects

CapitalLens

2025

LLM assistant for financial documents

  • React
  • FastAPI
  • PostgreSQL
  • pgvector
  • OpenAI API
  • Docker

CapitalLens is a research assistant for financial documents. You give it the dense stuff (annual reports, earnings transcripts, investor decks) and ask analyst-style questions, and it answers with the exact passages it pulled from. The point isn’t a chatbot; it’s getting answers you can actually trust enough to cite.

What I built

  • A retrieval-augmented generation pipeline: document parsing, chunking, embeddings, semantic search over PostgreSQL/pgvector, and OpenAI responses grounded in the retrieved text.
  • Citations and retrieved snippets on every answer, plus an explicit “insufficient context” response when the documents don’t actually support a claim.
  • An evaluation harness measuring retrieval quality, hallucination risk, and answer consistency across queries, so changes could be judged against numbers instead of gut feel.
  • Memo generation that summarizes company performance, risk factors, and revenue drivers from uploaded documents.
  • The whole thing (frontend, backend, database, and a worker) containerized with Docker Compose and wired to CI/CD checks for tests and linting.

Why it matters

The eval harness is the part I’d show you first. When a system is answering questions about financial numbers, “the RAG feels accurate” isn’t a sentence you’re allowed to say, so I built something that scores retrieval quality, hallucination risk, and answer consistency as actual measurements. The other lesson was subtraction: teaching the system to say “I don’t have enough in these documents to answer that” did more for trust than any clever prompt I wrote.