How paramesh137/docmind-main works
DocuMind is a document-grounded question-answering service with two principal workflows: ingest PDFs into a searchable vector index, then answer user questions with retrieved passages and source metadata. The graph separates ingestion, API handling, retrieval/generation, and external services. Relationships are based on the README or shown source; the raw PDF is an example input, and unsampled deployment wiring is omitted.
Main entry points: retrieval.py Answer orchestration · main.py FastAPI endpoints · ingestion.py Embedding and upsert · config.py Runtime settings
Components 15
Question API
- FastAPI endpoints
app/main.py - Runtime settings
app/config.py
Document Ingestion
- Ingestion entrypoint
run_ingestion.py - Raw PDFs
data/raw_docs/refund_policy.pdf - PDF loading
app/ingestion.py - Text chunking
app/ingestion.py - Embedding and upsert
app/ingestion.py
Answer Retrieval
- Answer orchestration
app/retrieval.py - Vector store setup
app/retrieval.py - Passage retrieval
app/retrieval.py - Grounded prompt
app/retrieval.py - Answer generation
app/retrieval.py
External Services
- Pinecone index
- OpenAI APIs
Other components
- Questioner
Connections 19
- Questioner → FastAPI endpoints: asks question
app/main.py - FastAPI endpoints → Runtime settings: checks configuration
app/main.py - FastAPI endpoints → Answer orchestration: calls answerer
app/main.py - Answer orchestration → FastAPI endpoints: returns answer and sources
app/main.py - Ingestion entrypoint → PDF loading: starts ingestion
run_ingestion.py - Raw PDFs → PDF loading: loads PDFs
README.md - PDF loading → Text chunking: splits documents
app/ingestion.py - Text chunking → Embedding and upsert: passes chunks
app/ingestion.py - Embedding and upsert → OpenAI APIs: embeds chunks
app/ingestion.py - Embedding and upsert → Pinecone index: upserts vectors
app/ingestion.py - Answer orchestration → Runtime settings: checks credentials
app/retrieval.py - Answer orchestration → Vector store setup: builds chain
app/retrieval.py - Vector store setup → OpenAI APIs: creates embeddings
app/retrieval.py - Vector store setup → Pinecone index: opens index
app/retrieval.py - Answer orchestration → Passage retrieval: fetches source docs
app/retrieval.py - Passage retrieval → Pinecone index: searches vectors
app/retrieval.py - Answer orchestration → Grounded prompt: formats context
app/retrieval.py - Grounded prompt → Answer generation: supplies question and context
app/retrieval.py - Answer generation → OpenAI APIs: generates answer
app/retrieval.py