insigz docs
Product Spec

Agents & the Analyst Chat

The grounded, cited analyst chat available on every screen, its in-chat action widgets and journey rail, plus the specialised agent roster that drafts but never publishes.

The analyst chat (analyst-chat.jsx + app-chat-host.jsx)

The everyday interface — a ChatGPT/Claude-style assistant available on every authenticated screen via a floating bubble (bottom-right) or ⌘. / Ctrl+.. The host (app-chat-host.jsx) manages presentation: a right-pinned resizable panel on desktop (drag the left edge, 320–720px, persisted), a bottom-sheet on mobile (drag handle, 28–95vh), and a fullscreen mode (, ESC exits). Open/closed/fullscreen/width all persist in localStorage. The panel publishes a --chat-pad-right CSS var so map overlays (and the onboarding wizard) shift left instead of being overlapped.

Context-awareness

Every route change dispatches insigz:chat-context, updating the seed system message and composer placeholder (e.g. on a case: "Case context loaded: CASE-014. Ask about events, entities, hypothesis…"). Only the seed updates; user conversations carry across navigation. Per-route defaultOpen decides whether the panel opens on first landing (open on workspace/cases/sources/sessions/reports/entities; closed on workshop/AAR/team-view/settings; closed + gated on /sources/onboard).

Grounding & trustworthiness

  • Grounded — answers only from a fixed 30-entry observation set (MOCK_OBSERVATIONS); the prompt forces inline [OBS-####] citations and a literal "I don't have observations covering that." refusal when unsupported (rendered italic/muted).
  • Tool-use transparency — every reply opens with the queries it ran (↪ tool: query_observations(…)).
  • Citations — inline [OBS-####] chips open a provenance drawer: full observation body, source, entity, timestamp, lat/lon, and a provenance block (signed · ingestor · confidence).
  • Show on map⟢ SHOW ON MAP in the drawer flies the workspace map to the observation; cross-route safe (navigates to /workspace first if needed).
  • Real Claude — replies stream via window.claude.complete with a simulated token reveal; API errors render a graceful error bubble (not a crash).

Prompt library (app-chat-prompts.jsx)

A searchable launcher opened via the header ⌗ PROMPTS button; empty chats also show quick-pick chips. Its category chips are the six journey steps (All / Set up / Upload / Ask / Cases & Reports / Watchers / Wargame — see §16). CHAT_PROMPTS carries the step prompts plus grounded questions. Two kinds of prompt:

  • Widget prompts — produce a deterministic agent reply + an inline action widget (one of three kinds, below).
  • Grounded prompts — go through the normal Claude flow with citations.

In-chat action widgets (ChatActionWidget) — the chat-first command surface

The chat is the command surface: the user does almost everything by prompting, and a reply returns a widget that completes the task in place (full detail in §16). Three widget kinds, each carrying an always-present “open the full view →” escape hatch (openFull):

  • launch — the only widget that leaves the chat: a canvas pop-out (onCanvas(target, focus) → map / graph / timeline / arena) or a deep-link (onNavigate). E.g. an answer's Show on map / Show on graph.
  • form — prefilled, editable fields that commit through the real store via onCommit(method, payload)createProject, addCase, addReport, saveWatch — then show a ✓ success line. Same write path as the Door-2 surfaces, so chat and back office never diverge.
  • decision — a doctrine gate (Q8/Q9/Q10) as buttons: Accept / Modify / Explain / Show Logic — the Proposal-Inbox actions (§13) reused verbatim. Accept/Modify commit via onCommit (e.g. decideProposal); Explain expands the rationale; Show Logic reveals the cited [OBS-####] chips.

Legacy single deep-link widgets are normalised into a launch widget so nothing older breaks.

The journey rail (JourneyRail)

A slim six-step strip in the chat panel header — Set up · Upload · Ask · Cases · Watch · Wargame — that reflects the active project's state (✓ where the project already has it) and, on click, drops the matching prompt into the chat. The seed seam is insigz:chat-seed-prompt { text }, so any surface can drive the chat. See §16 for the full experience architecture.

Chat projects & history

The ≡ HISTORY drawer organizes conversations like Claude/ChatGPT:

  • PROJECTS — creatable named folders (+ NEW), filter chats by project; the active folder filters the chat list and files new chats into it.
  • CHATS — saved conversations (persisted to localStorage), resumable on click, each tagged with its project. + NEW starts a fresh chat.

The agent roster

insigz's intelligence layer is built around specialised agents — none publish autonomously; every output shows reasoning, cites source observations, and waits for a human (the binding constraint, doctrine Q8).

AgentRoleSurface
Analyst chatAnswer questions across the canonical model, grounded + citedeverywhere (this file)
Ontology AgentOnboard a new source — profile, connector, mapping, ontology-fit, dry-run; human commits (Q9)/sources/onboard — see 06
AdjudicatorDraft 2–3 consequence variants from a cell's action, with historical analogs + confidencewargame — see 07
Inject GeneratorScan the live data layer for salient events; surface as candidate injectswargame — see 07
After-Action analystDraft the full AAR (timeline, decisions, base-rates, prompts); faculty signs/aar-drafting — see 07

All share the same principle: the agent removes the labour, the human keeps the judgement — consequences queue for approval, schema changes need a Steward, AAR export is gated until human-approved, and review-band merges go to a human queue.