How karthiksshow/rag works
This is a compact RAG demonstration: it loads text, splits it into chunks, embeds and indexes them, retrieves relevant context for a question, then asks a local text-generation pipeline to produce an answer. The script explicitly names data/About_Ai.txt, but the tree contains About AI.txt; the excerpts do not establish that the listed file is the one loaded. All runtime stages are implemented in the single script, so their paths are shared.
Main entry points: RAG_BasicDemo.py RAG chain · About AI.txt Text source
Components 10
Corpus preparation
- Text source
About AI.txt - Text loader
RAG_BasicDemo.py - Chunk splitter
RAG_BasicDemo.py - Embedding model
RAG_BasicDemo.py
Retrieval and answering
- FAISS index
RAG_BasicDemo.py - Retriever
RAG_BasicDemo.py - RAG chain
RAG_BasicDemo.py - Text generator
RAG_BasicDemo.py - Answer
RAG_BasicDemo.py
Other components
- Questioner
Connections 9
- Text loader → Chunk splitter: splits documents
RAG_BasicDemo.py - Chunk splitter → FAISS index: indexes chunks
RAG_BasicDemo.py - Embedding model → FAISS index: embeds chunks
RAG_BasicDemo.py - RAG chain → Retriever: retrieves context
RAG_BasicDemo.py - Retriever → FAISS index: searches
RAG_BasicDemo.py - RAG chain → Text generator: invokes
RAG_BasicDemo.py - Questioner → RAG chain: asks
RAG_BasicDemo.py - RAG chain → Answer: returns
RAG_BasicDemo.py - Text source → Text loader: intended input