Skip to main content

Additional features: Artifacts

When to use

Enable Artifacts when you want the agent to produce editable documents inside the chat—perfect for drafts, emails, reports, PRDs, SQL/JSON snippets, and code samples. Artifacts let users and the agent iterate together without leaving the conversation.

What it does

  • The agent can create an artifact as text or code.
  • Users can edit the artifact directly in the chat UI.
  • Users can ask the agent to revise the artifact; the agent will update the same document (not a new message).
  • If no text is selected, a requested edit applies to the whole document.
  • Quick edits are available for text (e.g., increase/decrease reading level, shorten/lengthen).
  • Users can select a span and ask for a specific change to just that section—or ask the agent to explain the selected text.

Enable in the UI

  1. Open your agent → click Edit.
  2. In Additional features, click Add.
  3. Toggle Artifacts ON in the drawer.
  4. Close the drawer; Artifacts will appear under Additional features.

How it works (at runtime)

  1. The agent generates an artifact (text or code) when your prompt or the base instruction asks for a “document,” “draft,” or “code block.”
  2. The artifact appears as an editable document in the chat.
  3. Users can:
    • Type directly in the artifact.
    • Use quick edit actions (reading level / shorten / lengthen).
    • Select text and request a targeted change or explanation.

The agent can be prompted to apply edits; it updates the same artifact, preserving the collaboration loop.

In the agent’s Base instruction

Encourage artifact use for long-form outputs and edits:

“When the user asks for a draft, plan, or code, create or update an Artifact using canvas agent instead of sending plain text. For edits, modify the existing artifact rather than creating a new one.”

Examples for users

  • “Create an artifact titled ‘Onboarding Email’ that welcomes new hires. Friendly, 120–150 words.”
  • Shorten the artifact to under 90 words and make the reading level easier.”
  • “In the ‘Benefits’ section, replace the bullet on health insurance with a concise 2-line summary.” (select that paragraph first)
  • “Explain the selected SQL query in simple terms.”
  • “Convert the artifact to code and output a Python function.”
  • “Keep the structure, but increase the reading level to professional/legal.”

Best practices

  • Name artifacts clearly (“RFP Response v1”, “HR Policy FAQ”, “pricing_table.sql”).
  • Use targeted selections for precise edits; use whole-doc edits for style or scope changes.
  • Combine with Tools when needed (e.g., ask a tool to analyze data and then insert a chart/table into the artifact).
  • Ask the agent to summarize what changed after each revision to keep a clear history in chat.

Troubleshooting

  • No artifact appears? Ensure Artifacts is enabled and your prompt asks for a draft/document/code (the agent may have answered in plain text).
  • Edits applied to the whole doc unintentionally? Make a selection first, then request the change.
  • Agent created a new artifact instead of updating: Ask it to “update the existing artifact titled …” and state the precise change.