Formats

Pattern

Agent Text Artifact

Template-style text artifact with data-textDelta streaming, ProseMirror Markdown editor, in-memory versions, and quick prompts — no database persistence.

IntermediateApr 2026View the full pattern on desktop
Agent Text Artifact preview

Problems solved

  • Stream Markdown document updates with data-textDelta UI parts
  • Edit artifact text in a ProseMirror Markdown editor
  • Keep document versions in memory without database persistence
  • Update the document from agent tools and quick prompts

Use cases

  • Long-form writing copilots
  • Chat-linked document editors
  • Markdown artifact prototypes
  • Vercel-style text artifact templates

AI SDK APIs

streamTextcreateUIMessageStreamgatewaytool

Tags

aimarkdownprosemirrorstreamingai-sdkartifacts

Requirements

Node.js
24+
Memory
256MB
Other
  • Vercel AI Gateway API key

Environment variables

External services

openaiupstash

Ready to use?

View the full interactive pattern with live preview and copy the source code.

View the pattern on desktop

Related patterns