Short summary
A Retrieval-Augmented Generation (RAG) assistant that answers natural-language questions over a custom document set. Uses Google Gemini for embeddings and generation, FAISS for local vector storage, and provides CLI + Streamlit web interfaces for interaction. Designed for reproducible evaluation in the AAIDC Module 1 submission.
Multi-format document support: PDF, DOCX, TXT, web pages
Local FAISS persistence with safe-loading guidance
CLI and lightweight Streamlit web UI
Demo script and unit test to validate core flow
Minimal, documented dependencies and .env.example for fast setup
Architecture (concise)
DocumentLoader: reads & chunks documents
VectorStore (FAISS): creates and stores embeddings
RAGAssistant: runs retrieval + prompt construction + Gemini LLM call
CLI / Streamlit: user-facing interfaces
Quick setup (tested)
```bash# create virtualenv and install depspython -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
# copy example env and add keycopy .env.example .env
# set in .env: GOOGLE_API_KEY=<YOUR_KEY>, API_PROVIDER=gemini# quick Gemini testpython demo_gemini.py
# build vector store from local docspython -m src.cli setup --directory ./data/documents --store-type faiss
# start CLI chatpython -m src.cli chat --interactive
# or run the web UIstreamlit run src/streamlit_app.py
```
Example usage (CLI)
```bashpython -m src.cli ask "What are the main benefits of RAG?"```
Sample output (illustrative)
Answer: "RAG improves factuality by grounding answers in retrieved documents, enables domain-specific responses, and supports source attribution."
Sources: list of document file names + chunk metadata shown in result
Security & safety notes
FAISS deserialization: loading pickled indices requires explicit acknowledgement. Only set allow_dangerous_deserialization=True when loading indexes created locally and trusted.
API keys: keep secrets in .env (not committed). .env.example is provided for templates only.
Code quality: Modular design, minimal dependencies, unit test provided. β
Security & Privacy: Guidance for FAISS deserialization and no secrets in repo. β
This implementation meets the βEssentialβ level and satisfies >70% of the repository & publication evaluation criteria required for the AAIDC Module 1 submission.
Publication (Ready Tensor): paste this content as the project publication, attach the GitHub repo link, and include a short demo video or screenshots if available.
Limitations and next steps
Context length: large document sets may require re-ranking or hierarchical retrieval