---
id: WF-PFM-LLM-013
title: Answer a general Jazz AI question
trigger: Answer a general question in Jazz AI.
product_area: platform
module: llm
revision: 1
status: draft
design_intent: open
implementation_evidence: observed
inference:
  - IOP-PFM-LLM-001
source_sha:
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
implements:
  - CAP-PFM-LLM-019
moves:
  - STATE-PFM-LLM-008
crosses:
  - SVC-PFM-LLM-console-agent
idempotency: Every successful send asks again and appends another exchange; there is no deduplication.
concurrency: >-
  Concurrent sends read history before calling the model and append afterward in completion order. The chat
  blocks another local send while pending.
hops:
  - 'n': 1
    actor_or_service: Jazz AI chat (page or panel)
    action: 'Trim the question, create a conversation when needed and show pending input.'
    anchor: 'react-console:components/console/agent-chat.tsx:AgentChat'
    seam: sync
    on_failure: Restore input and show a toast if creation fails.
    left_inconsistent: A newly created empty conversation can survive a later reply failure.
    observer: 'Chat response, outcome toast and console-server error log.'
    provenance: observed
    source: 'react-console:lib/agent/client.ts:replyTo'
  - 'n': 2
    actor_or_service: Console conversation route
    action: 'Find sample-owner history, validate the message and reject general replies for scoped work.'
    anchor: 'react-console:app/api/agent/conversations/[id]/messages/route.ts:POST'
    seam: sync
    on_failure: 'Return not-found, invalid-message or scoped-work refusal without appending.'
    left_inconsistent: Conversation history remains unchanged.
    observer: 'Chat response, outcome toast and console-server error log.'
    provenance: observed
    source: 'react-console:lib/agent/schemas.ts:messagesInput'
  - 'n': 3
    actor_or_service: Console conversation route and model gateway
    action: 'Ask the gateway for a text reply using project context, the last thirty messages and the new question.'
    anchor: 'react-console:app/api/agent/conversations/[id]/messages/route.ts:systemPrompt'
    seam: sync
    on_failure: Log model failure and return a temporary error without storing the exchange.
    left_inconsistent: Provider cost is outside Platform accounting.
    observer: 'Chat response, outcome toast and console-server error log.'
    provenance: observed
    source: 'react-console:app/api/agent/conversations/[id]/messages/route.ts:MODEL'
  - 'n': 4
    actor_or_service: Console conversation store
    action: 'Append the question and trimmed reply, or the fixed empty-answer fallback, and derive a default title.'
    anchor: 'react-console:lib/agent/store.ts:appendMessages'
    seam: sync
    on_failure: Deletion during generation can produce success with no conversation.
    left_inconsistent: History exists only in process memory and disappears on restart.
    observer: 'Chat response, outcome toast and console-server error log.'
    provenance: observed
    source: 'react-console:lib/agent/store.ts:appendMessages'
  - 'n': 5
    actor_or_service: Jazz AI chat
    action: Refresh conversation views after the route returns.
    anchor: 'react-console:lib/agent/client.ts:refreshAgent'
    seam: sync
    on_failure: Restore the composer text and show the error for a failed send.
    left_inconsistent: A repeated send after an ambiguous response can append another exchange.
    observer: 'Chat response, outcome toast and console-server error log.'
    provenance: observed
    source: 'react-console:components/console/agent-chat.tsx:AgentChat'
branches:
  - Scoped conversations reject general replies before model invocation.
waits:
  - The route supplies no explicit timeout or retry override to the model SDK.
evidence:
  - >-
    react-console at baf6dae: app/api/agent/conversations/[id]/messages/route.ts; lib/agent/store.ts,
    client.ts, schemas.ts, tenant.ts; components/console/agent-chat.tsx; package.json (the AI SDK dependency).
controls: [TC-AI-001, TC-AI-002, TC-AI-003, TC-AI-004, TC-AI-006, TC-AI-007, TC-AVL-001, TC-AVL-004, TC-AVL-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-006, TC-CRY-001, TC-CRY-002, TC-CRY-003, TC-CRY-004, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---

# Answer a general Jazz AI question

## What It Does

The prototype asks the console gateway directly and keeps the exchange in server memory. Project descriptions guide replies without supplying live business data.

## The Flow

```mermaid
flowchart TD
  H1["Trim the question, create a conversation when needed and show pending input."]
  H2["Find sample-owner history, validate the message and reject general replies for scoped work."]
  H1 --> H2
  H3["Ask the gateway for a text reply using project context, the last thirty messages and the new question."]
  H2 --> H3
  H4["Append the question and trimmed reply, or the fixed empty-answer fallback, and derive a default title."]
  H3 --> H4
  H5["Refresh conversation views after the route returns."]
  H4 --> H5
```

Create history when necessary, validate the question, call the model with recent messages and append the resulting exchange.

## When Something Fails

Model failure stores no exchange and restores input. Direct calls have no Platform allowance, evidence or cost record. Concurrent deletion or ambiguous responses can lose or duplicate the exchange.

## Open Design Questions

Product must choose durable conversation ownership and the boundary required before customer use.
