How onlyshreeya/docmind works
DocMind lets users organize documents by domain, upload them, and ask cited questions grounded in those documents. The frontend calls a Node API for folders, documents, and chats; the API stores metadata and chat history and proxies ML work. The FastAPI service parses and domain-chunks uploads, embeds them into vector storage, then retrieves passages for answer generation. An optional advanced query path adds conversational memory, graph expansion, budget selection, and conflict checks. The README describes the service and external-store architecture; some backend route details and external wiring are documented rather than shown in excerpts.
Main entry points: pipeline.py Advanced RAG pipeline · ingest.py Upload ingestion · server.js Express API · App.jsx App state
Components 29
User interface
- App state
frontend/src/App.jsx - Folder and document UI
frontend/src/components/Sidebar.jsx - Chat and citations
frontend/src/components/ChatWindow.jsx
Metadata API
- Express API
backend/src/server.js - Folder management
backend/src/routes/folders.js - Document management
backend/src/routes/documents.js - Chat and ML proxy
backend/src/routes/chat.js - Folder metadata
backend/src/models/Folder.js - Document metadata
backend/src/models/Document.js - Chat history
backend/src/models/ChatSession.js
RAG service
- FastAPI service
ml-service/main.py - Upload ingestion
ml-service/app/routers/ingest.py - Document parsing
ml-service/app/parsing.py - Domain chunking
ml-service/app/chunking.py - Domain profiles
ml-service/app/domains.py - Text embeddings
ml-service/app/embeddings.py - Vector storage
ml-service/app/vectorstore.py - Query endpoints
ml-service/app/routers/query.py - Passage retrieval
ml-service/app/retrieval.py - Answer generation
ml-service/app/generation.py - Advanced RAG pipeline
ml-service/app/modules/pipeline.py - Conversational memory
ml-service/app/modules/csm.py - Entity graph expansion
ml-service/app/modules/eacg.py - Context budget selection
ml-service/app/modules/cba.py - Conflict detection
ml-service/app/modules/cdcr.py
Other components
- DocMind user
- MongoDB
- ChromaDB
- Gemini API
Connections 36
- DocMind user → App state: uses
frontend/src/App.jsx - App state → Folder and document UI: renders
frontend/src/App.jsx - App state → Chat and citations: renders
frontend/src/App.jsx - App state → Express API: requests API
frontend/src/App.jsx - Express API → Folder management: mounts routes
backend/src/server.js - Express API → Document management: mounts routes
backend/src/server.js - Express API → Chat and ML proxy: mounts routes
backend/src/server.js - Folder management → Folder metadata: reads and writes
backend/src/routes/folders.js - Folder management → Document metadata: manages related docs
backend/src/routes/folders.js - Folder management → Chat history: manages related chats
backend/src/routes/folders.js - Document management → Document metadata: reads and writes
backend/src/routes/documents.js - Chat and ML proxy → Chat history: reads and writes
backend/src/routes/chat.js - Express API → MongoDB: connects
README.md - Chat and ML proxy → FastAPI service: proxies ML requests
README.md - FastAPI service → Upload ingestion: registers router
ml-service/main.py - FastAPI service → Query endpoints: registers router
ml-service/main.py - Upload ingestion → Document parsing: extracts text
ml-service/app/routers/ingest.py - Upload ingestion → Domain chunking: chunks text
ml-service/app/routers/ingest.py - Upload ingestion → Domain profiles: gets profile
ml-service/app/routers/ingest.py - Domain chunking → Domain profiles: uses settings
ml-service/app/chunking.py - Upload ingestion → Text embeddings: embeds chunks
ml-service/app/routers/ingest.py - Upload ingestion → Vector storage: upserts chunks
ml-service/app/routers/ingest.py - Query endpoints → Passage retrieval: retrieves passages
ml-service/app/routers/query.py - Query endpoints → Answer generation: generates answer
ml-service/app/routers/query.py - Query endpoints → Advanced RAG pipeline: dispatches advanced query
ml-service/app/routers/query.py - Passage retrieval → Text embeddings: embeds query
ml-service/app/retrieval.py - Passage retrieval → Vector storage: searches vectors
ml-service/app/retrieval.py - Answer generation → Domain profiles: uses domain prompts
ml-service/app/generation.py - Advanced RAG pipeline → Conversational memory: reformulates query
ml-service/app/modules/pipeline.py - Advanced RAG pipeline → Passage retrieval: retrieves seeds
ml-service/app/modules/pipeline.py - Advanced RAG pipeline → Entity graph expansion: expands passages
ml-service/app/modules/pipeline.py - Advanced RAG pipeline → Context budget selection: selects passages
ml-service/app/modules/pipeline.py - Advanced RAG pipeline → Conflict detection: checks conflicts
ml-service/app/modules/pipeline.py - Advanced RAG pipeline → Answer generation: generates answer
ml-service/app/modules/pipeline.py - Vector storage → ChromaDB: stores vectors
README.md - Answer generation → Gemini API: uses generation API
README.md