How newblathe/docmind works
DocMind is a document-analysis web application. Users upload supported files, select documents and ask a question; the pipeline indexes new documents, retrieves relevant passages, produces cited per-document answers, then identifies themes. Users can also list and delete uploaded documents. The graph includes the documented UI capabilities and the sampled backend calls; detailed UI request wiring and some deployment integrations are not shown in the excerpts.
Main entry points: pipeline_routes.py Pipeline API · document_routes.py Document API · meta_store.py Metadata and Search · query_engine.py Answer and Citation
Components 16
Client and API
- Web UI
demo - FastAPI App
backend/app/main.py - Document API
backend/app/api/routes/document_routes.py - Pipeline API
backend/app/api/routes/pipeline_routes.py - API Models
backend/app/models/models.py
Document Ingestion
- Uploaded Files
- Preprocessor
backend/app/services/document_preprocessor.py
Document Analysis
- Metadata and Search
backend/app/services/meta_store.py - Answer and Citation
backend/app/services/query_engine.py - Theme Identifier
backend/app/services/theme_identifier.py
Platform and State
- MongoDB Metadata
- Configuration
backend/app/core/config.py - Rate Limiter
backend/app/core/limiter.py - Logger
backend/app/core/logger.py
Other components
- User
- Groq LLM
Connections 34
- User → Web UI: uses
README.MD - FastAPI App → Web UI: serves
backend/app/main.py - Web UI → Document API: uploads, lists, deletes
README.MD - Web UI → Pipeline API: submits questions
README.MD - FastAPI App → Document API: registers router
backend/app/main.py - FastAPI App → Pipeline API: registers router
backend/app/main.py - Document API → Uploaded Files: writes, lists, deletes
backend/app/api/routes/document_routes.py - Document API → Metadata and Search: removes document metadata
backend/app/api/routes/document_routes.py - Pipeline API → Uploaded Files: reads selected files
backend/app/api/routes/pipeline_routes.py - Pipeline API → Metadata and Search: checks indexed documents
backend/app/api/routes/pipeline_routes.py - Pipeline API → Preprocessor: preprocesses new files
backend/app/api/routes/pipeline_routes.py - Preprocessor → Metadata and Search: replaces chunks and embeddings
backend/app/services/document_preprocessor.py - Pipeline API → Answer and Citation: requests answers
backend/app/api/routes/pipeline_routes.py - Answer and Citation → Metadata and Search: searches document chunks
backend/app/services/query_engine.py - Metadata and Search → MongoDB Metadata: stores and reads metadata
backend/app/services/meta_store.py - Answer and Citation → Groq LLM: generates cited answers
backend/app/services/query_engine.py - Pipeline API → Theme Identifier: requests themes
backend/app/api/routes/pipeline_routes.py - Theme Identifier → Groq LLM: identifies themes
backend/app/services/theme_identifier.py - Pipeline API → API Models: validates and returns
backend/app/api/routes/pipeline_routes.py - Document API → API Models: returns responses
backend/app/api/routes/document_routes.py - Document API → Rate Limiter: uses limits
backend/app/api/routes/document_routes.py - Pipeline API → Rate Limiter: uses limits
backend/app/api/routes/pipeline_routes.py - FastAPI App → Rate Limiter: configures middleware
backend/app/main.py - Document API → Configuration: reads upload path
backend/app/api/routes/document_routes.py - Pipeline API → Configuration: reads upload path
backend/app/api/routes/pipeline_routes.py - Metadata and Search → Configuration: reads database URL
backend/app/services/meta_store.py - Answer and Citation → Configuration: reads API key
backend/app/services/query_engine.py - Theme Identifier → Configuration: reads API key
backend/app/services/theme_identifier.py - Document API → Logger: logs operations
backend/app/api/routes/document_routes.py - Pipeline API → Logger: logs pipeline
backend/app/api/routes/pipeline_routes.py - Preprocessor → Logger: logs processing
backend/app/services/document_preprocessor.py - Answer and Citation → Logger: logs extraction
backend/app/services/query_engine.py - Theme Identifier → Logger: logs theme extraction
backend/app/services/theme_identifier.py - Web UI → User: shows results
README.MD