AI Triage
The triage service runs Olly's clinical triage agent: a member works through an NHS-111-style pathway in conversation and reaches a disposition. The same domain also holds the ai-chat assistant. Every tool call is traced to Langfuse.
Field reference: full columns, types and nullability live in the catalog: glossary terms
Session,Turn,Recommendation,Judgement,User,Conversation,Message. This page is the narrative.
Session and Turn
Sessionis one triage interaction. It carries the patient demographics (sex,age), thechief_complaint, the current pathway position (pathway_id/current_state_id: text ids into the NHS pathway model, not modelled concepts), and the finaldispositionas a structured JSONB object.statusis a real DB CHECK:active | completed | abandoned(lowercase).Turnis one message in a session (roleis a DB CHECK ofuser | assistant | tool), with the content and, for tool turns,tool_name/tool_args/tool_result(JSONB). Turns make the whole interaction replayable.
Recommendation
The terminal Recommendation is the disposition itself, realised as Session.disposition (there is no separate table). It carries an urgency in { emergency, urgent, non_urgent, self_care } plus advice. A disposition is what hands off to Care Pathways.
Evaluation
Judgement is an offline quality score produced by a judge LLM over a completed session (tone, PRD-compliance and safety against a rubric), stored to track model regression across prompt versions. It is part of the eval harness, not the live flow.
User: a triage credential, not a person
The triage User is the service's own API-credential record (username + hashed API key, with sex/age for pathway routing, both DB-CHECK'd). It is not the platform human identity (Keycloak) nor a Party.
AI-chat assistant
The ai-chat surface adds Conversation (scoped to an org via org_locator + a user_sub, with a persona) and Message (role DB CHECK user | assistant | system). Token usage and tool-call traces are in Langfuse, not the messages table.
Caveats
pathway_id/current_state_id/Turn.state_idare text identifiers into the NHS pathway content, not modelled concepts (there is noPathwaytable).- The ai-chat
Messagerole set (…/system) differs from the triageTurnrole set (…/tool); don't conflate them.
