How ashish-netam011/prooflens works
VerifiDoc AI is a document-intelligence app for evidence-grounded answers across PDFs, with abstention, citations, search, contradiction checks, and amendment timelines. Users upload PDFs into a page-aware document library, then ask questions or search; the backend retrieves and verifies evidence before returning results. Separate UI and API branches support conflict comparison and amendment resolution. The graph reflects the README and supplied source excerpts/index; some endpoint-to-service relationships are documented or indexed rather than visible in full source, so uncertain links are omitted.
Main entry points: retrieval_service.py Hybrid retrieval · App.jsx App routes · main.py FastAPI app · documents.py Document endpoints
Components 31
User interface
- App routes
frontend/src/App.jsx - Document library
frontend/src/pages/Library.jsx - Upload interface
frontend/src/components/UploadPanel.jsx - Ask interface
frontend/src/pages/AskPage.jsx - Search interface
frontend/src/pages/SearchPage.jsx - Conflict view
frontend/src/pages/Contradictions.jsx - Amendment view
frontend/src/pages/Amendments.jsx - API transport
frontend/src/api/client.js
API workflows
- FastAPI app
backend/app/main.py - Document endpoints
backend/app/routers/documents.py - Q&A endpoint
backend/app/routers/qa.py - Search endpoint
backend/app/routers/search.py - Conflict endpoint
backend/app/routers/conflicts.py - Amendment endpoint
backend/app/routers/amendments.py
Document processing
- PDF extraction
backend/app/services/pdf_service.py - Page-aware chunking
backend/app/services/chunking.py
Retrieval and assurance
- Answer orchestration
backend/app/services/qa_service.py - Hybrid retrieval
backend/app/services/retrieval_service.py - Keyword search
backend/app/services/bm25_service.py - Embeddings
backend/app/services/embedding_service.py - Relevance reranking
backend/app/services/reranker_service.py - Citation verification
backend/app/services/citation_verifier.py - Evidence sufficiency
backend/app/services/evidence_sufficiency.py - Fact comparison
backend/app/services/contradiction_service.py - Amendment resolution
backend/app/services/amendment_service.py
Storage and models
- Document catalogue
backend/app/services/document_store.py - Vector index
backend/app/services/vector_store.py - LLM provider routing
backend/app/services/llm_service.py
Other components
- User
- OpenRouter
- Ollama
Connections 40
- User → App routes: uses
frontend/src/App.jsx - App routes → Document library: routes to
frontend/src/App.jsx - App routes → Ask interface: routes to
frontend/src/App.jsx - App routes → Search interface: routes to
frontend/src/App.jsx - App routes → Conflict view: routes to
frontend/src/App.jsx - App routes → Amendment view: routes to
frontend/src/App.jsx - User → Upload interface: submits PDFs
README.md - Upload interface → API transport: sends requests
- Ask interface → API transport: sends questions
- Search interface → API transport: sends queries
- Conflict view → API transport: requests comparison
- Amendment view → API transport: requests timeline
- API transport → FastAPI app: HTTP requests
frontend/src/api/client.js - FastAPI app → Document endpoints: mounts routes
backend/app/main.py - FastAPI app → Q&A endpoint: mounts routes
backend/app/main.py - FastAPI app → Search endpoint: mounts routes
backend/app/main.py - FastAPI app → Conflict endpoint: mounts routes
backend/app/main.py - FastAPI app → Amendment endpoint: mounts routes
backend/app/main.py - Document endpoints → PDF extraction: extracts PDF
backend/app/routers/documents.py - Document endpoints → Page-aware chunking: chunks pages
backend/app/routers/documents.py - Document endpoints → Document catalogue: writes records
backend/app/routers/documents.py - Document endpoints → Embeddings: embeds passages
backend/app/routers/documents.py - Document endpoints → Vector index: indexes vectors
backend/app/routers/documents.py - Q&A endpoint → Answer orchestration: answers question
backend/app/routers/qa.py - Search endpoint → Hybrid retrieval: searches
backend/app/routers/search.py - Conflict endpoint → Fact comparison: compares facts
backend/app/routers/conflicts.py - Amendment endpoint → Amendment resolution: resolves chain
backend/app/routers/amendments.py - Answer orchestration → Hybrid retrieval: retrieves evidence
backend/app/services/qa_service.py - Answer orchestration → Evidence sufficiency: checks sufficiency
backend/app/services/qa_service.py - Answer orchestration → Citation verification: verifies citations
backend/app/services/qa_service.py - Answer orchestration → LLM provider routing: generates draft
backend/app/services/qa_service.py - Hybrid retrieval → Embeddings: embeds query
backend/app/services/retrieval_service.py - Hybrid retrieval → Vector index: searches vectors
backend/app/services/retrieval_service.py - Hybrid retrieval → Keyword search: gets keyword hits
backend/app/services/retrieval_service.py - Hybrid retrieval → Relevance reranking: reranks candidates
backend/app/services/retrieval_service.py - Hybrid retrieval → Document catalogue: hydrates chunks
backend/app/services/retrieval_service.py - LLM provider routing → OpenRouter: calls primary
README.md - LLM provider routing → Ollama: falls back
backend/app/services/llm_service.py - Fact comparison → Hybrid retrieval: finds candidates
backend/app/services/contradiction_service.py - Amendment resolution → Document catalogue: reads documents
backend/app/routers/amendments.py