How vishnukoushikkumara/dochelper works
DocuMentor lets users upload PDFs, processes them into searchable document chunks, and streams answers with source references and agent traces. The frontend combines upload, document-library polling, and chat; the backend exposes those workflows through HTTP routes backed by MongoDB, embeddings, and an LLM. The upload implementation shows parsing, chunking, embedding, persistence, and summarization. The chat agent’s internal steps are not excerpted, so its links to retrieval dependencies are shown as unverified rather than asserted.
Main entry points: routes_upload.py Upload route · deps.py Service dependencies · api.js API client · Chat.jsx Chat
Components 22
User interface
- App shell
frontend/src/App.jsx - PDF upload
frontend/src/components/Upload.jsx - Document library
frontend/src/components/Library.jsx - Chat
frontend/src/components/Chat.jsx - Sources and steps
frontend/src/components/Sources.jsx - Agent steps view
frontend/src/components/AgentSteps.jsx
HTTP workflows
- API client
frontend/src/api.js - Upload route
backend/app/routes_upload.py - Documents route
backend/app/routes_documents.py - Chat route
backend/app/routes_chat.py - API schemas
backend/app/schemas.py
Document ingestion
- PDF parser
backend/app/pdf_parser.py - Text chunker
backend/app/chunker.py
AI and storage
- Chat agent graph
backend/app/agent_graph.py - Embedding model
backend/app/embeddings.py - LLM client
backend/app/llm_client.py - MongoDB store
backend/app/mongo_client.py - Service dependencies
backend/app/deps.py - Configuration
backend/app/config.py
Other components
- User
- Groq API
- MongoDB
Connections 33
- User → PDF upload: selects PDF
frontend/src/components/Upload.jsx - User → Chat: asks question
frontend/src/components/Chat.jsx - App shell → PDF upload: renders
frontend/src/App.jsx - App shell → Document library: renders
frontend/src/App.jsx - App shell → Chat: renders
frontend/src/App.jsx - App shell → API client: lists documents
frontend/src/App.jsx - PDF upload → API client: uploads PDF
frontend/src/components/Upload.jsx - Chat → API client: streams chat
frontend/src/components/Chat.jsx - Chat → Sources and steps: renders sources
frontend/src/components/Chat.jsx - Chat → Agent steps view: renders trace
frontend/src/components/Chat.jsx - API client → Upload route: POST /upload
frontend/src/api.js - API client → Documents route: GET /documents
frontend/src/api.js - API client → Chat route: POST /chat
frontend/src/api.js - Upload route → PDF parser: parses PDF
backend/app/routes_upload.py - Upload route → Text chunker: chunks text
backend/app/routes_upload.py - Upload route → Embedding model: encodes chunks
backend/app/routes_upload.py - Upload route → MongoDB store: persists document
backend/app/routes_upload.py - Upload route → LLM client: summarizes text
backend/app/routes_upload.py - Upload route → Service dependencies: resolves services
backend/app/routes_upload.py - Documents route → MongoDB store: lists documents
backend/app/routes_documents.py - Documents route → Service dependencies: resolves store
backend/app/routes_documents.py - Chat route → Chat agent graph: runs graph
backend/app/routes_chat.py - Chat route → Service dependencies: resolves services
backend/app/routes_chat.py - Chat route → API schemas: accepts request
backend/app/routes_chat.py - Chat agent graph → Embedding model: uses embeddings
backend/app/agent_graph.py - Chat agent graph → MongoDB store: searches chunks
backend/app/agent_graph.py - Chat agent graph → LLM client: generates answer
backend/app/agent_graph.py - Service dependencies → MongoDB store: creates store
backend/app/deps.py - Service dependencies → Embedding model: gets embedder
backend/app/deps.py - Service dependencies → LLM client: creates client
backend/app/deps.py - MongoDB store → MongoDB: reads and writes
backend/app/mongo_client.py - LLM client → Groq API: requests completions
backend/app/llm_client.py - Service dependencies → Configuration: reads settings
backend/app/deps.py