Technology & Architecture

Built on retrieval-augmented generation (RAG) to keep clinical answers grounded in verified source material

System Architecture

MediAssist uses a retrieval-augmented generation architecture designed specifically to prevent hallucination and ensure every answer is traceable to source documents.

User Question
Hybrid Retrieval
Protocol Index
+
Metadata
Relevant Fragments
LLM Synthesis
Answer + Sources

When a clinician asks a question, the system:

  1. Converts the query into vector embeddings
  2. Performs hybrid search (vector + keyword) across the protocol knowledge base
  3. Reranks results by clinical relevance
  4. Passes the most relevant fragments to an LLM as context
  5. Generates an answer strictly grounded in the provided context
  6. Returns the answer with complete source citations

Technology Stack

Vector Database

Protocol embeddings and hybrid search powered by PostgreSQL with pgvector extension

PostgreSQL
pgvector
pgvectorscale

Infrastructure

Cloud infrastructure running on AWS for scalability and reliability

AWS

Authentication

Identity and access management through Auth0 for provider-independent auth

Auth0

Frontend

Web application and mobile apps built with React ecosystem

React
React Native
Expo

Backend

API services handling protocol processing, retrieval, and generation

NestJS
TypeORM

Search & Retrieval

Hybrid search combining semantic similarity and keyword matching with reranking

Hybrid Search
Reranking

Design Principles

Grounded Generation: Answers must be traceable to specific protocol sections. The system never generates information not present in the source material.

Source Traceability: Every response includes citations with protocol name, section, and page numbers so clinicians can verify the information.

Separation of Concerns: Demo environments use isolated datasets and never connect to production institutional data.

Scalability: Architecture designed to scale from pilot institutions to national-level protocol repositories.