How ayush-r-018/docu-converse-api works
DocuConverse is a FastAPI API for document-grounded chat and interview booking. Upload requests are validated, extracted, chunked, embedded locally, and stored as Qdrant vectors with SQLite metadata. Chat requests load Redis session state, use Gemini to classify booking intent, then either gather and validate booking details for SQLite or retrieve document context and generate a grounded answer; chat history is saved back to Redis. The README documents these major flows; source excerpts show the main orchestration and backend calls, while some upload and booking internals are supported by the source index rather than inspected excerpts.
Main entry points: document_service.py Document processing · chat_service.py Chat orchestration · rag_service.py Grounded answers · main.py FastAPI app
Components 24
API and configuration
- FastAPI app
app/main.py - Upload endpoint
app/api/routes/documents.py - Chat endpoint
app/api/routes/chat.py - Settings
app/core/config.py
Document ingestion
- Document processing
app/services/document_service.py - PDF and text extraction
app/utils/pdf_extractor.py - Text chunking
app/utils/chunking.py - Local embeddings
app/services/embedding_service.py - Embedding model
Chat and booking
- Chat orchestration
app/services/chat_service.py - Booking intent extraction
app/services/gemini_service.py - Booking validation
app/services/booking_service.py - Booking schemas
app/schemas/booking.py - Grounded answers
app/services/rag_service.py - Gemini API
Storage and models
- Vector access
app/database/qdrant.py - Qdrant
- Session store access
app/database/redis.py - Redis
- SQL database access
app/database/sql.py - Document record
app/models/document.py - Booking record
app/models/booking.py - SQLite
Other components
- API client
Connections 29
- API client → FastAPI app: sends requests
README.md - FastAPI app → Upload endpoint: routes uploads
app/main.py - FastAPI app → Chat endpoint: routes chat
app/main.py - Upload endpoint → Settings: reads limits
app/api/routes/documents.py - Upload endpoint → Document processing: processes upload
app/api/routes/documents.py - Document processing → PDF and text extraction: extracts text
app/services/document_service.py - Document processing → Text chunking: chunks text
app/services/document_service.py - Document processing → Local embeddings: creates vectors
app/services/document_service.py - Document processing → Vector access: stores chunks
app/services/document_service.py - Document processing → Document record: records metadata
app/services/document_service.py - Local embeddings → Embedding model: encodes text
app/services/embedding_service.py - Chat endpoint → Chat orchestration: dispatches chat
app/api/routes/chat.py - Chat orchestration → Session store access: reads and saves state
app/services/chat_service.py - Chat orchestration → Booking intent extraction: detects booking
app/services/chat_service.py - Chat orchestration → Booking validation: validates and commits
app/services/chat_service.py - Chat orchestration → Grounded answers: requests answer
app/services/chat_service.py - Booking intent extraction → Booking schemas: validates extraction
app/services/gemini_service.py - Booking intent extraction → Gemini API: requests extraction
app/services/gemini_service.py - Booking validation → Booking schemas: validates details
app/services/booking_service.py - Booking validation → Booking record: persists booking
app/services/booking_service.py - Grounded answers → Settings: reads retrieval limit
app/services/rag_service.py - Grounded answers → Local embeddings: embeds question
app/services/rag_service.py - Grounded answers → Vector access: searches chunks
app/services/rag_service.py - Grounded answers → Gemini API: generates answer
app/services/rag_service.py - Vector access → Qdrant: stores and searches
app/database/qdrant.py - Session store access → Redis: stores session state
app/database/redis.py - SQL database access → SQLite: connects and queries
app/database/sql.py - Document record → SQL database access: registers table
app/models/document.py - Booking record → SQL database access: registers table
app/models/booking.py