How vigneshssuvarna/ai-pdf-chatbox works
This repository implements an AI PDF chatbot: users sign in, upload or select documents, ask questions, and receive streamed answers grounded in retrieved document context. The backend also supports document ingestion and web scraping, with separate preprocessing, enrichment, filtering, and indexing modules. The excerpts show API-to-memory, retrieval, and vector-store behavior; several preprocessing modules are indexed but not sampled, so their internal ordering and connections are left unasserted.
Main entry points: api_framework.py Chat API · app.py Chat UI · sign_in.py Sign-in Page · llm.py LLM Providers
Components 19
User Interface
- Chat UI
frontend/app.py - Sign-in Page
frontend/pages/sign_in.py
Chat Backend
- Chat API
api_framework.py - Conversation Memory
memory.py - Prompt Builder
prompting.py - LLM Providers
llm.py
Knowledge Preparation
- Document Ingestion
ingest.py - Document Cleaning
data_cleaner.py - Text Chunking
data_chunker.py - Advanced Chunking
advanced_chunker.py - NER Enrichment
enrich_ner.py - Document Audit
audit.py - Metadata Filtering
meta_filter.py
Retrieval and Indexing
- Embedding Generation
generate_embeddings.py - Semantic Retriever
retriever.py - Vector Store
vector_store.py
Authentication
- Account Store
frontend/auth_db.py
Other components
- Chat User
- LLM Services
Connections 14
- Chat User → Chat UI: asks questions
frontend/app.py - Chat UI → Chat API: sends chat
frontend/app.py - Chat User → Sign-in Page: signs in
frontend/pages/sign_in.py - Sign-in Page → Account Store: checks credentials
frontend/pages/sign_in.py - Chat API → Conversation Memory: loads history
api_framework.py - Chat API → Semantic Retriever: retrieves context
api_framework.py - Chat API → Prompt Builder: builds prompt
api_framework.py - Chat API → LLM Providers: streams answer
api_framework.py - LLM Providers → LLM Services: requests completion
llm.py - Chat API → Document Ingestion: ingests uploads
api_framework.py - Chat API → Document Cleaning
api_framework.py - Chat API → Text Chunking
api_framework.py - Chat API → Vector Store: adds chunks
api_framework.py - Semantic Retriever → Vector Store: searches chunks
retriever.py