diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..b0edd77130e6ed68ee4d29c2170c08db5b9efa99
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,219 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+.python-version
+
+# pipenv
+# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+# However, in case of collaboration, if having platform-specific dependencies or dependencies
+# having no cross-platform support, pipenv may install different versions of packages depending
+# on the platform. Pipfile.lock may expose sensitive information when shared among developers.
+# Uncomment below to ignore Pipfile.lock
+#Pipfile.lock
+
+# PEP 582; __pypackages__
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+
+# VSCode
+.vscode/
+
+# Editor-specific files
+.idea/
+*.swp
+*.swo
+
+# Folders to ignore
+Obs/
+pdfs/
+Remaining\ docs/
+ocr_output/
+output_new.md
+output_obs.md
+output.md
+processed_docs/
+vector_store/
+simple_vector_store/
+chunked_docs/
+comprehensive_chunks/
+src/processed_markdown/temp_mineru_output/
+src/processed_markdown/temp_nougat_output/
+.DS_Store
+src/api/static/
+
+# Ignore figures directory
+figures/
+
+# Python
+__pycache__/
+*.py[cod]
+*$py.class
+*.so
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# Virtual Environment
+.env
+.venv
+env/
+venv/
+ENV/
+
+# Node
+node_modules/
+.next/
+out/
+build/
+.DS_Store
+*.pem
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# IDE
+.idea/
+.vscode/
+*.swp
+*.swo
+
+# Testing
+coverage/
+.pytest_cache/
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..2f29bcbe4e8fc805db89176303851a73d2185d0a
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,55 @@
+FROM node:18 AS frontend-builder
+
+# Set working directory for frontend
+WORKDIR /app/frontend
+
+# Copy frontend package files and install dependencies
+COPY frontend/package*.json ./
+RUN npm install
+
+# Copy frontend source code and build
+COPY frontend/ .
+RUN npm run build
+
+# Start with Python base image for final stage
+FROM python:3.9-slim
+
+WORKDIR /app
+
+# Install system dependencies and Node.js
+RUN apt-get update && apt-get install -y \
+ curl \
+ && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
+ && apt-get install -y nodejs \
+ && rm -rf /var/lib/apt/lists/*
+
+# Create a user with ID 1000 (required for Hugging Face Spaces)
+RUN useradd -m -u 1000 user
+USER user
+ENV HOME=/home/user \
+ PATH=/home/user/.local/bin:$PATH \
+ PYTHONPATH=/app
+
+# Copy and install Python requirements
+COPY --chown=user requirements.txt .
+RUN pip install --no-cache-dir -r requirements.txt
+
+# Copy frontend build from previous stage
+COPY --chown=user --from=frontend-builder /app/frontend/.next ./.next
+COPY --chown=user --from=frontend-builder /app/frontend/public ./public
+COPY --chown=user --from=frontend-builder /app/frontend/package*.json ./
+
+# Copy backend code and other necessary files
+COPY --chown=user src/ ./src/
+COPY --chown=user figures/ ./figures/
+COPY --chown=user pdfs/ ./pdfs/
+
+# Install frontend production dependencies
+RUN npm install --production
+
+# Copy start script
+COPY --chown=user start.sh ./
+RUN chmod +x start.sh
+
+# Start both services
+CMD ["./start.sh"]
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..48a6108fb1a3056d6dbf00b86f634ddb4ab11ea8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,45 @@
+---
+title: SL Clinical Assistant
+emoji: ๐ฅ
+colorFrom: blue
+colorTo: green
+sdk: docker
+app_port: 3000
+pinned: false
+license: mit
+---
+
+# SL Clinical Assistant
+
+A clinical assistant chatbot powered by RAG (Retrieval-Augmented Generation) that helps medical professionals access and understand Sri Lankan medical guidelines.
+
+## Features
+
+- Interactive chat interface for medical queries
+- RAG-based responses using Sri Lankan medical guidelines
+- Real-time document processing and vector search
+- Modern, responsive UI built with Next.js
+- Secure and scalable FastAPI backend
+
+## Development
+
+```bash
+# Install frontend dependencies
+cd frontend
+npm install
+npm run dev
+
+# Install backend dependencies
+python -m venv .venv
+source .venv/bin/activate # On Windows: .venv\Scripts\activate
+pip install -r requirements.txt
+python -m uvicorn src.api.main:app --reload
+```
+
+## Deployment
+
+The application is deployed on Hugging Face Spaces using Docker. Visit [our Space](https://huggingface.co/spaces/YOUR_USERNAME/sl-clinical-assistant) to try it out.
+
+## License
+
+MIT
\ No newline at end of file
diff --git a/batch_ocr_pipeline.py b/batch_ocr_pipeline.py
new file mode 100644
index 0000000000000000000000000000000000000000..01ef452df0019a7f27bdda6357bf36005a0ee2bf
--- /dev/null
+++ b/batch_ocr_pipeline.py
@@ -0,0 +1,58 @@
+import os
+from pathlib import Path
+from pdf2image import convert_from_path
+from PIL import Image
+from transformers import AutoTokenizer, AutoProcessor, AutoModelForImageTextToText
+
+# Load Nanonets OCR model
+model_id = "nanonets/Nanonets-OCR-s"
+model = AutoModelForImageTextToText.from_pretrained(model_id)
+tokenizer = AutoTokenizer.from_pretrained(model_id)
+processor = AutoProcessor.from_pretrained(model_id)
+model.eval()
+
+prompt = """Extract the text from the above document as if you were reading it naturally. Return the tables in html format. Return the equations in LaTeX representation. If there is an image in the document and image caption is not present, add a small description of the image inside the tag; otherwise, add the image caption inside
. Watermarks should be wrapped in brackets. Ex:
+ Ask any question about health and wellness, and receive accurate, reliable information tailored to Sri Lankan health standards. +
++ Get trusted clinical answers based on Sri Lankan health guidelines +
+macOS/Linux:
+export GROQ_API_KEY='your_api_key_here'
+
+ Windows:
+set GROQ_API_KEY=your_api_key_here
+
+ After setting the API key, restart this application to enable AI reasoning.
+ +