Core API Documentation Help

Chat

Stream an AI chat response

/ai/chat

Submits a message to the AI chat service and receives a Server-Sent Events (SSE) response. Events are emitted in the order shown below as processing progresses.

Each event uses the following wire format:

event: <event-name> data: <json-encoded-payload>

Events

Event

Repeats

Data shape

tool_call

Yes

See below

tool_result

Yes

See below

text_chunk

Yes

{"text": "..."}

complete

Once

See below

qa_score

Once

See below

error

Once

{"message": "..."}

tool_call

Emitted before each tool is invoked. The tool field identifies which tool was called.

tool value

Extra fields

dlp_deidentify

args.original_length — character count of the raw user message.

search_knowledge_base

args.search_terms — array of query strings sent to the vector store.

tool_result

Emitted after each tool completes.

tool value

Extra fields

dlp_deidentify

cleansed_length — character count of the message after PII removal.

search_knowledge_base

result_count — total number of knowledge base chunks returned across all search terms.

Complete

Field

Type

Description

conversation_id

string (UUIDv4)

ID of the conversation.

full_text

string

The complete AI response.

resources

array \| absent

Contextual content references used to generate the response. One entry per content type, best match by distance.

resources[].id

string

Vector store ID of the resource.

resources[].distance

number

Semantic distance score. Lower is a closer match.

resources[].name

string

Human-readable name.

resources[].description

string

Short description.

resources[].type

string

Content type (e.g. page, post).

resources[].slug

string

URL slug.

qa_score

Emitted after complete. Does not block the client.

Field

Type

Description

score

integer (1–10)

Composite quality score.

relevance

integer (1–4)

How directly the response addresses the question.

completeness

integer (1–3)

Coverage of key points.

clarity

integer (1–3)

Clarity and structure of the response.

reason

string

One-sentence explanation of the score.

Request parameters

{ "message": "How do I update my beneficiaries?", "conversation": "550e8400-e29b-41d4-a716-446655440000", "prompt": "example" }

Responses

Retrieve a chat conversation

/ai/chat/{conversationId}

Returns the full message history for a given conversation, with user messages and AI responses interleaved in chronological order.

Request parameters

Responses

[ { "source": "USER", "time": 1748908800, "text": "How do I update my beneficiaries?" }, { "source": "CORE-AI", "time": 1748908802, "text": "You can update your beneficiaries by logging in to the portal and selecting Benefits.", "resources": [ { "id": "page_88", "distance": 0.21, "name": "Beneficiaries", "description": "How to manage your beneficiaries", "type": "page", "slug": "beneficiaries" } ] } ]
01 September 2026