How shalinvachheta017/ragbot-core works
Project Type & Purpose
• This is a full-stack, offline Retrieval-Augmented Generation (RAG) system specialized for German public‐tender documents with multilingual support.
• It ingests raw documents (PDF, Excel, DOCX, scanned), cleans and chunks them, persists embeddings in Qdrant, and serves a Streamlit UI for querying via an LLM (Ollama).
Core Components
a. Ingestion & Preprocessing
• scripts/parse_excel.py, core/io.py, core/domain.py
• Cleaning & metadata extraction
• OCR‐ready support for scanned files
b. Chunking & Embeddings
• scripts/embed_chunks_qdrant.py (or direct_embedding_pipeline.py)
• GPU-accelerated embedding models (E5-small, BGE, etc.) via core/search.py
c. Vector Database
• Qdrant vector store managed via docker-compose.yml
• scripts/ensure_qdrant.py for readiness checks
d. Retrieval & Reranking
• Retriever (top-K search) in core/search.py
• Cross-encoder reranker (ms-marco, BGE) in core/qa.py
e. LLM Answer Generation
• core/qa.py uses Ollama backends (Qwen2.5, Llama, Mistral)
• Produces structured, cited, explainable answers
f. Streamlit UI
• ui/app_streamlit.py, ui/tender_bot_ui.py, ui/multilingual_tender_bot.py
• Sidebar controls (model selection, filters, top-K)
Relationships & Data Flow
1. User inputs query in Streamlit UI
2. UI calls Retriever → Qdrant
3. Retrieved embeddings pass to Reranker → order top candidates
4. Top candidates + query go to LLM via Ollama
5. LLM returns structured answer + source citations
6. UI renders the final response
7. (Offline only) Batch pipelines feed data into Qdrant
Architectural Patterns & Principles
• Pipeline design: clear stages (Parse → Chunk → Embed → Store → Retrieve → Rerank → Generate)
• Separation of concerns: “scripts” for batch processes, “core” for domain logic, “ui” for presentation
• Privacy-first: No external API calls; all services run locally
Key Technologies & Frameworks
• Python 3.x, LangChain pipelines
• Qdrant (Docker Compose orchestration)
• Embedding models (Hugging Face E5, BGE)
• Cross-encoders for reranking (ms-marco, BGE)
• Ollama LLM backend
• Streamlit for UI