Brian Hung
Projects
Workflow
Workspace for integrated chats and notes between you and your LLMs.
Storing chats and notes
changes
Note editor
ProseMirror, syncPlugin
Chat thread
appendToChatMutator
Automerge Repo
a root doc lists every note and chat
each one is its own document
IndexedDB
IndexedDBStorageAdapter
Other open tabs
BroadcastChannel
Cloudflare Worker
Durable Object storage
Storage and peers sync both ways. The arrows follow a local change.
The dashed link is optional, switched on by a setting.
Editing a note with the model
messages
a tool call
an edit
the doc, as JSON
mergeBranch
ChatSideBar
useChat, POST /api/doc
streamText
Anthropic, OpenAI, Google
onToolCall
runs tools in the browser
Branch in the editor
repo.clone of the note
The note
untouched until merged
The model edits a clone of the note; its changes merge in only when the user asks.