{"id":28881878,"url":"https://github.com/devparihar5/reasoning-rag-chatbot","last_synced_at":"2026-05-09T09:04:06.298Z","repository":{"id":293275822,"uuid":"983512179","full_name":"Devparihar5/Reasoning-RAG-ChatBot","owner":"Devparihar5","description":"A chatbot that combines retrieval-augmented generation with chain-of-thought reasoning to provide more accurate and explainable answers.","archived":false,"fork":false,"pushed_at":"2025-05-14T13:56:48.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-14T15:00:29.038Z","etag":null,"topics":["python","rag","reasoning-agent","streamlit"],"latest_commit_sha":null,"homepage":"https://reasoning-rag-chatbot.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Devparihar5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-14T13:45:29.000Z","updated_at":"2025-05-14T13:56:51.000Z","dependencies_parsed_at":"2025-05-14T15:00:39.342Z","dependency_job_id":"7e311c8a-515f-4f16-bbef-8431a0a871d7","html_url":"https://github.com/Devparihar5/Reasoning-RAG-ChatBot","commit_stats":null,"previous_names":["devparihar5/reasoning-rag-chatbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Devparihar5/Reasoning-RAG-ChatBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devparihar5%2FReasoning-RAG-ChatBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devparihar5%2FReasoning-RAG-ChatBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devparihar5%2FReasoning-RAG-ChatBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devparihar5%2FReasoning-RAG-ChatBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Devparihar5","download_url":"https://codeload.github.com/Devparihar5/Reasoning-RAG-ChatBot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Devparihar5%2FReasoning-RAG-ChatBot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261012742,"owners_count":23096913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","rag","reasoning-agent","streamlit"],"created_at":"2025-06-20T20:30:40.858Z","updated_at":"2026-05-09T09:04:06.292Z","avatar_url":"https://github.com/Devparihar5.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reasoning Enhanced RAG Chatbot\n\nA chatbot that combines retrieval-augmented generation with chain-of-thought reasoning to provide more accurate and explainable answers.\n\n## Features\n\n- Document retrieval using FAISS vector search\n- Chain-of-thought reasoning with Flan-T5-Base\n- Query refinement based on reasoning\n- Interactive Streamlit interface\n- PDF document processing and chunking\n- Document explorer with metadata visualization\n- Detailed reasoning visualization\n\n## Installation\n\n1. Clone this repository:\n```bash\ngit clone https://github.com/Devparihar5/Reasoning-RAG-ChatBot.git\ncd Reasoning-RAG-ChatBot\n```\n\n2. Install the required packages:\n```bash\npip install -r requirements.txt\n```\n\n## Usage\n\nRun the Streamlit application:\n```bash\nstreamlit run app.py\n```\n\nThen:\n1. Upload PDF documents using the sidebar\n2. Click \"Process Files\" to index the documents\n3. Ask questions in the chat interface\n4. Toggle \"Show reasoning details\" to see the reasoning process\n\n## How It Works\n\n1. **PDF Processing**: Uploaded PDFs are processed and split into manageable chunks with metadata.\n\n2. **Initial Document Retrieval**: When a user asks a question, the system retrieves relevant document chunks using vector similarity search.\n\n3. **Reasoning Generation**: The system generates step-by-step reasoning about the retrieved documents using Flan-T5-Base.\n\n4. **Query Refinement**: Based on the reasoning, the original query is refined to better capture the information need.\n\n5. **Final Document Retrieval**: Documents are retrieved again using the refined query.\n\n6. **Answer Generation**: A final answer is generated based on the reasoning and retrieved documents.\n\n## Components\n\n- **PDFProcessor**: Extracts and chunks text from PDF files with metadata\n- **DocumentStore**: Manages document embeddings and retrieval using FAISS\n- **ReasoningModule**: Generates chain-of-thought reasoning using Flan-T5-Base\n- **RAGReasoner**: Orchestrates the entire pipeline\n- **ReasoningRAGChatbot**: Provides the chat interface\n- **Dataset**: Utility class for managing document collections\n\n## Requirements\n\n- streamlit\n- faiss-cpu\n- sentence-transformers\n- transformers\n- torch\n- numpy\n- PyPDF2\n- langchain\n- langchain-community\n\n## UI Features\n\n- Document statistics dashboard\n- Chat interface with conversation history\n- Document explorer to browse uploaded content\n- Detailed reasoning visualization\n- Query refinement display\n- Retrieved document visualization with relevance scores\n\n## Customization\n\nYou can modify the following parameters in the code:\n- Embedding model (default: all-MiniLM-L6-v2)\n- Reasoning model (default: google/flan-t5-base)\n- Number of documents to retrieve (default: 5)\n- Chunk size for PDF processing (default: ~500 characters)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevparihar5%2Freasoning-rag-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevparihar5%2Freasoning-rag-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevparihar5%2Freasoning-rag-chatbot/lists"}