{"id":24144513,"url":"https://github.com/sathviknayak123/agentic-rag","last_synced_at":"2026-04-08T18:04:52.431Z","repository":{"id":267013366,"uuid":"900019353","full_name":"SathvikNayak123/Agentic-RAG","owner":"SathvikNayak123","description":"Agentic RAG with Llama-3.1-8b model Fine-tuned on medical conversational dataset","archived":false,"fork":false,"pushed_at":"2025-01-21T19:59:28.000Z","size":225490,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T14:44:19.099Z","etag":null,"topics":["agentic-rag","chromadb","context-aware-chat","fastapi","huggingface","langchain","langgraph","llama3","ollama","peft-fine-tuning-llm","qlora","quantization","rag","rouge-evaluation","unsloth"],"latest_commit_sha":null,"homepage":"https://huggingface.co/sathvik123/llama3-ChatDoc","language":"Jupyter Notebook","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/SathvikNayak123.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}},"created_at":"2024-12-07T16:40:23.000Z","updated_at":"2025-01-22T13:34:20.000Z","dependencies_parsed_at":"2025-01-09T18:49:01.087Z","dependency_job_id":null,"html_url":"https://github.com/SathvikNayak123/Agentic-RAG","commit_stats":null,"previous_names":["sathviknayak123/chatbot","sathviknayak123/agentic-rag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SathvikNayak123/Agentic-RAG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SathvikNayak123%2FAgentic-RAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SathvikNayak123%2FAgentic-RAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SathvikNayak123%2FAgentic-RAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SathvikNayak123%2FAgentic-RAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SathvikNayak123","download_url":"https://codeload.github.com/SathvikNayak123/Agentic-RAG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SathvikNayak123%2FAgentic-RAG/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263819154,"owners_count":23516116,"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":["agentic-rag","chromadb","context-aware-chat","fastapi","huggingface","langchain","langgraph","llama3","ollama","peft-fine-tuning-llm","qlora","quantization","rag","rouge-evaluation","unsloth"],"created_at":"2025-01-12T06:11:41.041Z","updated_at":"2025-12-30T22:17:00.770Z","avatar_url":"https://github.com/SathvikNayak123.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agentic RAG Medical Assistant\n\nBuilt an advanced medical assistant chatbot using a fine-tuned LLaMA-3.1-8B model and a Retrieval-Augmented Generation (RAG) pipeline with intelligent agent functionality.\n\n- **RAG Architecture**:\n  \n![pic1](docs/1_lBVfMJ__9NjgKYiKI6mp4A.png)\n\n- **Agentic RAG Workflow**:\n\n![pic2](docs/graph.png)\n\n## Features\n\n- **History-Aware Responses**: Provides precise medical advice by integrating over **20+ medical resources** through a RAG pipeline.\n- **Intelligent Query Routing**: Implemented agents to dynamically route off-topic queries to web search (e.g., Wikipedia) and process on-topic queries through document retrieval pipelines.\n- **Document Relevance Grading**: Graded retrieved documents for relevance, generating responses if relevant or rewriting queries for improved retrieval.\n- **Fine-Tuned LLaMA Model**: Fine-tuned **LLaMA 3.1 8B** using **LoRA**, achieving a **0.29 ROUGE1 score** for accuracy and reliability.\n- **Low-Latency Interface**: Built an asynchronous chat interface with **FastAPI**, reducing response latency by **40%** for a seamless user experience.\n\n---\n\n## Tech Stack\n\n### 1. Language Model\n\n- **LLaMA 3.1 (8B)** fine-tuned on **medical conversational datasets** using **PEFT (LoRA)** for domain-specific expertise.\n- **Unsloth**: Accelerated fine-tuning with **4-bit quantization**, reducing resource usage without compromising performance.\n  ```bash\n  https://GitHub.com/unslothai/unsloth.git\n  ```\n- **Ollama**: Used for model integration and serving.\n\n### 2. RAG Pipeline\n\n- **LangChain**: Enabled context-aware responses and integrated the LLaMA model with document retrieval capabilities.\n- **ChromaDB**: Stored and retrieved embeddings for efficient and accurate responses.\n\n### 3. Backend\n\n- **FastAPI**: Provided a robust and asynchronous backend for a seamless chat interface.\n\n### 4. Other Tools\n\n- **Hugging Face**: Hosted and served the optimized model in **GGUF format** for efficient inference.\n\n---\n\n## Setup Instructions\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone https://github.com/SathvikNayak123/Agentic-RAG.git\n   ```\n\n2. **Install Dependencies**\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Setup**\n\n   - Populate the database with medical documents.\n   - Generate and store embeddings using the fine-tuned LLaMA 3.1 model.\n   - Install Ollama and pull the model from Hugging Face:\n     ```bash\n     ollama pull hf.co/sathvik123/llama3-ChatDoc\n     ```\n\n4. **Run the Application**\n\n   ```bash\n   uvicorn app:app --reload\n   ```\n\n---\n\n## Results\n\n- **Model Performance**: Achieved a **0.29 ROUGE1 score** with fine-tuned LLaMA 3.1.\n\n- **RAG Responses**: Demonstrated accurate and history-aware conversational capabilities.\n![pic3](docs/Screenshot%202024-12-16%20160214.png)\n\n- **Agent Functionality**: Effectively routed and processed queries based on topic relevance.\n![pic4](docs/Screenshot%202025-01-09%20222456.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsathviknayak123%2Fagentic-rag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsathviknayak123%2Fagentic-rag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsathviknayak123%2Fagentic-rag/lists"}