How tirthraj1605/ai-powered-investor-intelligence-platform works
The product is an investor-intelligence backend that turns uploaded annual-report PDFs into searchable report content and stored financial KPIs, then serves KPI dashboards and report-grounded chat. Its main workflow runs from upload through conversion, chunking, Azure AI Search indexing, RAG extraction, and PostgreSQL persistence. Azure OpenAI provides embeddings and structured or conversational completions. The tree also contains a second FastAPI entry point for dashboard and health routes; the sampled excerpts do not establish how that entry point is deployed. Relationships below are limited to shown calls and documented capabilities.
Main entry points: app.py FastAPI app · ingest_documents.py Ingestion orchestrator · postgres_sql.py PostgreSQL connection · chat.py Chat endpoint
Components 22
API and dashboard
- FastAPI app
app.py - Alternate API app
main.py - Upload endpoint
routes/ingestion.py - Chat endpoint
routes/chat.py - Dashboard view
templates/dashboard.html - Dashboard route
routes/dashboard.py - Health route
routes/health.py
Report ingestion
- Ingestion orchestrator
ingestion/ingest_documents.py - PDF conversion
ingestion/pdf_to_markdown.py - Semantic chunking
ingestion/semantic_chunker.py
Search and AI
- Search store and retriever
vectorstore/azure_ai_search.py - Search index setup
vectorstore/create_index.py - KPI RAG extraction
rag/kpi_extractor_rag.py - OpenAI client
llm/azure_openai.py
KPI persistence
- KPI persistence
database/save_metrics.py - KPI reader
database/metrics.py - Database setup
database/create_table.py - PostgreSQL connection
database/postgres_sql.py
Other components
- Investor / uploader
- Azure AI Search
- Azure OpenAI
- PostgreSQL
Connections 30
- Investor / uploader → Upload endpoint: uploads PDF
routes/ingestion.py - Investor / uploader → Chat endpoint: asks question
routes/chat.py - Investor / uploader → FastAPI app: opens dashboard
app.py - FastAPI app → Upload endpoint: registers route
app.py - FastAPI app → Chat endpoint: registers route
app.py - FastAPI app → KPI reader: reads metrics
app.py - FastAPI app → Dashboard view: renders template
app.py - FastAPI app → Database setup: creates tables
app.py - FastAPI app → Search index setup: creates index
app.py - Alternate API app → Dashboard route: registers route
main.py - Alternate API app → Health route: registers route
main.py - Upload endpoint → Ingestion orchestrator: calls ingestion
routes/ingestion.py - Ingestion orchestrator → PDF conversion: converts PDF
ingestion/ingest_documents.py - Ingestion orchestrator → Semantic chunking: chunks markdown
ingestion/ingest_documents.py - Ingestion orchestrator → Search store and retriever: uploads chunks
ingestion/ingest_documents.py - Ingestion orchestrator → KPI RAG extraction: extracts KPIs
ingestion/ingest_documents.py - Ingestion orchestrator → KPI persistence: saves metrics
ingestion/ingest_documents.py - Ingestion orchestrator → Azure OpenAI: requests embeddings
ingestion/ingest_documents.py - Search store and retriever → Azure AI Search: uploads and searches
vectorstore/azure_ai_search.py - Search index setup → Azure AI Search: configures index
vectorstore/create_index.py - KPI RAG extraction → Search store and retriever: retrieves report context
rag/kpi_extractor_rag.py - KPI RAG extraction → OpenAI client: requests structured output
rag/kpi_extractor_rag.py - Chat endpoint → Search store and retriever: retrieves context
routes/chat.py - Chat endpoint → OpenAI client: requests chat completion
routes/chat.py - OpenAI client → Azure OpenAI: calls completion API
llm/azure_openai.py - KPI persistence → PostgreSQL connection: gets engine
database/save_metrics.py - KPI reader → PostgreSQL connection: queries metrics
database/metrics.py - Database setup → PostgreSQL connection: uses connection
database/create_table.py - PostgreSQL connection → PostgreSQL: connects
database/postgres_sql.py - Dashboard route → PostgreSQL connection: reads dashboard data
routes/dashboard.py