Grok Bot is xAI's desktop assistant (distinct from the Grok CLI /
Grok Build coding agent). It is closed source and publishes no transcript
schema; this document is reverse-engineered from observed
agent-transcripts JSONL and agent store DBs on a Grok Bot box
(2026-09-10…11). The authoritative mapping is src/harness/grok_bot.rs.
agent-transcripts/
└── <agent-uuid>/
├── <agent-uuid>.jsonl .......... append-only conversation (txcript reads this)
└── <agent-uuid>.journal-mode ... tiny sidecar (ignored)
sand-subagent-<uuid>/ ............... same shape (subagent transcripts)
agents/<agent-uuid>/
├── store.db ........................ kv + transcript_entries (UI ledger)
└── conversation-blobs.db ........... encrypted conversation blobs
Session id = agent / directory uuid. Roots:
| Path | Env override | Role |
|---|---|---|
$HOME/agent-data/agent-transcripts |
TXCRIPT_GROK_BOT_ROOT / GROK_BOT_TRANSCRIPTS |
JSONL codec (preferred read/write) |
$HOME/agent-data/agents |
TXCRIPT_GROK_BOT_AGENTS |
profile.json + store.db UI ledger |
Discovery unions:
- Every
agents/<uuid>/that hasprofile.json(title = profilename). - Every
agent-transcripts/<id>/with<id>.jsonlwhose first record is arole/messageenvelope (user/assistant/tool) — includingsand-subagent-*dirs that have no profile. Journal-mode sidecars are ignored. Unreadable dirs are skipped.
When both sources exist for the same id, the profile name wins as the list
title; the transcripts path is preferred as the locator (safe JSONL delete).
Load cascade (first hit wins):
agent-transcripts/<id>/<id>.jsonl— full codec fidelity.- Non-empty
agents/<id>/store.dbtranscript_entries— reconstructed into Common viaui_entries_to_common(text turns only), thenfrom_common. - Local gateway
POST /api/openAgentwith{id}(Bearer fromgateway.json/TXCRIPT_GROK_BOT_GATEWAY+TOKEN) — same UI ledger shape astranscript_entries. Used when the on-disk ledger is empty (common for long-lived temporal bots). - Otherwise a clear error.
Minted bots usually have JSONL + seeded transcript_entries. Live bots such
as Marcus may have profile + empty ledger + no JSONL; conversation content is
only available through openAgent.
There is no session header. Each line is one JSON object:
| Their name | What it is | Maps to |
|---|---|---|
record role: "user" |
user prompt; text often prefixed [t0u]\n |
Message { role: User } (prefix stripped in Common) |
record role: "assistant" |
model text and/or tool_use / thinking blocks |
Message { role: Assistant } |
record role: "tool" |
tool_result blocks |
Message { role: User } with ToolResult |
block text |
plain text | Block::Text |
block tool_use |
{name, input}; toolCallId may live inside input |
Block::ToolUse (id from toolCallId or synthetic UUIDv5) |
block tool_result |
{name, result: {success|failure}} |
Block::ToolResult; paired FIFO by tool name |
Tool name mapping: shell → Bash (timeout → timeout_ms), read →
Read (path → file_path); denormalize is the inverse. Other tools
(send_message, web_search, web_fetch, get_mcp_tools, update_todos,
communicate_update, …) pass through as Tool::Raw. send_message often
duplicates the preceding assistant text — both are kept (no dedupe).
A minimal synthetic session:
{"role":"user","message":{"content":[{"type":"text","text":"[t0u]\nHello"}]}}
{"role":"assistant","message":{"content":[{"type":"text","text":"Hi."}]}}
{"role":"assistant","message":{"content":[{"type":"tool_use","name":"send_message","input":{"text":{"content":"Hi."}}}]}}
{"role":"tool","message":{"content":[{"type":"tool_result","name":"send_message","result":{"success":{"messageId":"t0s0"}}}]}}txcript continue --with grok_bot mints a new box-harness agent on the
live local gateway and seeds UI history. It never launches a CLI resume
(--no-resume is implied for grok_bot).
- Preflight:
~/agent-data/agentsand~/agent-data/agent-transcriptsmust exist and be writable (orTXCRIPT_GROK_BOT_AGENTS/TXCRIPT_GROK_BOT_ROOT/GROK_BOT_TRANSCRIPTS). Missing layout fails cleanly — use--out <dir>for JSONL-only export without a live box. POST /api/createAgentwith{name, description, harness: "box"}(Bearer token from$HOME/agent-data/gateway.json, orTXCRIPT_GROK_BOT_GATEWAY+TXCRIPT_GROK_BOT_TOKEN).- Unlock the new agent's
store.dbby opening another agent. - Write Common text turns into
agents/<id>/store.dbtranscript_entries. - Write agent-transcripts JSONL for the read path.
POST /api/openAgentwith the new id — history appears in the product.
If any step after createAgent fails (for example a SQLite UNIQUE
constraint while seeding transcript_entries), mint best-effort rolls back
with POST /api/deleteAgent {id} so half-created bots are not left in the
sidebar. Delete errors are logged and ignored; the original mint error is
returned. Successful mints do not delete.
Repeatable key=value or a JSON object, merged left-to-right. grok_bot
recognizes:
| Key | Effect |
|---|---|
name |
Agent display name for createAgent (else transcript title / "txcript session") |
description |
Agent description (else a fixed txcript default) |
Unknown keys are ignored (forward-compatible for other harnesses).
txcript continue ./run.json --with grok_bot \
--metadata name='Relay bot' \
--metadata description='Continued from Simple'
txcript continue ./run.json --with grok_bot \
--metadata '{"name":"Relay bot","description":"from Simple","future":true}'- List titles come from
profile.jsonnamewhen the agent exists underagents/; JSONL-only subagents still fall back to the first user text. - Store/gateway reconstruction keeps user/assistant text turns only (widgets, attachments, spend events, and native tool JSONL detail are not recovered from the UI ledger). Prefer JSONL when present.
- Gateway
openAgentis a read fallback and may focus that agent in the UI. - Continue-into needs a live local gateway and SQLite (
opencode/hermesfeature). Without them,local::writeerrors clearly. - No native per-record timestamps, model, usage, or stop reasons.
- Address prefixes are stripped in Common and not regenerated.
- Rich shell bookkeeping keys survive native round trips; through Common they
only persist while the call remains
Tool::Raw. - Thinking blocks are accepted if present; image / artifact blocks have no observed native slots.
- The optional
.journal-modesidecar is ignored and not part of the body.
- Observed sessions under
/home/box/agent-data/agent-transcripts/and/home/box/agent-data/agents/*/store.db(Grok Bot box), 2026-09-10…11. - Gateway mint sequence verified against
duplicateAgent/openAgenton127.0.0.1:1340, 2026-09-11. - Parser:
src/harness/grok_bot.rs.
Last verified: 2026-09-11 (discover all agents + JSONL/store/gateway load).