Skip to main content

Snippets

Snippets allow you to use dynamic values in your prompts that are resolved at runtime. Instead of hardcoding information like user names, company details, or project specifics, you can insert snippets that automatically fill in the right values for each conversation.

What are Snippets?

Snippets are placeholders in your prompts that get replaced with actual values when a conversation starts. They enable personalization and context-aware responses without requiring you to create separate agents for different users or situations.

For example, you might have a snippet for the user's name that lets your agent greet each person personally, or a snippet for the current project that provides relevant context automatically.

Using Snippets

Snippets use the {{$...}} syntax, where the ID is automatically generated by the system. You don't need to type or remember these IDs—just select a snippet from the picker and it gets inserted into your prompt.

When you insert a snippet, it appears in your prompt like this:

Hello! I'm your assistant for {{$var_abc123}}.

At runtime, that reference gets replaced with the actual value—perhaps "Acme Corp" or "Project Phoenix" depending on the context.

Snippet Scopes

Snippets exist at three levels, allowing you to set values at different granularities.

User snippets are personal to each individual user. These are ideal for storing preferences like a user's name, preferred language, or personal settings.

Organization snippets are shared across everyone in your organization. Use these for company-wide information like your company name, support email, or standard policies.

Project snippets are specific to a particular project. They're perfect for project names, client information, deadlines, or any context specific to that body of work.

When the same snippet is defined at multiple scopes, the more specific scope wins. Project values override organization values, which in turn override user values. This lets you set sensible defaults at the organization level while allowing projects or users to customize when needed.

Creating Snippets

Organization administrators can create snippet definitions that are available across the organization. Navigate to Organization SettingsSnippets and click Create Snippet. You'll configure a label (the display name), a description explaining what the snippet is for, the input type (text, checkbox, or dropdown), and which scopes can set values for it.

Users can also create custom snippets on the fly while using form inputs. Click the snippet icon (🔗) on any form input, select Create Custom Snippet, choose where to save it (User, Organization, or Project scope), and enter a name and value. This is handy when you realize you're entering the same information repeatedly and want to save it for future use.

Snippet Input Types

Snippets support different input types to match the kind of data they hold. Text snippets accept free-form text input—names, descriptions, or any string value. Checkbox snippets are simple true/false toggles for binary options. Dropdown snippets let users select from a predefined list of options.

Linking Snippets to Form Inputs

Snippets can automatically fill in form inputs, saving users from entering the same information repeatedly. When using an agent form, click the snippet icon (🔗) next to any input field. You'll see a list of compatible snippets filtered by type—text snippets for text fields, checkboxes for checkbox fields, and so on. Select a snippet to auto-fill that field, and the system will remember your preference for future conversations with that agent.