Message
I need an appointment and have a lab question.
Patient front door
Case state
Not started
Information entered here is used for patient intake, scheduling, handoff, and clinic operations workflows. The assistant does not provide medical advice.
Conversation
Choose a request
MedBay assembles intake and available records into a traceable pre-consultation brief, shows what is missing, and keeps the clinic reviewer in control of approval.
What happens next
MedBay connects extracted facts to their original sources, checks for missing records, and prepares the artifact for human review without making a clinical decision.
See the lifecycle ›Message
I need an appointment and have a lab question.
Triage
Intent: scheduling · Policy: human review
Handoff
Case ready with reason and next action.
The patient sees one simple intake path. The clinic receives a source-linked brief, missing-document list, safety decisions, and an explicit approval state.
Contact flow›Intake case lifecycle
Northstar Clinic · live routing preview
This preview follows a single patient request as MedBay turns free text into a structured case. The assistant can support administrative intake, but clinical interpretation is held for staff before any response is sent.
01
Patient message
Request enters the intake
02
Extract fields
Intent and risk become structured
03
Route safely
Clinical language is held for staff
04
Staff acts
Scheduling and review are ready
Patient message
Extracted context
Staff handoff
message
extract
safety
handoff
Every displayed fact points back to the intake form, referral, medication list, or record it came from.
Staff can see what is still needed before the patient arrives instead of discovering gaps during the visit.
A pre-consultation brief stays in review until an authorized clinic reviewer explicitly approves or rejects it.
The workflow organizes records; it does not diagnose, score risk, recommend treatment, or interpret exams.
MedBay separates the patient experience from the operational engine behind it. One request can become an intake case, policy decision, scheduling handoff, and staff review record without adding another loose chat transcript.
See the operating layer›Patient-facing intake stays simple and branded.
Clinical risk routes before the assistant responds.
Every handoff lands with context and next action.
Audit event stack
real flowmessage_received
user message saved with audit context
policy_evaluated
decision, severity, and risk flags recorded
intake_extracted
fields, triage, and case status persisted
handoff_requested
staff notification sent when policy requires it
export async function handlePatientMessage(rawInput, dependencies) { const input = handlePatientMessageSchema.parse(rawInput); const conversationId = input.conversationId || crypto.randomUUID(); await dependencies.conversationRepository.saveMessage({ conversationId, role: "user", content: input.message, }); const policy = evaluateIntakePolicy({ message: input.message, extractedFields: mergedFields, wantsScheduling: wantsScheduling(input.message), }); const nextStatus = decideNextIntakeStatus({ policy, completeness }); const updatedCase = await dependencies.caseRepository.save({ ...intakeCase, status, fields: mergedFields, handoffRequired: policy.handoffRequired, });}Before
signals
MedBay
intake engine
After
Assistant pauses and sends the case to staff with context attached.
Instead of a hidden chat transcript, the page shows what changes: loose patient language becomes a structured, reviewable case for operations.
Raw message
Patient asks in natural language, with scheduling and lab context mixed together.
Case record
MedBay turns the transcript into stable fields that the clinic can inspect.
Policy route
Clinical interpretation is held before the assistant answers beyond its scope.
Staff handoff
The admin console opens with reason, next action, and original message attached.
What is built
Patient intake
01Guided chat, quick actions, safety routing, and persisted message history.
Admin operations
02Case queue, lead review, appointment handoff, and knowledge base management.
Production path
03Server-side secrets, managed Postgres, API routes, and adapter boundaries.
Production execution
Runtime shape
The browser talks to MedBay API routes. The server evaluates policy, writes cases, and connects clinic adapters without exposing production credentials.
Project overview
The portfolio version keeps the demo fast, but the project is structured like a real clinic product: patient intake, operational review, scheduling handoff, knowledge management, and server-side integrations.
Safety boundary
Medbay assists with intake, source-bounded extraction, record organization, scheduling, and handoff. Deterministic checks enforce provenance and decide when to clarify, escalate, or block.
Scheduling, clinic information, intake collection, and knowledge-base answers.
Missing contact details, vague intent, or low-confidence extraction.
Lab interpretation, medication questions, diagnosis language, or staff requests.
Emergency red flags, unsafe medical advice, or urgent high-risk language.
policy engine runs before and after the AI response / assistant output is validated before persistence
Project execution
MedBay is not only a visual concept. The project includes patient intake, admin review, knowledge management, appointment flow, and a demo path that avoids service delays during evaluation.
Patient intake
Chat flow, quick prompts, safety routing, and persisted conversation state.
Clinic operations
Admin queue, case review, appointment handoff, lead tracking, and knowledge updates.
Demo mode
Portfolio data loads immediately so the product can be reviewed without external latency.
Functional surface
Frontend
Next.js App Routerpublic site + admin
Intake API
/api/chatpolicy-aware responses
Case store
Supabase / Postgrescases, leads, messages
Clinic tools
Admin dashboardreview, schedule, handoff
Production runbook
Configure server secrets
OpenAI, Supabase, Resend, calendar credentials
Connect managed storage
Postgres tables for cases, knowledge, leads, and appointments
Deploy web runtime
Next.js server routes handle intake, admin, and API boundaries
Keep demo fallback
Portfolio mode stays fast when production services are unavailable
Runtime boundary
browser -> Next.js API -> policy engine -> database / clinic adapters
Safety boundary