How vishalm342/lumenfin works
LumenFin is a secured financial-document intelligence application. Analysts upload PDFs, which are parsed, chunked, embedded, and indexed; they then ask questions, retrieve user-scoped passages, and receive streamed, cited answers. Chat history and document management support that workflow. The README documents the ingestion stages and capabilities; sampled source confirms chat retrieval, generation, persistence, and UI behavior. Some ingestion and document-management internals were not sampled, so those relationships rely on README evidence.
Main entry points: route.ts Chat endpoint · vectorstore.ts Hybrid retrieval · page.tsx Dashboard · DocumentVault.tsx Document vault
Components 22
Analyst experience
- Dashboard
src/app/dashboard/page.tsx - Document vault
src/components/dashboard/DocumentVault.tsx - Analysis chat
src/components/dashboard/FinancialAnalysisChat.tsx - Chat sidebar
src/components/dashboard/Sidebar.tsx - Authentication
src/middleware.ts
Document ingestion
- Ingestion endpoint
src/app/api/ingest/route.ts - PDF processing
src/app/api/ingest/route.ts - Chunk embedding
src/app/api/ingest/route.ts - Vector index
src/lib/vectorstore.ts
Grounded analysis
- Chat endpoint
src/app/api/chat/route.ts - Hybrid retrieval
src/lib/vectorstore.ts - Answer generation
src/app/api/chat/route.ts
Application data
- Chat management API
src/app/api/chats/route.ts - Chat detail API
src/app/api/chats/[id]/route.ts - Chat records
src/models/Chat.ts - Mongoose connection
src/lib/db.ts - MongoDB connection
src/lib/mongodb.ts - Document listing API
src/app/api/documents/route.ts - Document records
src/models/Document.ts
Other components
- Analyst
- SambaNova
- Gemini embeddings
Connections 28
- Analyst → Dashboard: uses
README.md - Dashboard → Document vault: presents
src/app/dashboard/page.tsx - Dashboard → Analysis chat: presents
src/app/dashboard/page.tsx - Analyst → Authentication: signs in
README.md - Authentication → Dashboard: protects
README.md - Document vault → Ingestion endpoint: uploads PDFs
- Ingestion endpoint → PDF processing: parses PDFs
README.md - PDF processing → Chunk embedding: segments text
README.md - Chunk embedding → Gemini embeddings: creates vectors
README.md - Chunk embedding → Vector index: stores chunks
README.md - Analysis chat → Chat endpoint: sends questions
README.md - Chat endpoint → Hybrid retrieval: calls search
src/app/api/chat/route.ts - Hybrid retrieval → Gemini embeddings: embeds query
src/lib/vectorstore.ts - Hybrid retrieval → Vector index: searches vectors
src/lib/vectorstore.ts - Chat endpoint → Answer generation: formats context
src/app/api/chat/route.ts - Answer generation → SambaNova: streams answer
src/app/api/chat/route.ts - Analysis chat → Chat sidebar: shows history
src/components/dashboard/FinancialAnalysisChat.tsx - Chat sidebar → Chat management API: loads and manages
src/components/dashboard/Sidebar.tsx - Chat management API → Mongoose connection: connects through
src/app/api/chats/route.ts - Chat detail API → Mongoose connection: connects through
src/app/api/chats/[id]/route.ts - Chat endpoint → Mongoose connection: connects through
src/app/api/chat/route.ts - Chat endpoint → Chat records: updates messages
src/app/api/chat/route.ts - Chat management API → Chat records: manages records
src/app/api/chats/route.ts - Chat detail API → Chat records: manages records
src/app/api/chats/[id]/route.ts - Hybrid retrieval → MongoDB connection: connects through
src/lib/vectorstore.ts - Document vault → Document listing API: manages documents
- Document listing API → MongoDB connection: connects through
src/app/api/documents/route.ts - Document listing API → Document records: reads records