How jamwithai/local-rag-system works
Project type and purpose
• This is a full‐stack, privacy‐focused Retrieval‐Augmented Generation (RAG) system.
• It provides both an ingestion pipeline (document OCR, embedding, indexing) and a retrieval/chat pipeline (hybrid search + LLM responses).
• The UI is implemented in Streamlit (welcome.py + pages/ directory), and the backend is pure Python modules under src/.
File structure
• Top level:
• welcome.py – entry point for the Streamlit app
• pages/ – two Streamlit pages (1_🤖_Chatbot.py, 2_📄_Upload_Documents.py)
• src/ – core modules for chat, ingestion, embeddings, OCR, OpenSearch, utilities, plus index_config.json
• embedding_model/ – local model and README for embedding extraction
• uploaded_files/ – persisted documents
• logs/ & app.log – logging
• Configuration files: requirements.txt, pyproject.toml, mypy.ini
• Notebooks/ for tutorials (not part of runtime architecture)
Extract insights from README
• Uses OpenSearch for hybrid (keyword + semantic) search.
• Uses Sentence Transformers for embeddings.
• Uses a local LLM for generation (in src/chat.py).
• Streamlit provides the UI layer.
Final advice
• Be as detailed as possible, capturing every src/*.py as a discrete element if helpful.
• Don’t overcomplicate: two main pipelines + supporting data/model stores.
• This clarity will make onboarding and future enhancements (e.g., swapping OpenSearch for another store) straightforward.