How pragy10/finesse works
Finesse lets an authenticated user upload insurance PDFs, then search policy text or ask questions and receive AI answers with clause citations. The upload route orchestrates parsing, chunking, storage, indexing, and metadata; the query and answer routes serve distinct retrieval and reasoning paths. The graph also includes profile management and monitoring. Relationships come from the supplied excerpts, SOURCE INDEX references, and README; unsampled feature internals are represented only where documented.
Main entry points: documents.js Document routes · App.jsx App routes · server.js Express server · ask.js Answer route
Components 25
Web experience
- App routes
frontend/src/App.jsx - Auth state
frontend/src/context/AuthContext.jsx - Document state
frontend/src/context/DocumentContext.jsx - PDF upload
frontend/src/components/features/FileUpload.jsx - AI assistant
frontend/src/components/features/AIAssistant.jsx - Clause search
frontend/src/components/features/ClauseSearch.jsx
API and identity
- Express server
backend/server.js - Token verification
backend/middleware/auth.js - Profile routes
backend/routes/profile.js
Document ingestion
- Document routes
backend/routes/documents.js - PDF extraction
backend/parsing/parseDocument.js - Smart chunking
backend/setup/smartChunker.js - Chunk indexing
backend/vector/storeChunks.js
Search and reasoning
- Text embeddings
backend/vector/embed.js - Answer route
backend/routes/ask.js - Search route
backend/routes/query.js - AI reasoning
backend/llm/reasoningEngine.js - LLM client
backend/config/openRouterClient.js
Data and monitoring
- Firestore metadata
backend/config/firebaseAdmin.js - PDF storage
backend/config/supabaseClient.js - Vector database
backend/vector/qdrantClient.js - Prometheus metrics
backend/config/metrics.js - Firebase Auth
frontend/src/config/firebase.js
Other components
- Policy holder
- OpenRouter service
Connections 35
- Policy holder → App routes: uses
README.md - App routes → Auth state: provides auth
frontend/src/App.jsx - App routes → Document state: provides documents
frontend/src/App.jsx - App routes → PDF upload: hosts workflow
- App routes → AI assistant: hosts workflow
- App routes → Clause search: hosts workflow
- Auth state → Firebase Auth: authenticates with
frontend/src/context/AuthContext.jsx - Auth state → Profile routes: fetches profile
frontend/src/context/AuthContext.jsx - Document state → Document routes: loads and manages
frontend/src/context/DocumentContext.jsx - PDF upload → Document routes: uploads PDFs
README.md - AI assistant → Answer route: asks questions
README.md - Clause search → Search route: searches clauses
README.md - Express server → Document routes: mounts routes
backend/server.js - Express server → Profile routes: mounts routes
backend/server.js - Express server → Search route: mounts routes
backend/server.js - Express server → Answer route: mounts routes
backend/server.js - Express server → Prometheus metrics: records traffic
backend/server.js - Document routes → Token verification: requires auth
backend/routes/documents.js - Document routes → PDF extraction: extracts text
backend/routes/documents.js - Document routes → Smart chunking: chunks text
backend/routes/documents.js - Document routes → PDF storage: stores PDFs
backend/routes/documents.js - Document routes → Chunk indexing: indexes chunks
backend/routes/documents.js - Document routes → Firestore metadata: writes metadata
backend/routes/documents.js - Chunk indexing → Text embeddings: embeds chunks
backend/vector/storeChunks.js - Chunk indexing → Vector database: writes vectors
backend/vector/storeChunks.js - Search route → Text embeddings: embeds query
backend/routes/query.js - Search route → Vector database: searches vectors
backend/routes/query.js - Answer route → Text embeddings: embeds query
backend/routes/ask.js - Answer route → Vector database: retrieves matches
backend/routes/ask.js - Answer route → AI reasoning: generates answer
backend/routes/ask.js - AI reasoning → LLM client: requests completion
backend/llm/reasoningEngine.js - LLM client → OpenRouter service: calls API
backend/config/openRouterClient.js - Profile routes → Token verification: requires auth
backend/routes/profile.js - Profile routes → Firestore metadata: reads and writes
backend/routes/profile.js - Token verification → Firestore metadata: verifies token
backend/middleware/auth.js