How madhavi-1801/rag-application works
This is a console-based, single-document RAG question-answering application. A user supplies a PDF, TXT, or DOCX path; the CLI delegates ingestion and question answering to RAGPipeline. Ingestion extracts text, chunks it, and builds an in-memory FAISS index; queries retrieve top-k chunks, assemble a grounded prompt, and invoke a configured LLM or offline mock. README documents optional local or cloud embeddings and OpenAI/Gemini LLMs. Edges follow explicit calls or README workflow; external model-provider links are documented integrations.
Main entry points: rag_pipeline.py RAG orchestrator · main.py Interactive CLI · embeddings.py Embedding factory · vector_store.py FAISS index and search
Components 11
Console interface
- Interactive CLI
main.py
Document ingestion
- Document extraction
document_loader.py - Text chunking
chunker.py
Retrieval and indexing
- Embedding factory
embeddings.py - FAISS index and search
vector_store.py
Answer generation
- RAG orchestrator
rag_pipeline.py - Configured LLM or mock
rag_pipeline.py
Other components
- User
- PDF / TXT / DOCX
- HuggingFace / OpenAI / Gemini embeddings
- OpenAI / Google Gemini APIs
Connections 14
- User → Interactive CLI: enters path and questions
README.md - Interactive CLI → RAG orchestrator: calls
main.py - User → PDF / TXT / DOCX: selects
README.md - RAG orchestrator → Document extraction: loads text
rag_pipeline.py - Document extraction → PDF / TXT / DOCX: extracts from
README.md - RAG orchestrator → Text chunking: splits text
rag_pipeline.py - RAG orchestrator → Embedding factory: initializes
rag_pipeline.py - RAG orchestrator → FAISS index and search: creates index
rag_pipeline.py - Embedding factory → HuggingFace / OpenAI / Gemini embeddings: configures
README.md - FAISS index and search → Embedding factory: embeds chunks and queries
README.md - RAG orchestrator → FAISS index and search: searches top-k
rag_pipeline.py - RAG orchestrator → Configured LLM or mock: invokes prompt
rag_pipeline.py - Configured LLM or mock → OpenAI / Google Gemini APIs: uses configured provider
README.md - RAG orchestrator → Interactive CLI: returns answer
main.py