How devartslab/documind works
DocuMind is a document-ingestion and RAG question-answering application. Users upload PDF or text files, which the backend parses, chunks, embeds, and indexes; questions are embedded to retrieve relevant chunks, then answered with an LLM and cited sources. The React UI also supports document status/list management and conversation history. The graph reflects sampled service and controller calls plus README-documented capabilities; LangChain wiring and deployment resources are represented only where the tree or documentation supports them.
Main entry points: documind-stack.ts AWS stack · api.ts API client · App.tsx App workflow · QaService.java RAG answering
Components 24
Web interface
- App workflow
frontend/src/App.tsx - Document upload
frontend/src/components/DocumentUpload.tsx - Document list
frontend/src/components/DocumentList.tsx - Chat interface
frontend/src/components/ChatInterface.tsx - API client
frontend/src/api.ts
Application services
- Document API
backend/src/main/java/com/documind/controller/DocumentController.java - Q&A API
backend/src/main/java/com/documind/controller/QaController.java - Document processing
backend/src/main/java/com/documind/service/DocumentService.java - RAG answering
backend/src/main/java/com/documind/service/QaService.java
Persistence and AI
- Document repository
backend/src/main/java/com/documind/repository/DocumentRepository.java - Chat repository
backend/src/main/java/com/documind/repository/ChatMessageRepository.java - PostgreSQL
- Embedding index
backend/src/main/java/com/documind/config/LangChainConfig.java - Embedding model
backend/src/main/java/com/documind/config/LangChainConfig.java - Chat model
backend/src/main/java/com/documind/config/LangChainConfig.java
AWS deployment
- AWS stack
infra/lib/documind-stack.ts - CloudFront
- Frontend bucket
- Backend service
- RDS PostgreSQL
- Documents bucket
- Secrets Manager
Other components
- User
- OpenAI
Connections 31
- User → App workflow: uses
- App workflow → Document upload: renders
- App workflow → Document list: renders
- App workflow → Chat interface: renders
- App workflow → API client: refreshes status
- Document upload → API client: uploads file
- Document list → API client: manages documents
- Chat interface → API client: asks questions
- API client → Document API: HTTP requests
- API client → Q&A API: HTTP requests
- Document API → Document processing: calls
- Q&A API → RAG answering: calls
- Document processing → Document repository: saves and loads
- Document processing → Embedding model: embeds chunks
- Document processing → Embedding index: indexes chunks
- RAG answering → Embedding model: embeds question
- RAG answering → Embedding index: searches chunks
- RAG answering → Chat model: generates answer
- RAG answering → Chat repository: reads and saves history
- Document repository → PostgreSQL: persists metadata
- Chat repository → PostgreSQL: persists messages
- Chat model → OpenAI: calls model
- AWS stack → CloudFront: provisions
- AWS stack → Frontend bucket: provisions
- AWS stack → Backend service: provisions
- AWS stack → RDS PostgreSQL: provisions
- AWS stack → Documents bucket: provisions
- AWS stack → Secrets Manager: provisions
- CloudFront → Frontend bucket: serves assets
- CloudFront → Backend service: routes API
- Backend service → RDS PostgreSQL: connects