SEC Filings RAG
Ask questions about FAANG 10-K filings with retrieval-augmented generation
Loads the 2023 10-K PDFs of the FAANG companies, chunks and embeds them into a FAISS index with LangChain, and answers financial questions from the filings themselves in a Streamlit app.
- 5 annual reports
- FAISS vector index
- Grounded answers
- Dockerised
§1
The problem
General LLMs don't know the latest filings and tend to make up numbers. Answers about a company's finances should come from its actual report.
§2
My role
Built the ingestion pipeline, the vector index, the retrieval chain and the Streamlit UI.
§3
Architecture
§4
Key decisions
D/01
Retrieve, then generate
Relevant chunks from the filings are put in the prompt, so answers are grounded in the source documents.
D/02
Index built once
PDFs are split with a recursive text splitter and embedded into FAISS at build time; queries only search.
§5
Challenges
- Chunk size vs. answer quality: financial tables break easily when split mid-row.
§6
Stack
- Python
- LangChain
- FAISS
- OpenAI
- Streamlit
- Docker
Next case study
FinTafsir
Upload a bank statement PDF, get structured JSON back