Python · Django · PGVector · RAG Architecture · Celery

Cliniq.ai — AI-Driven Healthcare SaaS

Python 3.12 Django PGVector RAG Architecture Pydantic Celery

The Challenge

Managing irregular clinic workflows, HIPAA data compliance, and high latency in traditional medical record parsing systems.

The Solution

Architected an AI medical management platform utilizing PGVector embeddings for semantic record retrieval, Pydantic schema validation for zero-hallucination patient triaging, and Celery background workers for asynchronous pipeline processing.

Tech Stack & AI Pipeline

Built with Django REST Framework and PostgreSQL (with pgvector extension). Patient medical intake data is sanitized, embedded, and queried via a Retrieval-Augmented Generation (RAG) pipeline to ensure high medical triage accuracy without raw patient PII leakage.

System Architecture Flow

      graph TD
          User[Clinic Intake / Patient Entry] -->|1. Sanitized Payload| API[Django REST API Core]
          API -->|2. Async Task Queue| Celery[Celery Async Pipeline]
          Celery -->|3. Generate Vector Embedding| Embeddings[OpenAI / Local Embedding Engine]
          Celery -->|4. Store & Query Semantics| PGVector[(PostgreSQL + PGVector)]
          PGVector -->|5. Contextual Match| RAG[RAG Context Constructor]
          RAG -->|6. Pydantic Validated Triaging| Response[Deterministic Patient Triage Output]
      

Key Impact

Streamlined clinic operations by 40% in internal benchmarks while reducing medical record extraction latency to <300ms.