How mouad-melloul/rag_chatbot works
A local PDF question-answering application: users upload PDFs through a browser, the API processes and indexes their text, and questions are answered using retrieved context and Ollama. The graph emphasizes the active route-to-RAG path. The separate vector-store and LLM manager modules are included as code components, but the excerpts do not show them being called by that path.
Main entry points: config.py Runtime settings · routes.py API routes · pipeline.py RAG pipeline · main.py FastAPI app
Components 11
Browser interface
- Chat interface
FRONTEND/js/app.js
API and uploads
- FastAPI app
BACKEND/app/main.py - API routes
BACKEND/app/api/routes.py - PDF uploads
BACKEND/app/config.py
Document RAG
- RAG pipeline
BACKEND/app/rag/pipeline.py - PDF extraction
BACKEND/app/rag/document_processor.py - Vector store manager
BACKEND/app/rag/vector_store.py - LLM manager
BACKEND/app/rag/llm.py
Runtime integrations
- Runtime settings
BACKEND/app/config.py - Ollama service
Other components
- User
Connections 15
- User → Chat interface: asks and uploads
README.md - Chat interface → API routes: calls API
FRONTEND/js/app.js - FastAPI app → API routes: registers routes
BACKEND/app/main.py - API routes → PDF uploads: writes PDFs
BACKEND/app/api/routes.py - API routes → RAG pipeline: uploads, asks, clears
BACKEND/app/api/routes.py - RAG pipeline → PDF extraction: extracts and splits
BACKEND/app/rag/pipeline.py - RAG pipeline → Ollama service: embeds and generates
BACKEND/app/rag/pipeline.py - API routes → Runtime settings: reads upload settings
BACKEND/app/api/routes.py - FastAPI app → Runtime settings: reads upload path
BACKEND/app/main.py - PDF extraction → Runtime settings: reads chunk settings
BACKEND/app/rag/document_processor.py - RAG pipeline → Runtime settings: reads RAG settings
BACKEND/app/rag/pipeline.py - Vector store manager → Ollama service: creates embeddings
BACKEND/app/rag/vector_store.py - Vector store manager → Runtime settings: reads retrieval settings
BACKEND/app/rag/vector_store.py - LLM manager → Ollama service: creates model client
BACKEND/app/rag/llm.py - LLM manager → Runtime settings: reads model settings
BACKEND/app/rag/llm.py