{"id":20961455,"url":"https://github.com/samudraneel05/mnnit-chatbot","last_synced_at":"2026-05-11T03:54:07.017Z","repository":{"id":251967474,"uuid":"838990480","full_name":"samudraneel05/MNNIT-Chatbot","owner":"samudraneel05","description":"A conversational AI chatbot for MNNIT that utilizes a hybrid RAG mechanism. It processes information from MNNIT PDFs, stores embeddings in Pinecone, and uses OpenAI GPT-4-o-mini API for initial queries. If needed, it falls back to a local Llama 2-7B model for contextually relevant answers.","archived":false,"fork":false,"pushed_at":"2024-11-18T22:24:23.000Z","size":1346,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T01:34:10.531Z","etag":null,"topics":["chatbot","llama2","machine-learning","rag","retrieval-augmented-generation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samudraneel05.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-08-06T18:38:55.000Z","updated_at":"2024-11-18T22:24:26.000Z","dependencies_parsed_at":"2024-08-06T22:27:35.472Z","dependency_job_id":"56c802cd-3f60-4015-88e2-20d8624c25fb","html_url":"https://github.com/samudraneel05/MNNIT-Chatbot","commit_stats":null,"previous_names":["samudraneel05/mnnit-chatbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samudraneel05%2FMNNIT-Chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samudraneel05%2FMNNIT-Chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samudraneel05%2FMNNIT-Chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samudraneel05%2FMNNIT-Chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samudraneel05","download_url":"https://codeload.github.com/samudraneel05/MNNIT-Chatbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243358307,"owners_count":20277996,"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":["chatbot","llama2","machine-learning","rag","retrieval-augmented-generation"],"created_at":"2024-11-19T02:13:44.147Z","updated_at":"2026-05-11T03:54:05.115Z","avatar_url":"https://github.com/samudraneel05.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MNNIT-Chatbot\n\n## Overview\n\nThe **MNNIT Chatbot** is a conversational AI system designed to provide accurate and context-aware responses using a fallback Retrieval-Augmented Generation (RAG) mechanism. It integrates cutting-edge AI tools and frameworks to leverage both cloud-based and local AI models for an optimal user experience. This project is built specifically for use cases involving MNNIT-related information, sourced from two provided PDFs.\n\n---\n\n## Key Features\n\n- **Hybrid Query Mechanism**: Queries first interact with a cloud-based AI model (OpenAI GPT-4-o-mini API). If the response is unsatisfactory, the system falls back to a local Llama 2-7B model using a RAG mechanism.\n- **PDF Integration**: Extracts, chunks, and embeds information from two provided MNNIT PDFs.\n- **Pinecone Vector Database**: Stores embeddings for efficient retrieval during query processing.\n- **LangChain Integration**: Builds robust prompt templates and retrieval-based question-answering (QA) workflows.\n- **Local LLM Deployment**: Uses the Llama 2-7B model (quantized) via CTransformers for resource-efficient local execution.\n- **Flask Web Application**: Provides a user-friendly interface for interaction and deployment.\n\n---\n\n## Process Diagram\n![Process Diagram](https://github.com/samudraneel05/MNNIT-Chatbot/blob/main/MNNIT%20Chatbot.jpeg)\n\n---\n\n## Technical Workflow\n\n1. **PDF Processing**:\n   - Two PDFs containing MNNIT-specific information are ingested.\n   - Text is extracted and divided into manageable chunks.\n   - Embeddings are created for these chunks using a pre-trained model.\n\n2. **Vector Database**:\n   - Generated embeddings are stored in the Pinecone vector database.\n   - Pinecone enables efficient similarity searches to fetch the most relevant chunks during queries.\n\n3. **Query Processing**:\n   - User queries are first sent to a cloud-based AI model (e.g., GPT-4-o-mini API).\n   - If the response quality is deemed unsatisfactory, the fallback RAG mechanism is activated.\n   - The fallback mechanism performs:\n     - **Contextual Retrieval**: Relevant information is retrieved from Pinecone.\n     - **Local LLM Execution**: The Llama 2-7B model processes the retrieved context to generate a refined response.\n\n4. **Prompt Engineering**:\n   - LangChain is used to structure prompts for both the cloud-based and local models.\n   - A custom prompt template ensures alignment with the chatbot’s context and objectives.\n\n5. **Deployment**:\n   - The Flask framework serves as the frontend interface for interacting with the chatbot.\n   - End-users can query the chatbot via a web-based application.\n\n---\n\n## Prerequisites\n\n- Python 3.8\n- Conda (for environment management)\n- Access to APIs (OpenAI GPT-4-o-mini)\n- Pre-downloaded **Llama 2-7B Model**: \n  - File: `llama-2-7b-chat.ggmlv3.q4_0.bin`\n  - [Download Link](https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML/tree/main)\n\n---\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/samudraneel05/MNNIT-Chatbot.git\n   cd MNNIT-Chatbot\n2. Run the following commands one by one:\n```bash\nconda create -n mnnitchatbot python=3.8 -y\n```\n\n```bash\nconda activate mnnitchatbot\n```\n\n```bash\npip install -r requirements.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamudraneel05%2Fmnnit-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamudraneel05%2Fmnnit-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamudraneel05%2Fmnnit-chatbot/lists"}