Chapter 05 / Applied AI
Financial RAG Analyst.
Ask questions of company filings with the source close at hand.
The idea
Document processing meets hybrid retrieval and specialist analysis.
Python / Streamlit / OpenAI / ChromaDB / BM25
Animated architecture
Two indexes, one grounded context
A shared team system. Arrows explain data preparation and question answering, not a measured runtime trace.
01 / Prepare filings
02 / Build complementary indexes
03 / Ask and retrieve
04 / Route the answer
05 / Inspect
Control flow / Decisions & data
Index once, retrieve through two complementary paths
The ingestion lane prepares filing context. At question time, semantic and keyword rankings converge before the application selects an answer path.
Scroll across the diagram to follow each branch
Reading the flow
- Document processing removes noise, identifies sections and creates chunks with metadata before retrieval.
- Semantic retrieval can match related concepts; BM25 can retain exact phrases and financial terms. Rank fusion combines candidates instead of treating raw scores as interchangeable.
- The question router chooses between direct generation and a specialist path. The diagram represents alternatives, not sequential calls to every specialist.
- References make answers reviewable against the filing. Retrieval can still omit context and generation can still misinterpret it; the original document remains the authority.
The starting point
Why this project?
Company filings contain relevant information across long sections, tables, and disclosures. Finding the right context is a prerequisite to answering a useful question.
My contribution
The work I brought to it.
Contributed as part of a collaborative team project. This repository is a team fork; the architecture describes the shared system rather than individual module ownership.
How it works
From input to output.
SEC filings are cleaned, divided into sections, and chunked. OpenAI embeddings populate ChromaDB while BM25 indexes keywords. A question retrieves and combines ranked context, then follows a direct answer path or a specialist agent route in the Streamlit application.
- SEC filing
- Sections and chunks
- Hybrid retrieval
- Answer and sources
A design decision
Combine meaning with exact terms.
Semantic retrieval finds conceptually related passages; BM25 preserves exact wording. Rank-based fusion combines candidates before generation. Citations support review but do not guarantee a correct answer.
The evidence
Look under the surface.
These links point to the reviewed source revision, so the implementation behind this story stays inspectable.
Current boundaries
Useful work. Honest limits.
- Financial accuracy and end-to-end runtime were not independently validated.
- Generated answers require checking against the original filing; this prototype does not provide investment advice.
Source reviewed October 3, 2026.
Let’s build something
worth protecting.
“A thoughtful conversation can be the beginning of something worth building.”Connect on LinkedIn