Skip to content

SQL+AI Datathon Submission — ClinIQ #6

@learnsol

Description

@learnsol

Project name

ClinIQ

Description

Project: ClinIQ — RAG-Based Medical Chatbot

🏗️ Architecture Summary

  • Frontend: Vanilla HTML/CSS/JavaScript
  • Backend: Fast API (Python 3.12)
  • Database: SQL Server 2025 with native VECTOR columns
  • Vector Search: SQL stored procedures using VECTOR_DISTANCE('cosine')
  • AI Generation: GitHub Models (GPT-5-mini) with Ollama/Azure OpenAI fallback
  • Deployment: Docker Compose (development), Azure Container Apps (production)
Image

✨ Key Features

  1. Retrieval-Augmented Generation (RAG)

    • Vector embedding of user queries (text-embedding-3-small)
    • Semantic search on SQL Server VECTOR columns
    • Multi-factor relevance scoring (cosine + recency + citations)
  2. Sourced AI Responses

    • Every answer includes citations (PubMed PMIDs, NCT IDs)
    • Evidence retrieved from SQL Server
    • Structured JSON responses with source metadata
  3. Multiple AI Backends

    • GitHub Models (default, cloud-based) Or Local Ollama for development
    • Azure OpenAI (production)
  4. Medical Data Sources

    • PubMed articles (vectorized abstracts)
    • Clinical trials (characteristics + eligibility)
  5. Production-Ready

    • OWASP Top 10 security
    • Rate limiting & input validation
    • Non-root Docker containers

📊 SQL + AI Integration

  • Native VECTOR type on medical articles table (1536-dim embeddings)
  • Stored procedures for semantic search with structured filters
  • Hybrid retrieval: Vector similarity + attribute-based filtering (trial status, patient eligibility)
  • Data API Builder provides REST gateway to SQL (no direct SQL from app)

🚀 Quick Start

git clone https://github.com/YOUR-ORG/ClinIQ.git
cd ClinIQ
cp .env.example .env  # Set GITHUB_TOKEN for AI features
docker-compose up --build
# Open http://localhost:8000

See [SETUP.md]for detailed instructions.

Type

Chat App

Project Repository URL

https://github.com/learnsol/ClinIQ

Project video (please verify that the link works)

https://youtu.be/F-EwAHDBmkQ?si=gzdCSr0m7T2KENPV

Metadata

Metadata

Assignees

No one assigned

    Labels

    submissionContest submission for open hack

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions