MedStudy AI Pro is a high-precision, context-isolated Retrieval-Augmented Generation (RAG) system engineered to ingest dense medical manuscripts and generate hallucination-resistant insights. Optimized for clinical precision, the platform mitigates cross-document context bleeding, optimizes memory utilization, and enforces rigid source grounding.
[User Uploads PDF]
โ
โผ
[In-Memory Text Extraction] โโโบ Non-blocking PyPDFLoader stream
โ
โผ
[Optimized Semantic Chunking] โโโบ RecursiveCharacterSplitter (1000 tokens | 200 overlap)
โ
โผ
[HuggingFace Embeddings] โโโบ Model: all-MiniLM-L6-v2 (384-dim dense vectors)
โ
โผ
[In-Memory Vector Store] โโโบ ChromaDB/FAISS (Strict Ephemeral Isolation)
โ
โผ
[Llama-3.3-70B Pipeline] โโโบ Temperature: 0.1 + Deterministic Grounding Prompt
โ
โผ
[Streamlit UI Rendering] โโโบ Chat Interface + Verified Fragment Citations
๐ Technical Breakthroughs & Infrastructure During the development of MedStudy AI Pro, several high-impact cloud infrastructure challenges were systematically engineered away:
๐ Zero-Leakage Ephemeral Storage Standard vector databases persist data to disk, running a risk of context bleeding across separate user files. This engine decouples document tracking by spinning up an isolated, dynamic, in-memory index.
๐ Bypassing Iframe 403 Rejections Cloud platform dashboards often isolate web frameworks behind <iframe> layers. This project routes user traffic directly to the raw application container network socket.
๐ง Anti-Hallucination Grounding Framework To safely handle delicate clinical data, the inference pipeline utilizes a low-temperature constraint (T = 0.1) coupled with deterministic system instructions.
๐ ๏ธ Deep Tech Stack LLM: llama-3.3-70b-versatile via high-speed LPU inference (Groq Cloud). Orchestration: LangChain Core (RunnablePassthrough, ChatPromptTemplate). Vector Embeddings: HuggingFace all-MiniLM-L6-v2. Vector Store: ChromaDB / FAISS (In-Memory Implementation). Frontend: Streamlit Framework (State Handling Session Hooks).
๐ฆ Installation & Developer Setup
-
Prerequisites Python 3.10 or higher. A Groq Cloud API Key.
-
Setup code Bash git clone https://github.com/AYESHAASS/Medical-RAG-Assistant.git cd Medical-RAG-Assistant python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt
-
Environment Create a .env file in the root directory: code Text GROQ_API_KEY=your_production_low_latency_groq_api_token
-
Run code Bash streamlit run app.py
๐ฌ Rigorous Test Cases Passed The system was evaluated against empirical medical literature to verify retrieval stability across three core stress vectors: Exact Metric Ingestion: Successfully extracted complex statistics (e.g., 95% Confidence Intervals and Brier Scores) from compressed markdown tables.
Multi-Hop Synthesis: Mapped multi-layer neural network parameters (128, 64, 32) across distributed framework logs. Out-of-Bounds Refusals: Corrected handled negative testing by refusing to answer questions not present in the uploaded manuscript.
โ๏ธ Disclaimer This tool is for educational and research purposes only. It is not intended for clinical decision-making. Always consult primary clinical guidelines and human experts before making medical decisions.
๐ License Distributed under the MIT License. See LICENSE for more information.
