How nivith1029/chatbot works
This repository provides a local PDF RAG assistant through the documented rag_service.py API, with PDF ingestion, semantic retrieval, and cited answers backed by Ollama and FAISS. The sampled main.py also implements a chat-with-history API and a richer RAG variant; its chat branch is shown separately. Edges reflect README statements and visible calls; unsampled implementation details are not inferred.
Main entry points: rag_service.py RAG endpoints · main.py Chat and history endpoints
Components 11
PDF RAG
- RAG endpoints
rag_service.py - PDF extraction and chunking
rag_service.py - Search and answer assembly
rag_service.py
Chat API
- Chat and history endpoints
main.py
Local storage
- FAISS index
rag_service.py - Chunk metadata
rag_service.py - Conversation database
main.py
Model services
- Embedding requests
rag_service.py - Chat model requests
main.py
Other components
- API client
- Ollama
Connections 12
- API client → RAG endpoints: uploads or queries
README.md - RAG endpoints → PDF extraction and chunking: extracts and chunks
rag_service.py - RAG endpoints → Embedding requests: requests embeddings
rag_service.py - Embedding requests → Ollama: sends text
rag_service.py - RAG endpoints → FAISS index: reads and writes index
rag_service.py - RAG endpoints → Chunk metadata: loads and saves metadata
rag_service.py - RAG endpoints → Search and answer assembly: searches and assembles context
rag_service.py - Search and answer assembly → Ollama: requests answer
rag_service.py - API client → Chat and history endpoints: starts and chats
main.py - Chat and history endpoints → Conversation database: reads and saves messages
main.py - Chat and history endpoints → Chat model requests: requests reply
main.py - Chat model requests → Ollama: sends messages
main.py