How aryan-018008/documind-ai works
DocuMind AI is a Flask application for authenticated, PDF-grounded question answering. The principal workflow uploads a PDF, extracts page text, chunks it, builds a semantic/lexical search index, and sends retrieved context to Groq for an answer with source references. Authentication and email OTP verification are a separate product branch. The graph follows the sampled route/service calls and README capabilities; the frontend and some integrations are documented but not sampled in source.
Main entry points: chat_routes.py Chat API · documents_routes.py Document upload and listing · app.py Flask entry and dashboard · templates Web interface
Components 16
Web application
- Flask entry and dashboard
app.py - Web interface
templates
Identity and accounts
- Authentication routes
routes/auth_routes.py - Login guard
routes/auth_helpers.py - SQLite account and document data
database/db.py - Resend email service
Document processing
- Document upload and listing
routes/documents_routes.py - Uploaded PDF files
uploads - PDF text extraction
services/pdf_service.py
Question answering
- Chat API
routes/chat_routes.py - Page text chunking
services/chunking_service.py - Hybrid vector search
services/vector_store_service.py - Text embeddings
services/embedding_service.py - Grounded answer generation
services/rag_service.py
Other components
- User
- Groq language model
Connections 24
- User → Web interface: uses
README.md - Web interface → Flask entry and dashboard: views
README.md - Flask entry and dashboard → Authentication routes: registers routes
app.py - Flask entry and dashboard → Document upload and listing: registers routes
app.py - Flask entry and dashboard → Chat API: registers routes
app.py - Flask entry and dashboard → SQLite account and document data: initializes and queries
app.py - Authentication routes → SQLite account and document data: reads and writes
routes/auth_routes.py - Authentication routes → Resend email service: sends verification email
routes/auth_routes.py - Document upload and listing → Login guard: guards access
routes/documents_routes.py - Chat API → Login guard: guards access
routes/chat_routes.py - Document upload and listing → Uploaded PDF files: saves PDF
routes/documents_routes.py - Document upload and listing → PDF text extraction: extracts text
routes/documents_routes.py - Document upload and listing → SQLite account and document data: stores metadata
routes/documents_routes.py - Chat API → SQLite account and document data: checks ownership
routes/chat_routes.py - Chat API → Uploaded PDF files: reads selected PDF
routes/chat_routes.py - Chat API → PDF text extraction: extracts pages
routes/chat_routes.py - Chat API → Page text chunking: chunks pages
routes/chat_routes.py - Chat API → Hybrid vector search: builds index
routes/chat_routes.py - Hybrid vector search → Text embeddings: generates vectors
services/vector_store_service.py - Chat API → Grounded answer generation: requests answer
routes/chat_routes.py - Grounded answer generation → Hybrid vector search: retrieves passages
services/rag_service.py - Grounded answer generation → Groq language model: generates response
services/rag_service.py - Chat API → Web interface: returns answer and sources
README.md - Document upload and listing → Web interface: returns upload results
README.md