How rexya05/findocai works
FinDocAI turns SEC filing PDFs into searchable, citation-grounded answers, then audits those answers before presenting them through a UI or REST API. The documented ingestion path extracts, cleans, chunks, embeds, and stores filing text; the query path retrieves relevant chunks, generates an answer, and checks citations and faithfulness. A LangGraph workflow adds routing, revision, and remediation, while a benchmark module compares baseline and agentic behavior. The graph combines sampled source with README descriptions; some agent wiring and API details were not fully shown, so those links rely on documented behavior.
Main entry points: stage6_api.py FastAPI Service · stage7_ui.py Streamlit UI · stage8_agents.py Compliance Auditor · stage4_rag.py Grounded RAG
Components 17
Filing Ingestion
- PDF Extraction
src/stage1_extractor.py - Text Chunking
src/stage2_chunking.py - Embeddings
src/stage3_embed.py
Grounded Analysis
- Grounded RAG
src/stage4_rag.py - Answer Guardrails
src/stage5_guardrails.py - Query Router
src/stage8_agents.py - Agent Retriever
src/stage8_agents.py - Financial Analyst
src/stage8_agents.py - Compliance Auditor
src/stage8_agents.py - Remediation Node
src/stage8_agents.py
User Interfaces
- FastAPI Service
src/stage6_api.py - Streamlit UI
src/stage7_ui.py
Evaluation
- Benchmark Evaluation
src/stage9_eval.py
Other components
- User
- SEC EDGAR
- Chunk Vector Store
- Gemini
Connections 24
- User → Streamlit UI: submits query
README.md - Streamlit UI → FastAPI Service: calls REST API
src/stage7_ui.py - User → FastAPI Service: calls REST API
README.md - FastAPI Service → PDF Extraction: downloads and extracts
src/stage6_api.py - PDF Extraction → SEC EDGAR: downloads PDF
src/stage1_extractor.py - FastAPI Service → Text Chunking: cleans and chunks
src/stage6_api.py - FastAPI Service → Embeddings: indexes chunks
src/stage6_api.py - Embeddings → Chunk Vector Store: stores vectors
src/stage3_embed.py - Grounded RAG → Embeddings: searches vectors
src/stage4_rag.py - Grounded RAG → Gemini: generates answer
src/stage4_rag.py - FastAPI Service → Grounded RAG: requests answer
src/stage6_api.py - FastAPI Service → Answer Guardrails: verifies answer
README.md - Answer Guardrails → Gemini: scores faithfulness
src/stage5_guardrails.py - Query Router → Agent Retriever: routes in-scope
README.md - Agent Retriever → Embeddings: retrieves chunks
src/stage8_agents.py - Agent Retriever → Financial Analyst: provides context
README.md - Financial Analyst → Compliance Auditor: submits draft
README.md - Compliance Auditor → Financial Analyst: returns critique
README.md - Compliance Auditor → Remediation Node: routes after retries
README.md - Query Router → Streamlit UI: returns routed result
README.md - Compliance Auditor → Streamlit UI: returns approved answer
README.md - Remediation Node → Streamlit UI: returns safe response
README.md - Benchmark Evaluation → Grounded RAG: benchmarks baseline
src/stage9_eval.py - Benchmark Evaluation → Query Router: benchmarks agent graph
src/stage9_eval.py