How kishorebala896/docuchat works
DocuChat lets a user upload a PDF, then chat with it using answers grounded in document passages and page citations. The API accepts uploads and starts ingestion; ingestion extracts and chunks text, embeds it, indexes it, and creates a summary. For questions, the API coordinates hybrid retrieval, an abstention decision, and LLM answer generation, while persisting conversation history. The UI, optional Celery/Redis ingestion, provider choices, and document inspection are additional product capabilities. Relationships for unsampled endpoint details follow README documentation; uncertain internal calls are omitted.
Main entry points: main.py FastAPI · pipeline.py Ingestion pipeline · retrieval.py Hybrid retrieval · llm.py LLM answers and summaries
Components 18
User experience
- Streamlit UI
frontend/app.py
API and orchestration
- FastAPI
backend/main.py - API schemas
backend/schemas.py - Configuration
backend/config.py - Debug stops
backend/debug.py
Document ingestion
- Ingestion pipeline
backend/pipeline.py - Celery worker
backend/worker.py - Embedding providers
backend/embeddings.py
Grounded Q&A and storage
- Vector index
backend/vectorstore.py - Hybrid retrieval
backend/retrieval.py - LLM answers and summaries
backend/llm.py - Relational data
backend/models.py - Database access
backend/database.py
Other components
- User
- Redis broker
- PDF document
- LLM provider
- Hosted embedding provider
Connections 23
- User → Streamlit UI: uses
README.md - Streamlit UI → FastAPI: calls API
README.md - User → PDF document: uploads
README.md - FastAPI → Ingestion pipeline: starts ingestion
README.md - Ingestion pipeline → PDF document: parses and chunks
README.md - Ingestion pipeline → Embedding providers: embeds chunks
README.md - Ingestion pipeline → Vector index: indexes chunks
backend/pipeline.py - Ingestion pipeline → LLM answers and summaries: creates summary
README.md - FastAPI → Celery worker: dispatches optionally
backend/main.py - FastAPI → Relational data: stores document and chat state
README.md - Database access → Relational data: maps SQL tables
backend/models.py - Celery worker → Redis broker: uses broker
backend/worker.py - FastAPI → Hybrid retrieval: retrieves for questions
README.md - Hybrid retrieval → Embedding providers: embeds query
README.md - Hybrid retrieval → Vector index: searches dense index
README.md - Hybrid retrieval → LLM answers and summaries: supplies passages
README.md - FastAPI → LLM answers and summaries: requests grounded answer
README.md - LLM answers and summaries → LLM provider: calls configured provider
README.md - Embedding providers → Hosted embedding provider: calls when configured
README.md - FastAPI → API schemas: validates API shapes
README.md - FastAPI → Configuration: reads settings
backend/main.py - Ingestion pipeline → Configuration: reads settings
backend/pipeline.py - Streamlit UI → Debug stops: supports named stop
backend/debug.py