SEC RAG is a full-stack Retrieval-Augmented Generation experience tailored for exploring SEC filings. It combines a FastAPI backend, LlamaIndex pipelines, Chroma vector search, and a polished React UI to surface explainable answers with source citations.
- End-to-end question answering over bundled 10-K filings with automatic CIK normalization and Gemini-powered reasoning.
- Real-time streaming chat UX that exposes intermediate steps (chain-of-thought) and relevance-ranked sources.
- Document ingestion pipeline that cleans raw SEC submissions and syncs them into a pgvector-backed Chroma store.
- Typed SDK generated from FastAPI OpenAPI schema for the
frontendto stay in lockstep with the API.
- Backend: FastAPI, LlamaIndex, Python
uv, Celery-style task orchestration for long-running jobs. - Vector Store: ChromaDB (SQLite) with pgvector-friendly schema for portability.
- Frontend: React 19 + Vite + Tailwind, AI SDK for streaming assistant responses.
- Tooling:
uvfor dependency management, Makefile helpers, Docker Compose for local Postgres experiments.
-
Launch the API server.
uv sync make run
-
Fire up the frontend (served via Vite).
cd frontend npm install npm run dev -
Open the chat interface at the Vite dev URL (default
http://localhost:5173). Ask, for example, “What risks did Apple highlight in its 2023 10-K?” — the assistant streams the answer with traceable sources. -
Explore the documents page to browse indexed filings and trigger embeddings refreshes.
- Chat with Citations: Streamed responses, status timeline, chain-of-thought toggle, and document provenance baked into each answer.
- Document Embedding Pipeline: Structured ingestion cleans raw EDGAR text, chunks filings, and upserts embeddings into Chroma.
- API-first Architecture:
/ask/stream,/documents, and EDGAR enrichment endpoints drive both UI and automation. - Developer Experience: Generated SDK clients, comprehensive Makefile targets, and environment loading guardrails in
app/main.py.
- Populate
.envwithGOOGLE_API_KEY(seeapp/main.py). - Download or generate SEC filings in
data/for your target tickers. - Run
make runfor API,npm run devfor frontend, and connect athttp://localhost:5173.

