Skip to content

Add appkit-genie-advanced template#205

Draft
KabeerThockchom wants to merge 1 commit intodatabricks:mainfrom
KabeerThockchom:kabeer/appkit-genie-advanced
Draft

Add appkit-genie-advanced template#205
KabeerThockchom wants to merge 1 commit intodatabricks:mainfrom
KabeerThockchom:kabeer/appkit-genie-advanced

Conversation

@KabeerThockchom
Copy link
Copy Markdown

Summary

Adds appkit-genie-advanced/ — a sibling template to appkit-genie/ that surfaces more of the Genie Conversation API. Sits next to the minimal template (matching the existing agent-openai/agent-openai-advanced and agent-langgraph/agent-langgraph-advanced convention), so the bare <GenieChat alias="default" /> example stays as-is for users who want it.

The motivation: appkit-genie is intentionally tiny (createApp({ plugins: [genie(), server()] }) plus a 10-line page), which is great as a "look how easy AppKit is" example, but it shows a thin slice of what the Genie API can do. The advanced template is for customers who want to ship a richer surface — multi-space, conversation history, feedback, exports — without rewriting it from scratch.

What's new

  • Multi-space picker — a custom AppKit plugin calls WorkspaceClient.genie.getSpace() per configured alias and exposes the list at GET /api/genieAdvanced/spaces. Users see only spaces they have permission for (asUser(req) per request).
  • Conversation history sidebargenie.listConversations. Clicking a row updates ?conversationId=X; AppKit's existing SSE replay endpoint takes over from there.
  • Live progress checklistSUBMITTED → ASKING_AI → EXECUTING_QUERY → COMPLETED. Past steps strike through and blur with a checkmark; current step shows a spinner; future steps render dimmed dots. Driven entirely by the per-message status events AppKit's SSE plugin already emits.
  • Per-message thumbs feedbackgenie.sendMessageFeedback. Stays inline with the assistant message.
  • Client-side CSV export — direct from GenieStatementResponse. No extra backend call.
  • Markdown rendering for space description — uses marked (already a transitive dep via AppKit-UI; promoted to a direct dep here). Bold, inline code, bullets, headings all render in the sidebar.

Plug-and-play config

Customer points at any space they have access to:

DATABRICKS_HOST=https://your-workspace.cloud.databricks.com
DATABRICKS_GENIE_SPACE_ID=01abc...

# OR multiple spaces — the picker shows all of them:
# GENIE_SPACES=sales=01ABC...,support=01DEF...

Then npm install && npm run dev.

Architecture

Custom plugin under server/plugins/genie-advanced.ts adds:

Method Path Genie SDK
GET /api/genieAdvanced/spaces getSpace() per alias
GET /api/genieAdvanced/spaces/:alias/conversations listConversations
GET /api/genieAdvanced/spaces/:alias/conversations/:cid/messages/:mid/attachments/:aid/result getMessageAttachmentQueryResult
POST /api/genieAdvanced/spaces/:alias/conversations/:cid/messages/:mid/feedback sendMessageFeedback

The chat itself still uses AppKit's bundled genie() plugin SSE — this template only adds endpoints that aren't currently exposed. No fork of the existing plugin.

Screenshots

[Drag-drop the PNGs from appkit-genie-advanced/.inspect/screenshots/ into the slots below before merging — the directory is gitignored so they don't ship with the template.]

Initial state (/genie-advanced) — space picker populated, conversation history loaded, empty chat ready

02-initial.png

Markdown space description, expandedmarked rendering bold + inline code + bullets

04-about-expanded-markdown.png

History replay — clicking a past conversation, AppKit's SSE replays the full thread

03-history-replay.png

Live progress checklist mid-stream — past steps blurred + struck through with checkmark, current step bold + spinning

07-progress-checklist-mid.png

Completed message — assistant text, SQL Query expandable, data table, <GenieQueryVisualization> chart, thumbs + CSV actions

08-completed-with-chart.png

Thumbs feedback — POST to genie.sendMessageFeedback, button reflects the active rating

09-thumbs-up-clicked.png

Test plan

  • npm run typecheck — clean
  • npm run lint — clean
  • npm run build — clean (server.js + client/dist/)
  • Live-tested against a real Genie space: list spaces, list conversations (22+), click a past conversation → SSE replay, ask a fresh question → progress checklist animates → result renders → thumbs POST returns 204 → CSV downloads with the right filename
  • Maintainer review — happy to slim, rename, or fold in differently

This pull request and its description were written by Isaac.

Extends appkit-genie with a richer UX layer that surfaces more of
the Genie Conversation API. Sits alongside the minimal template
(matching the existing agent-openai/-advanced and
agent-langgraph/-advanced naming convention) so the bare
<GenieChat alias="default" /> example stays as-is.

What it adds beyond appkit-genie:
- Multi-space picker driven by a custom AppKit plugin that calls
  WorkspaceClient.genie.getSpace() per configured alias.
- Conversation history sidebar (genie.listConversations); clicking
  a row routes to ?conversationId=X and triggers AppKit's existing
  SSE replay endpoint.
- Live progress checklist (SUBMITTED -> ASKING_AI -> EXECUTING_QUERY
  -> COMPLETED) rendered from message.status. Past steps strike
  through and blur with a checkmark; current step animates a
  spinner; future steps render dimmed dots.
- Per-message thumbs feedback wired to genie.sendMessageFeedback.
- Client-side CSV export from GenieStatementResponse.
- Markdown rendering for Genie space description (marked) so bold,
  inline code, and bullet points format properly in the sidebar.
- Plug-and-play config: customer sets DATABRICKS_GENIE_SPACE_ID for
  one space, or GENIE_SPACES=alias=id,alias=id for several.

Architecture: a small custom AppKit plugin (server/plugins/genie-advanced.ts)
exposes four endpoints under /api/genieAdvanced/* (listSpaces,
listConversations, attachment query result, feedback). All run via
asUser(req) so end users only see spaces they have permission for.
The chat itself still uses AppKit's bundled genie() plugin SSE.

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant