Visual builderStructured outputs

Artifact Components

Copy page

Artifact components are used to add artifacts to the Agent.

Artifacts are structured components that capture and store source information when agents interact with tools or other agents. They act as a record-keeping system, automatically documenting where information comes from during tool and agent interactions.

How Artifacts Work

When an agent uses a tool (whether that's another agent or a utility tool), the response is automatically parsed to create artifacts. These artifacts store:

  • The source of the information (tool/agent used)
  • The relevant content from the response
  • Metadata about the interaction

Quick Start: Citation artifacts are automatically included when you create a new project with npx @inkeep/create-agents. You'll find the complete implementation in artifact-components/citation.ts in your project. They provide a ready-to-use example for source attribution (for example, when citing webpages) and are automatically rendered by the Inkeep widget with professional styling and interactions.

How to create an artifact component

  1. Go to the Artifact Components tab in the left sidebar. Then select "New artifact component".
  2. Add in an id, name, and description. These are required fields.
  3. For the props schema, you can either:
    • Enter a JSON schema with inPreview: true properties to define specific fields that will be immediately available
    • Leave empty to save the entire tool result without filtering
  4. Click "Submit".

To visually add the artifact component to the Agent, see the Sub Agents page for details.

Schema Requirements

Critical: Your artifact schema must match your tool's output structure. The system uses JMESPath selectors on JSON - it cannot extract from free text.

// ❌ WRONG: Tool returns text, schema expects structured data
// Tool output: { "result": { "content": [{ "text": "Weather: Sunny, 75°F" }] } }
{
  "type": "object",
  "properties": {
    "temperature": { "type": "number" }, // ❌ Cannot extract number from text
    "condition": { "type": "string" }     // ❌ Cannot extract condition from text
  }
}

// ✅ CORRECT: Tool returns structured data matching schema
// Tool output: { "result": { "temperature": 75, "condition": "Sunny" } }
{
  "type": "object",
  "properties": {
    "temperature": { "type": "number" },
    "condition": { "type": "string" }
  }
}

Use OpenTelemetry traces to debug schema validation issues.

Preview Fields

Set inPreview: true on properties for immediate availability. These fields are:

  • Shown to other agents for reasoning
  • Streamed in real-time to clients (Vercel AI SDK)
  • Auto-rendered by Inkeep's widget (citations as interactive cards)
  • Available immediately in UI (full artifact loads on-demand)

For more details on how artifact data is streamed via the API, see Data Artifact Events.

Example:

{
  "type": "object",
  "properties": {
    "title": {
      "description": "Title of the source document",
      "type": "string",
      "inPreview": true
    },
    "url": {
      "description": "URL of the source document",
      "type": "string",
      "inPreview": true
    },
    "record_type": {
      "description": "Type of record (documentation, blog, guide, etc.)",
      "type": "string",
      "inPreview": true
    },
    "content": {
      "description": "Array of structured content blocks extracted from the document",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "description": "Type of content (text, image, video, etc.)",
            "type": "string"
          },
          "text": {
            "description": "The actual text content",
            "type": "string"
          }
        },
        "required": ["type", "text"],
        "additionalProperties": false
      }
    }
  },
  "required": ["title", "url", "content", "record_type"],
  "additionalProperties": false
}

Citation artifacts that are named citation and have title and url preview fields are auto-rendered by Inkeep's widget in two ways:

  • Inline footnotes: Numbered references [1], [2], etc. appear inline with the response text
  • Interactive cards: Source cards with title, URL, and content appear below the response for detailed exploration

Important: The artifact must have a name of citation in order to be auto-rendered by Inkeep's widget.

Citation artifact rendered as an interactive card in the Inkeep widget showing source attribution

Artifact Name & Description Generation

Important: Artifact names and descriptions are automatically generated at the agent level using that specific agent's configured summarizer model.

How It Works

When an agent creates an artifact during tool execution or data processing:

  1. Agent Creates Artifact: During tool execution or data processing
  2. Summarizer Analysis: The agent's summarizer model analyzes:
    • The artifact content and structure
    • Recent conversation context
    • The user's original question or request
  3. Name Generation: Creates a concise, descriptive name (max 50 characters)
  4. Description Generation: Provides context about relevance and content (max 150 characters)

Model Settings for Artifacts

Each agent uses its configured summarizer model for artifact generation:

// Agent with custom summarizer for artifact generation
const researchAgent = subAgent({
  id: "research-agent",
  name: "Research Agent",
  prompt:
    "You are a research agent that can generate artifact names and descriptions",
  models: {
    base: { model: "anthropic/claude-sonnet-4-0" },
    summarizer: {
      model: "openai/gpt-4.1-mini", // This model generates artifact names/descriptions
      providerOptions: {
        temperature: 0.2, // Lower temperature for consistent naming
        maxOutputTokens: 512,
      },
    },
  },
});

Inheritance and Fallback

Artifact generation follows the same model inheritance rules:

  • Default: Sub Agent uses the Agent's summarizer model (if configured)
  • Fallback: If no summarizer configured at project/agent level, falls back to Sub Agent's base model
  • Override: Agent can specify its own summarizer model

Best Practices

  • Consistent Models: Use the same summarizer model across related agents for consistent artifact naming
  • Appropriate Models: Choose models good at summarization (GPT-4o-mini, claude-3.5-haiku work well)
  • Temperature Settings: Lower temperatures (0.1-0.3) provide more consistent naming patterns