Edit

Views

When Atlas has numbers, a list, a plan or a quiz to show, it doesn't only write prose: it returns a view, a small JSON document of typed components that LearnHouse draws as tables, charts, timelines, flashcards and so on. The Agent API hands you the same views, validated on the server, so you can draw them with your own components.

Views are sent in the views output mode (the default for agents that support them) as view events, and kept in each message's views. In markdown mode you get each view's Markdown fallback in the text instead.

The view envelope

{
  "id": "view_…",
  "call_id": "call_1",
  "schema_version": 1,
  "title": "Course completion",
  "layout": "stack",
  "components": [
    { "type": "kpis", "items": [{ "label": "Learners", "value": 1240, "delta": 4.5 }] },
    {
      "type": "table",
      "columns": [{ "key": "name", "label": "Course" }, { "key": "rate", "label": "Completion", "format": "percent" }],
      "rows": [{ "name": "Python 101", "rate": 62, "_link": { "kind": "course", "uuid": "course_x" } }]
    }
  ],
  "fallback_markdown": "- **Learners**: 1240 (+4.5%)\n\n| Course | Completion |\n| --- | --- |\n| Python 101 | 62% |"
}
Field
idstring
call_idstring or nullThe tool call that produced it, when there is one
schema_versionnumberVersion of the component schemas (currently 1)
titlestring or nullHeading over the whole view
layoutstack or gridgrid puts small components side by side on wide screens
componentsComponent[]1 to 12 components, each with a type
fallback_markdownstringThe same data as Markdown

A view is at most 64 KB of JSON. Tables and charts hold up to 200 rows; most other lists are capped lower (see each type below).

Rendering views

  • Switch on type and draw each component with your own UI.
  • For a type you don't support (or don't support yet), render fallback_markdown for the whole view, or the component's own text. Never fail on an unknown type: new types can be added in a later schema_version.
  • Components are validated and cleaned on the server: strings are length-limited and control characters removed, enums are normalized, links are checked. Still treat every string as text, not HTML.
  • <AgentChat /> in @learnhouse/react (and the Vue wrapper) has built-in renderers for the common types (kpis, table, chart, cards, timeline, steps, callout, text, checklist, progress, comparison, code, quiz, choices, glossary) and shows fallback_markdown for the rest. Override any type with your own component through renderers.

Items that point somewhere carry a link:

{ "kind": "course", "uuid": "course_x" }
{ "path": "/dash/courses" }

kind is one of course, chapter, activity, user, member, path, community, discussion, board, assignment, submission, usergroup, live_session, podcast, playground, play, folder, scheduled_agent, offer. Map kind + uuid to a page in your app. path is a relative path on the LearnHouse site. Table rows use a _link cell with the same shape.

Fields the server fills in

Some fields come from LearnHouse, not from the model, and are only there for display: image (a cover or avatar URL on gallery, cards, leaderboard and profile items), doc, course_uuid and truncated on page (the lesson content as LearnHouse editor JSON, read from the real activity), scale on gantt and calendar_start on heatmap.

Practice components

quiz, flashcards, matching, ordering, fill_blanks and whatif are interactive. The answers are in the props (correct, the order of ordering.items, the [[answers]] in fill_blanks.text): shuffle and hide them in your UI, and check answers in the browser. Nothing is sent back to LearnHouse.

choices holds next-step buttons: when one is clicked, send its prompt as the next user message.

The schema endpoint

GET /api/v1/agent/views/schema returns the exact JSON Schema of a view and of every component. Use it to generate types or to validate views in your tests.

{
  "version": "2026-11-16",
  "schema_version": 1,
  "view_schema": { "...": "JSON Schema of the view envelope" },
  "components": {
    "kpis": {
      "group": "data",
      "description": "1-8 headline numbers with optional % change.",
      "json_schema": { "...": "JSON Schema of the component" },
      "example": { "type": "kpis", "items": [{ "label": "Learners", "value": 1240, "delta": 4.5 }] }
    }
  },
  "types": ["kpis", "table", "chart", "..."]
}

The tables below are generated from the same models. Types are written TypeScript-style: field? is optional, a|b is one of the values, str, num, int and bool are JSON types.

Component catalog

The 42 types, in four groups:

  • Data: kpis, table, chart, funnel, heatmap, cohort, radar, gauge, leaderboard, sparklines, geo, matrix, progress, comparison
  • Structure: timeline, steps, flow, tree, mindmap, gantt, kanban, checklist, outline
  • Content: page, diff, math, code, email, profile, rubric, glossary, gallery, cards, callout, text
  • Practice: quiz, flashcards, matching, ordering, fill_blanks, whatif, choices

Every component except text also takes an optional title, a heading over that component.

Data

kpis

1-8 headline numbers with optional % change.

PropTypeRequiredNotes
type"kpis"yes
titlestrno
items{label: str, value: num | int | str, unit?: str, delta?: num, hint?: str, tone?: neutral|info|success|warning|danger|accent}[]yes1 to 8 items
{"type": "kpis", "items": [{"label": "Learners", "value": 1240, "delta": 4.5}]}

table

Rows to scan, sort or export; link rows with _link {kind, uuid}.

PropTypeRequiredNotes
type"table"yes
titlestrno
columns{key: str, label: str, format?: text|number|percent|duration|date|currency, unit?: str}[]yes1 to 10 items
rows{key: value}[]yesCells by column key; optional _link {kind, uuid} makes the row open that item; up to 200 items
captionstrno
{
  "type": "table",
  "columns": [
    {"key": "name", "label": "Course"},
    {"key": "rate", "label": "Completion", "format": "percent"}
  ],
  "rows": [{"name": "Python 101", "rate": 62, "_link": {"kind": "course", "uuid": "course_x"}}]
}

chart

Trends over time (line/area), comparisons (bar), shares (pie/donut).

PropTypeRequiredNotes
type"chart"yes
titlestrno
kindbar|line|area|pie|donut|funnelyes
x_keystryesmin length 1
series{key: str, label: str}[]yes1 to 6 items
data{key: value}[]yes1 to 200 items
unitstrno
stackedboolnodefault false
{
  "type": "chart",
  "kind": "line",
  "x_key": "day",
  "series": [{"key": "active", "label": "Active"}],
  "data": [{"day": "2026-11-01", "active": 12}, {"day": "2026-11-02", "active": 18}]
}

comparison

2-4 options side by side (plans, approaches).

PropTypeRequiredNotes
type"comparison"yes
titlestrno
columns{title: str, subtitle?: str, badge?: str, highlight?: bool, items?: str[]}[]yes2 to 4 items
{
  "type": "comparison",
  "columns": [
    {"title": "Drip", "items": ["Paced"]},
    {"title": "Open", "items": ["All at once"]}
  ]
}

progress

Bars toward a goal per item.

PropTypeRequiredNotes
type"progress"yes
titlestrno
items{label: str, value: num, max?: num, unit?: str, tone?: neutral|info|success|warning|danger|accent, link?: {kind?: str, uuid?: str, path?: str}}[]yes1 to 40 items
{"type": "progress", "items": [{"label": "Chapters written", "value": 3, "max": 4}]}

heatmap

When things happen: weekday x hour activity, or a calendar from days[{date,value}].

PropTypeRequiredNotes
type"heatmap"yes
titlestrno
x_labelsstr[]yes1 to 53 items
y_labelsstr[]yes1 to 31 items
valuesnum[][]yesOne row per y label, one value per x label; 1 to 31 items
unitstrno
toneneutral|info|success|warning|danger|accentnodefault "accent"
y_weekdaysboolnoy labels are ISO weekdays 1-7 (Mon-Sun); the client shows localized names; default false
calendar_startstrnoSet by the server for a calendar: the Monday of the first week; max 10 chars
captionstrno
{
  "type": "heatmap",
  "x_labels": ["9", "12", "18"],
  "y_labels": ["1", "2"],
  "y_weekdays": true,
  "values": [[3, 8, 12], [1, 5, 9]]
}

funnel

Drop-off between ordered stages (visited, enrolled, completed); shows the share kept and lost.

PropTypeRequiredNotes
type"funnel"yes
titlestrno
stages{label: str, value: num, detail?: str}[]yes2 to 10 items
unitstrno
{
  "type": "funnel",
  "stages": [
    {"label": "Viewed", "value": 1200},
    {"label": "Enrolled", "value": 310},
    {"label": "Completed", "value": 96}
  ]
}

cohort

Retention by signup group: % still active per period since joining.

PropTypeRequiredNotes
type"cohort"yes
titlestrno
periodsstr[]yes1 to 16 items
rows{label: str, size?: int, values?: num[]}[]yes1 to 30 items
captionstrno
{
  "type": "cohort",
  "periods": ["Week 1", "Week 2", "Week 4"],
  "rows": [{"label": "Oct 6", "size": 40, "values": [65, 48, 30]}]
}

radar

Strengths across 3-12 dimensions (skills, rubric areas); up to 4 overlaid series.

PropTypeRequiredNotes
type"radar"yes
titlestrno
axesstr[]yes3 to 12 items
series{label: str, values: num[]}[]yes1 to 4 items
maxnumno
unitstrno
{
  "type": "radar",
  "axes": ["Syntax", "Testing", "Debugging"],
  "series": [{"label": "Ana", "values": [80, 55, 70]}],
  "max": 100
}

gauge

One score against a range or target (compliance rate, average grade, audit score).

PropTypeRequiredNotes
type"gauge"yes
titlestrno
labelstrno
valuenumyes
minnumnodefault 0
maxnumnodefault 100
unitstrno
targetnumno
bands{to: num, tone?: neutral|info|success|warning|danger|accent}[]noup to 5 items
detailstrno
{
  "type": "gauge",
  "label": "Training compliance",
  "value": 82,
  "max": 100,
  "unit": "%",
  "target": 90,
  "bands": [
    {"to": 60, "tone": "danger"},
    {"to": 85, "tone": "warning"},
    {"to": 100, "tone": "success"}
  ]
}

leaderboard

A ranking, best first (top learners, most viewed courses); link members to show avatars.

PropTypeRequiredNotes
type"leaderboard"yes
titlestrno
entries{name: str, value: num, detail?: str, delta?: int, link?: {kind?: str, uuid?: str, path?: str}}[]yes1 to 50 items
value_labelstrno
formattext|number|percent|duration|date|currencynodefault "number"
unitstrno

Items also carry image, filled in by the server (a picture URL to show), not by the model.

{
  "type": "leaderboard",
  "value_label": "Completions",
  "entries": [
    {"name": "Ana Silva", "value": 42, "link": {"kind": "user", "uuid": "user_x"}},
    {"name": "Li Wei", "value": 37}
  ]
}

sparklines

Several metrics, each with its value and a small trend line.

PropTypeRequiredNotes
type"sparklines"yes
titlestrno
items{label: str, value: num | int | str, unit?: str, points: num[], delta?: num, better?: up|down, link?: {kind?: str, uuid?: str, path?: str}}[]yes1 to 12 items
{
  "type": "sparklines",
  "items": [
    {"label": "Daily active", "value": 182, "points": [120, 140, 135, 182], "delta": 12}
  ]
}

geo

Where people are: countries (ISO 3166 alpha-2) ranked, with flags and shares.

PropTypeRequiredNotes
type"geo"yes
titlestrno
items{country?: str, label?: str, value: num}[]yes1 to 60 items
unitstrno
value_labelstrno
{
  "type": "geo",
  "value_label": "Visits",
  "items": [{"country": "FR", "value": 420}, {"country": "US", "value": 310}]
}

matrix

Prioritize on two axes (impact vs effort); x and y from 0 (low) to 1 (high).

PropTypeRequiredNotes
type"matrix"yes
titlestrno
x_labelstryesmin length 1
y_labelstryesmin length 1
x_lowstrno
x_highstrno
y_lowstrno
y_highstrno
quadrantsstr[]noNames: top-left, top-right, bottom-left, bottom-right; up to 4 items
items{label: str, x: num, y: num, tone?: neutral|info|success|warning|danger|accent, detail?: str}[]yes1 to 30 items
{
  "type": "matrix",
  "x_label": "Effort",
  "y_label": "Impact",
  "quadrants": ["Quick wins", "Big bets", "Fill-ins", "Money pits"],
  "items": [{"label": "Add captions", "x": 0.2, "y": 0.8}]
}

Structure

timeline

Dated events in order.

PropTypeRequiredNotes
type"timeline"yes
titlestrno
items{time: str, title: str, detail?: str, tone?: neutral|info|success|warning|danger|accent}[]yes1 to 40 items
{"type": "timeline", "items": [{"time": "Mon 9:00", "title": "Kickoff"}]}

steps

How a process works, or progress through steps (status done/current/upcoming).

PropTypeRequiredNotes
type"steps"yes
titlestrno
items{title: str, detail?: str, status?: done|current|upcoming|failed|skipped}[]yes1 to 16 items
{
  "type": "steps",
  "items": [{"title": "Enroll"}, {"title": "Unlock chapter 2", "detail": "7 days later"}]
}

checklist

Done / to-do items.

PropTypeRequiredNotes
type"checklist"yes
titlestrno
items{label: str, checked?: bool, detail?: str}[]yes1 to 40 items
{
  "type": "checklist",
  "items": [{"label": "Cover image", "checked": true}, {"label": "SEO description"}]
}

kanban

Items by status column.

PropTypeRequiredNotes
type"kanban"yes
titlestrno
columns{title: str, tone?: neutral|info|success|warning|danger|accent, cards?: {title: str, detail?: str, badge?: str, tone?: neutral|info|success|warning|danger|accent, link?: {kind?: str, uuid?: str, path?: str}}[]}[]yes1 to 6 items
{"type": "kanban", "columns": [{"title": "To review", "cards": [{"title": "Essay 3"}]}]}

flow

A process with branches or loops (decision shapes).

PropTypeRequiredNotes
type"flow"yes
titlestrno
directiondown|rightnodefault "down"
nodes{id: str, label: str, detail?: str, tone?: neutral|info|success|warning|danger|accent, shape?: box|decision|start|end}[]yes1 to 24 items
edges{from: str, to: str, label?: str}[]noup to 40 items
{
  "type": "flow",
  "nodes": [
    {"id": "a", "label": "Submit", "shape": "start"},
    {"id": "b", "label": "Passed?", "shape": "decision"}
  ],
  "edges": [{"from": "a", "to": "b"}]
}

outline

A course plan (chapters and activities) before creating it.

PropTypeRequiredNotes
type"outline"yes
titlestrno
descriptionstrno
chapters{name: str, detail?: str, activities?: {name: str, type?: str, detail?: str}[]}[]yes1 to 20 items
link{kind?: str, uuid?: str, path?: str}no
{
  "type": "outline",
  "chapters": [{"name": "Basics", "activities": [{"name": "Intro", "type": "page"}]}]
}

tree

A hierarchy: course > chapters > lessons, a topic breakdown, an org chart.

PropTypeRequiredNotes
type"tree"yes
titlestrno
nodes{label: str, detail?: str, badge?: str, tone?: neutral|info|success|warning|danger|accent, link?: {kind?: str, uuid?: str, path?: str}, children?: tree…[]}[]yesTop-level nodes, each with nested children; 1 to 20 items
{
  "type": "tree",
  "nodes": [
    {
      "label": "Python 101",
      "children": [{"label": "Basics", "children": [{"label": "Variables", "badge": "page"}]}]
    }
  ]
}

mindmap

How ideas connect around one central concept (learner explanations, brainstorming).

PropTypeRequiredNotes
type"mindmap"yes
titlestrno
centerstryesmin length 1
branches{label: str, tone?: neutral|info|success|warning|danger|accent, children?: str[]}[]yes1 to 8 items
{
  "type": "mindmap",
  "center": "Photosynthesis",
  "branches": [
    {"label": "Inputs", "children": ["Light", "Water", "CO2"]},
    {"label": "Outputs", "children": ["Glucose", "Oxygen"]}
  ]
}

gantt

Schedules and roadmaps: bars on a time axis (dates, or numbers with a unit such as week).

PropTypeRequiredNotes
type"gantt"yes
titlestrno
tasks{label: str, start: num | str, end?: num | str, group?: str, tone?: neutral|info|success|warning|danger|accent, progress?: num, detail?: str}[]yes1 to 40 items
unitstrnoFor number scales: what one step is (week, day, session)
scaledate|numbernoSet by the server from the task values; default "date"
{
  "type": "gantt",
  "unit": "week",
  "tasks": [{"label": "Write chapters", "start": 1, "end": 4}, {"label": "Launch", "start": 5}]
}

Content

page

A lesson rendered read-only: activity_uuid for a real page, or markdown for a draft.

PropTypeRequiredNotes
type"page"yes
titlestrno
activity_uuidstrnomax 120 chars
markdownstrno
course_uuidstrnoFilled in by the server.
doc{key: value}noFilled in by the server.
truncatedboolnoFilled in by the server.
{"type": "page", "markdown": "# Draft lesson\n\nText"}

diff

Before/after of a change.

PropTypeRequiredNotes
type"diff"yes
titlestrno
beforestrno
afterstrno
fields{field: str, before?: str, after?: str}[]noup to 30 items
{"type": "diff", "before": "Old title", "after": "New title"}

Course covers or member avatars by uuid (the server fills the pictures).

PropTypeRequiredNotes
type"gallery"yes
titlestrno
images{kind: course|user, uuid: str, caption?: str}[]yes1 to 40 items

Items also carry image, filled in by the server (a picture URL to show), not by the model.

{"type": "gallery", "images": [{"kind": "course", "uuid": "course_x"}]}

callout

One key caveat or tip (tone info/success/warning/danger/accent).

PropTypeRequiredNotes
type"callout"yes
toneneutral|info|success|warning|danger|accentnodefault "info"
titlestrno
textstryes
{"type": "callout", "tone": "warning", "text": "Learners already enrolled keep their access."}

cards

Items (courses, members, paths) as linked cards.

PropTypeRequiredNotes
type"cards"yes
titlestrno
items{kind: str, uuid?: str, name: str, subtitle?: str, badges?: str[]}[]yes1 to 24 items

Items also carry image, filled in by the server (a picture URL to show), not by the model.

{"type": "cards", "items": [{"kind": "course", "uuid": "course_x", "name": "Python 101"}]}

text

A short Markdown paragraph between components.

PropTypeRequiredNotes
type"text"yes
markdownstryesmin length 1
{"type": "text", "markdown": "Some **context**."}

math

Formulas in LaTeX, typeset, with optional captions.

PropTypeRequiredNotes
type"math"yes
titlestrno
blocks{latex: str, caption?: str}[]yes1 to 12 items
{"type": "math", "blocks": [{"latex": "E = mc^2", "caption": "Mass-energy equivalence"}]}

code

A code sample with highlighting and, optionally, its output.

PropTypeRequiredNotes
type"code"yes
titlestrno
languagestrno
filenamestrno
codestryesmin length 1
outputstrno
output_toneneutral|success|dangernodefault "neutral"
highlightint[]no1-based line numbers to emphasize; up to 50 items
{"type": "code", "language": "python", "code": "print(2 + 2)", "output": "4"}

email

A drafted email or announcement as the reader will see it (before sending).

PropTypeRequiredNotes
type"email"yes
titlestrno
subjectstryesmin length 1
from_namestrno
tostrnoWho receives it, in words (e.g. 'Learners of Python 101')
preheaderstrno
bodystryesMarkdown; min length 1
cta_labelstrno
cta_pathstrno
{
  "type": "email",
  "subject": "Week 2 is open",
  "to": "Learners of Python 101",
  "body": "Hi,\n\nChapter 2 is now available.",
  "cta_label": "Continue"
}

profile

One learner or member at a glance: stats, badges, course progress.

PropTypeRequiredNotes
type"profile"yes
titlestrno
namestryesmin length 1
user_uuidstrnomax 120 chars
subtitlestrno
badgesstr[]noup to 6 items
stats{label: str, value: num | int | str, unit?: str}[]noup to 8 items
courses{name: str, progress?: num, link?: {kind?: str, uuid?: str, path?: str}}[]noup to 10 items
notestrno
imagestrnoFilled in by the server.
{
  "type": "profile",
  "name": "Ana Silva",
  "user_uuid": "user_x",
  "subtitle": "Learner",
  "stats": [{"label": "Courses", "value": 3}],
  "courses": [{"name": "Python 101", "progress": 64}]
}

rubric

Grading criteria by performance level, with points.

PropTypeRequiredNotes
type"rubric"yes
titlestrno
levels{label: str, points?: num}[]yes2 to 6 items
criteria{label: str, weight?: num, descriptions?: str[]}[]yes1 to 12 items
{
  "type": "rubric",
  "levels": [{"label": "Excellent", "points": 4}, {"label": "Needs work", "points": 1}],
  "criteria": [
    {"label": "Clarity", "descriptions": ["Clear and well organized", "Hard to follow"]}
  ]
}

glossary

Key terms and definitions.

PropTypeRequiredNotes
type"glossary"yes
titlestrno
terms{term: str, definition: str, example?: str}[]yes1 to 60 items
{
  "type": "glossary",
  "terms": [{"term": "Latency", "definition": "The delay before data starts to move."}]
}

Practice

quiz

Multiple-choice questions to try in the chat.

PropTypeRequiredNotes
type"quiz"yes
titlestrno
questions{text: str, options: {text: str, correct?: bool}[], explanation?: str}[]yes1 to 20 items
{
  "type": "quiz",
  "questions": [{"text": "2 + 2?", "options": [{"text": "4", "correct": true}, {"text": "5"}]}]
}

flashcards

Cards to flip (term / answer).

PropTypeRequiredNotes
type"flashcards"yes
titlestrno
cards{front: str, back: str}[]yes1 to 40 items
{"type": "flashcards", "cards": [{"front": "TTL", "back": "Time to live"}]}

choices

Next-step buttons; each sends its prompt as the member's next message.

PropTypeRequiredNotes
type"choices"yes
titlestrno
options{label: str, prompt: str}[]yes1 to 6 items
{
  "type": "choices",
  "options": [{"label": "Apply to all", "prompt": "Apply it to every course"}]
}

matching

Match pairs (term to definition); the right side is shuffled for the learner.

PropTypeRequiredNotes
type"matching"yes
titlestrno
instructionstrno
pairs{left: str, right: str}[]yes2 to 10 items
{
  "type": "matching",
  "pairs": [{"left": "H2O", "right": "Water"}, {"left": "NaCl", "right": "Salt"}]
}

ordering

Put items in order; give them in the CORRECT order (shuffled for the learner).

PropTypeRequiredNotes
type"ordering"yes
titlestrno
instructionstrno
itemsstr[]yes2 to 10 items
{"type": "ordering", "instruction": "Order the steps", "items": ["Plan", "Write", "Review"]}

fill_blanks

A text with gaps: mark each answer as [[answer]] (alternatives [[colour|color]]).

PropTypeRequiredNotes
type"fill_blanks"yes
titlestrno
instructionstrno
textstryesmin length 1
bankboolnoShow the answers as a shuffled word bank; default false
{"type": "fill_blanks", "text": "Water boils at [[100]] degrees [[Celsius|C]].", "bank": true}

whatif

Sliders and live results from formulas (pricing, pacing, scores). Formulas: numbers, variable keys, + - * / % ^, min max round abs sqrt floor ceil.

PropTypeRequiredNotes
type"whatif"yes
titlestrno
variables{key: str, label: str, min: num, max: num, step?: num, value?: num, unit?: str}[]yes1 to 6 items
outputs{label: str, formula: str, unit?: str, format?: text|number|percent|duration|date|currency}[]yes1 to 4 items
notestrno
{
  "type": "whatif",
  "variables": [
    {"key": "price", "label": "Price", "min": 10, "max": 200, "value": 49, "unit": "USD"},
    {"key": "buyers", "label": "Buyers", "min": 0, "max": 500, "value": 120}
  ],
  "outputs": [
    {"label": "Revenue", "formula": "price * buyers", "format": "currency", "unit": "USD"}
  ]
}