How mdsohail07/rag_agent works
This repository is a small LangChain learning project, centered on a Streamlit PDF RAG agent, with a separate Gemini Q&A chatbot. The main workflow uploads PDFs, loads and chunks them, embeds them into an in-memory vector store, then answers questions through an agent with retrieval and conversation checkpointing. The README also advertises streaming responses, represented here as a capability; its implementation was not inspected. Edges reflect the sampled app code or README; notebook experiments are not expanded into runtime components.
Main entry points: rag_agent.py RAG workflow · 1_qna_bot.py Gemini chat UI · doc_files Uploaded PDFs · streaming_response.ipynb Streaming responses
Components 16
PDF RAG
- Upload and chat UI
apps/rag_agent.py - RAG workflow
apps/rag_agent.py - Uploaded PDFs
apps/doc_files - PDF loader
apps/rag_agent.py - Text chunking
apps/rag_agent.py - Gemini embeddings
apps/rag_agent.py - Gemini embedding API
- In-memory vector store
apps/rag_agent.py - Question-answer agent
apps/rag_agent.py - Context retrieval tool
apps/rag_agent.py - Groq LLM
- Conversation checkpoint
apps/rag_agent.py - Streaming responses
notebooks/streaming_response.ipynb
Gemini Chat
- Gemini chat UI
apps/1_qna_bot.py - Gemini chat model
Other components
- User
Connections 17
- User → Upload and chat UI: uploads, asks
apps/rag_agent.py - Upload and chat UI → RAG workflow: processes upload
apps/rag_agent.py - RAG workflow → Uploaded PDFs: writes files
apps/rag_agent.py - PDF loader → Uploaded PDFs: loads PDFs
apps/rag_agent.py - RAG workflow → PDF loader: loads documents
apps/rag_agent.py - RAG workflow → Text chunking: splits documents
apps/rag_agent.py - RAG workflow → Gemini embeddings: creates vectors
apps/rag_agent.py - Gemini embeddings → Gemini embedding API: requests embeddings
apps/rag_agent.py - RAG workflow → In-memory vector store: indexes chunks
apps/rag_agent.py - RAG workflow → Question-answer agent: creates agent
apps/rag_agent.py - Question-answer agent → Context retrieval tool: registers tool
apps/rag_agent.py - Context retrieval tool → In-memory vector store: searches vectors
apps/rag_agent.py - Question-answer agent → Groq LLM: uses model
apps/rag_agent.py - Question-answer agent → Conversation checkpoint: configures checkpoint
apps/rag_agent.py - User → Gemini chat UI: asks question
apps/1_qna_bot.py - Gemini chat UI → Gemini chat model: invokes model
apps/1_qna_bot.py - RAG workflow → Streaming responses: supports streaming
README.md