RAG chatbot that answers questions on Mindful Substack articles, grounded in the actual article text instead of the model's own knowledge.
$ git clone git@github.com:JansenMok/Llamaindex-RAG-Mindful.git$ pip install llama-index llama-index-llms-google-genai llama-index-embeddings-google-genai streamlit- Set
GOOGLE_API_KEYenv var - Add article
.txtfiles toarticles/ $ streamlit run main.py
- Chunking: articles loaded via
SimpleDirectoryReader, split into ~500-token chunks - Embedding: chunks embedded using Google's
text-embedding-004 - Retrieval: vector store index (
GPTVectorStoreIndex), default top-k similarity search per query - Generation: retrieved chunks + question passed to
gemini-2.0-flashfor a grounded answer
gemini-2.0-flash for generation and text-embedding-004 for embeddings, both via the google-genai SDK, chosen for fast inference and a generous free tier that lets you iterate on retrieval quality without API cost getting in the way.
Streamlit web app: type a question, get a grounded answer pulled from the Mindful Articles corpus.
Query: "what does the author say about morning routines?" Retrieved: top relevant chunks from that article Response: grounded answer citing the article directly