A RAG chatbot that answers questions about any document using Google's Generative AI and ChromaDB.
Python 3.10+
-
Install dependencies
pip install -r requirements.txt
-
Configure API key
cp .env.example .env
Edit
.envand add your Google API key. -
Create the database (first time only)
python embed.py
python query.pySupported formats: .txt, .md, .pdf, .docx
python embed.py --text-file my_book.pdf --db-path my_db
python query.py --db-path my_dbOr edit config.py for permanent changes. See CUSTOMIZATION.md for details.
embed.py - Creates embeddings from text
query.py - Interactive Q&A chatbot
config.py - All settings
verify_db.py - Database verification
rag_db/ - Vector database (generated)
embed.pysplits text into chunks, embeds them with Google's API, stores in ChromaDBquery.pyembeds your question, finds similar chunks, generates an answer with Gemini