Skip to main content

The assistant

This is the assistant from the handler's side, with a pointer to the code behind each behaviour.

Files can be attached to a question: see Attached files.

Opening it​

A launcher sits bottom-right on every screen. It opens a popover. The expand button in its header docks it as a side panel a quarter of the screen wide, and the page reflows around it. The choice is remembered per browser, and opening from a demo hint keeps a docked panel docked.

The header says which claim the assistant is talking to (Talking to CP-AUT-260381), or Open a claim to start when the screen has none. On a page with no claim the composer is disabled.

Code: frontend/src/chat/ChatWidget.tsx, ChatDock.tsx.

Asking​

The handler types a question, or picks a quick action:

  • Pinned chips for frequently used capabilities, such as Summarise claim and Validate policy.
  • More opens the enabled capabilities in five groups. Each has a one-line description.

A quick action sends a natural message ("Validate the policy against this loss.") so the transcript reads well, and runs that capability's playbook.

Code: CapabilityMenu.tsx; catalogue in packages/shared/src/capabilities.ts.

Settings for the demo chat​

Open Settings (/settings) in the top bar to choose which capabilities are available in the demo chat. The switches also control the Ask buttons in claim alerts and the quick actions in demo tips. Alert messages and demo notes stay visible.

Turn off Text input to use the enabled quick actions. This hides the text box, starter questions, microphone and attachment controls. Choose Claim summary only to do this and keep Summarise claim as the only quick action. Restore defaults enables every capability and restores text input.

Settings apply immediately and survive a refresh in the same browser tab. ChatSettingsProvider keeps them in sessionStorage for that tab's session. Prompt Lab, embedded assistants and direct API calls operate independently of these settings.

Watching it work​

While it works, the assistant shows:

  • activity chips for each lookup, in the present tense: Reading the policy…, Checking the policy period and coverages…;
  • the answer streaming in as it is written, rendered as GitHub-flavoured Markdown (ChatMarkdown): tables scroll sideways in their own box rather than squashing the panel, and short cells such as amounts stay on one line;
  • a lookups link under the finished answer that expands to show every tool it called and a summary of what came back;
  • Check before sharing, under the answer, when it quotes a figure that matches nothing the lookups returned: an amount the model added up, a date it worked out, or one it made up. Each figure is quoted with the words around it, as it reads in the answer, so the handler can find it and check it against the claim. A figure the model calculated without showing how, which the check can rebuild from two figures beside it, is shown instead as Worked out: £32,500 = £35,000 − £2,500. See the figure check.

Figures in answers match the screen: the tools hand the model money, rates and dates formatted the way the claim screen shows them.

If a question cannot be asked at all (the claim is not found, or no model is configured on this deployment), the panel shows the reason as an error line rather than an empty answer.

Stop cancels the turn, including the model call.

Pointing at the screen​

When an answer refers to something on the claim screen, the assistant can highlight it. The panel scrolls into the middle of the view, pulses, and keeps an amber outline that fades over a minute. It only does this when it has actually called highlight_panel; the prompt forbids claiming a highlight it did not make.

Code: frontend/src/chat/highlight.ts; the tool in api/src/capabilities/tools.ts.

Rating answers​

Every finished answer has a thumbs up and a thumbs down. A thumbs down opens a card asking what was wrong, with reason chips and a note. The reasons go to the people improving the prompts, never into the conversation. See Answer feedback.

Speaking​

The microphone button starts a spoken conversation with the same claim, prompts and tools. A hero area shows the assistant's level and the handler's microphone level. Both sides' transcripts appear in the chat as bubbles marked with a microphone. If the microphone is silent for a few seconds the panel says so. See Voice.

The disclaimer​

The panel carries a permanent notice that AI can make mistakes and that anything acted on should be checked against the claim record. It is part of the product, in the demo and in every embedding. Hosts are asked not to remove or obscure it.

Clearing and switching​

Clear conversation empties the transcript and the history. Moving to another claim does the same automatically: a conversation belongs to one claim.

What it will not do​

The assistant declines anything outside the claim on screen, never claims to have changed anything, and treats text inside the record as data. If a document contains an instruction to "the AI", the assistant tells the handler and treats it as a possible fraud indicator. See Security.