Back to projects
Applied AI / Health TechFeatured

TrustMed AI

A responsible AI health-information assistant focused on safer conversational flows, retrieval, citation, and guardrails for sensitive user questions.

Role
AI engineer / full-stack builder
Timeline
2026
Type
Applied AI product
Team
Solo build
PythonFastAPIReactTypeScriptPostgreSQLLLMs

Case study public · source private

case-study/trustmed-ai.tsx
TrustMed AI project visual
// 01. Overview

Project overview

TrustMed AI is a case study in building an AI assistant for a domain where accuracy, tone, boundaries, and citations matter as much as the chat experience.

The goal was to design a product-shaped system around retrieval, answer verification, escalation language, and a user interface that makes uncertainty visible.

// 02. Problem

The product problem

People often ask health questions in moments of stress, but generic chatbot answers can overstate confidence, hide sources, or fail to explain what the user should do next.

The product challenge was to create a useful information assistant while keeping the experience conservative, transparent, and clearly scoped.

// 03. Solution

Solution direction

The system combines a conversational API, retrieval pipeline, response guardrails, and citation-first answer formatting.

Instead of optimizing for long generated responses, the interaction model prioritizes grounded summaries, source visibility, and safe handoff language for higher-risk questions.

// 04. My Contribution

What I owned

  • Designed the end-to-end assistant flow from intake to answer generation.
  • Structured backend boundaries for retrieval, response generation, citation formatting, and safety checks.
  • Built frontend patterns for displaying answer confidence, sources, and follow-up actions.
  • Explored guardrail prompts and refusal paths for sensitive medical scenarios.
// 05. Key Features

Feature system

feature.01

Guardrailed response flow

Routes health questions through conservative answer rules, escalation language, and source-aware formatting.

feature.02

Retrieval-first answers

Keeps generated responses tied to source material instead of relying on model memory alone.

feature.03

Citation visibility

Surfaces supporting references as part of the answer experience, not as an afterthought.

feature.04

Product-ready UI states

Handles loading, empty, uncertain, and safety-sensitive states with clear user-facing language.

// 06. Technical Architecture

How the system fits together

architecture.map
system view
LayerResponsibilityTools
Client
Prompt intake, answer display, source cards, safety notices
React, TypeScript
API
Request validation, orchestration, response streaming boundary
FastAPI
AI pipeline
Retrieval, prompt assembly, model response, citation mapping
Python, LLM APIs
Persistence
Session metadata, source records, feedback signals
PostgreSQL
orchestration.ts
const answer = await assistant.respond({
  question,
  context: await retrieveTrustedSources(question),
  guardrails: ["medical_scope", "cite_sources", "escalate_risk"],
});
// 07. Challenges & Decisions

Engineering decisions

Avoiding unsafe certainty

decision.01
Decision

Answer templates were designed to qualify uncertainty and recommend professional care when risk signals appear.

Result

The assistant feels useful without presenting itself as a doctor.

Keeping citations connected

decision.02
Decision

The architecture treats citations as structured output tied to retrieved context.

Result

The UI can display sources consistently instead of scraping them from text.

// 08. Outcome & Status

Where the project stands

The project is currently presented as a public case study with private source code.

The strongest learning was that responsible AI work is mostly product design, system design, and constraint design before it is model selection.