Skip to content

Interface: ConversationMessageResponse

@kortexya/reasoninglayer


@kortexya/reasoninglayer / ConversationMessageResponse

Defined in: src/types/conversation.ts:638

Response from processing a conversation message.

Contains the assistant’s NL response, the OSFQL that was generated and executed, query results (for MATCH queries), and contextual suggestions for follow-up queries.

assistantMessage: string

Defined in: src/types/conversation.ts:640

The assistant’s natural language response.


optional claimAnnotations?: ClaimAnnotationDto[] | null

Defined in: src/types/conversation.ts:709

Per-claim provenance annotations (if claims were annotated).


optional cognitiveStrategy?: CognitiveStrategyDto | null

Defined in: src/types/conversation.ts:721

Cognitive strategy used for this response (when RL training is active and a cognitive agent exists for the tenant). Absent on plain conversation turns.


conversationId: string

Defined in: src/types/conversation.ts:643

The conversation ID (existing or newly created).


frameAmbiguities: FrameAmbiguity[]

Defined in: src/types/conversation.ts:794

Mentions the frame could not bind on its own (frameMode is ambiguous).


optional frameMode?: FrameMode

Defined in: src/types/conversation.ts:792

How frame mode handled this turn; absent when frame mode did not run.


optional frameRecordId?: string

Defined in: src/types/conversation.ts:796

The id of the stored frame record (a Psi-term on the turn), when one was stored.


frameRetries: number

Defined in: src/types/conversation.ts:802

Grounded frame-generation retries actually attempted, including retries that end in a fallback, a clarification or an inconsistency. Separate from repaired, which describes rewrites of an OSFQL proposal.


gateAbstained: boolean

Defined in: src/types/conversation.ts:808

Whether the certified gate declined this turn without executing its proposed read. osfqlExecuted may then echo the refused proposal: do not read it as a successful query with an empty result.


optional injection?: InjectionSummary | null

Defined in: src/types/conversation.ts:782

What adaptive injection carried and cost. Present only when the request set ConversationMessageRequest.injection.


intent: string

Defined in: src/types/conversation.ts:654

Classified intent type (e.g., “query”, “insert”, “define”).


optional matchedTemplates?: QueryTemplate[] | null

Defined in: src/types/conversation.ts:776

Query templates matching the turn’s intent and referenced sort, for suggesting reusable patterns.


optional modelId?: string | null

Defined in: src/types/conversation.ts:753

The model id (compare registry) that produced this turn, when a per-request model was set — so a UI can label which model a side-by-side column came from.


notices: ConversationNotice[]

Defined in: src/types/conversation.ts:706

What the engine did to the question before it answered it, in the order it did it: features it skipped, literals it resolved to values in the data, or a retrieval by meaning that stands in for an exact match. Empty when the answer is to the question as asked.

Each notice is typed by kind and carries its data. Show a notice as a notice, not as a clickable suggestion, and branch on kind, never on the English message.


optional originalOsfql?: string | null

Defined in: src/types/conversation.ts:675

The OSFQL the LLM first proposed. Always set when repaired is true, and absent otherwise. Pairs with osfqlExecuted (the rewrite) so the UI can show the original → executed diff.


optional osfqlExecuted?: string | null

Defined in: src/types/conversation.ts:657

OSFQL that was executed (if any).


optional prefillMs?: number | null

Defined in: src/types/conversation.ts:764

Prompt-prefill wall-clock (ms) for the NL→OSFQL generation — the one-time cost before decoding begins.

Surfaced beside tokensPerSec (which is decode-only on the device path) so a short query’s prefill is visible instead of crushing the apparent rate. Absent unless measured.


producedTermIds: string[]

Defined in: src/types/conversation.ts:681

IDs of terms produced by the OSFQL execution.


optional promptTrace?: PromptTrace | null

Defined in: src/types/conversation.ts:790

Privileged diagnostic echo of the system prompt and the assembled context. Present only when the request set ConversationMessageRequest.includePromptTrace and the engine granted it.


optional proofTrace?: ProofTraceNodeDto | null

Defined in: src/types/conversation.ts:712

Proof tree for this response (populated when PROVE / backward chaining was used).


optional queryFrame?: Readonly<Record<string, unknown>>

Defined in: src/types/conversation.ts:815

The query frame the turn was answered from (validated, normalised, mentions resolved with their degrees). Opaque JSON in the engine’s frame encoding (snake_case keys, passed through verbatim): render it, let the user edit it, and send it to POST /api/v1/conversation/{id}/frames/execute.


optional queryResults?: Record<string, OsfqlValue>[] | null

Defined in: src/types/conversation.ts:678

Query results (if OSFQL was a MATCH). Each entry maps variable names to bound values.


optional reasoningTrace?: ReasoningTraceDto | null

Defined in: src/types/conversation.ts:729

LLM-as-sensor reasoning trace: the ordered pipeline stages (prepare_context → classify_intent → execute_osfql → generate_response), each tagged symbolic/sensor with matched entities and the OSFQL path. Powers the chat’s reasoning/audit explainability timeline.


optional repaired?: boolean

Defined in: src/types/conversation.ts:668

True when the engine rewrote the LLM-proposed query before it executed it: a constrained-regeneration repair of a query the certify-or-abstain gate rejected as hallucinated, a projection prune, a value grounding, the retrieval rescue, or the no-code builder’s DEFINE of each sort the program asserts into and the tenant does not have. Lets the UI surface that the answer reflects a rewritten query rather than the user’s literal request. notices says what a prune, a value grounding or a retrieval rescue did; the builder changes no answer, and the originalOsfql → osfqlExecuted diff shows its DEFINEs.


suggestions: string[]

Defined in: src/types/conversation.ts:693

Follow-up suggestions: questions or OSFQL the user may send next.

Holds only suggestions. What the engine did to the question before it answered is in notices, never here.


optional tokensPerSec?: number | null

Defined in: src/types/conversation.ts:770

Decode throughput for the NL→OSFQL generation, in tokens/second (wall-clock of the LLM call ÷ generated tokens). Approximate; surfaced for model comparison.


turnId: string

Defined in: src/types/conversation.ts:651

The assistant turn the answer was stored as. Pass it to submitAnswerFeedback to rate the answer; it is also the turn’s id in getTurns. Every answer is stored, so every answer carries it: the certify-or-abstain refusal and the could-not-process reply included.


optional uiCustomizations?: UICustomizationDto[] | null

Defined in: src/types/conversation.ts:715

UI customizations detected in this response (for multi-turn UI evolution).


optional uiSortId?: string | null

Defined in: src/types/conversation.ts:684

Sort ID referenced in the message (for UI rendering).


optional validityCertificateHash?: string | null

Defined in: src/types/conversation.ts:732

SHA-256 hash of the validity certificate.


optional validityCertificateId?: string | null

Defined in: src/types/conversation.ts:735

ID of the validity certificate (if generate_certificate was true).


optional validityCertificateRuleProgramHash?: string | null

Defined in: src/types/conversation.ts:741

Hex SHA-256 of the rule program active when the validity certificate was issued — the durable “which rule version served this proof” pin.


optional validityCertificateRuleRevision?: number | null

Defined in: src/types/conversation.ts:747

In-process rule-program revision ordinal at issuance. Present only when rule-revision tracking is enabled on the executing store.