Skillsets Quickstart
Skillsets are natural-language instructions that enable your agent to interpret user intent and take appropriate actions. By defining a skillset, you can customize your agent’s behavior—from fetching web pages and weather data to generating text and images—while managing token usage and execution complexity.
Overview
-
What Are Skillsets?
Skillsets are a collection of instructions embedded in your agent’s configuration. Each conversation is tied to one skillset (with limits based on your subscription), and the skillset determines how user requests are interpreted and executed.
-
How They Work:
When a conversation starts, the skillset ID is specified so that the agent loads the relevant instructions. The agent then uses these instructions to detect user intent and map it to a specific action.
Core Components
1. Abilities
Abilities are the individual building blocks of a skillset. Each ability contains:
- Name: A short, descriptive identifier.
- Description: A brief explanation used during the intent detection phase.
- Instruction: Detailed guidance (often including code blocks) for executing the ability when triggered.
Note: Keep the name and description concise (to reduce token usage) while allowing the instruction field to be more elaborate.
2. Packs
A pack is a grouping of multiple abilities. Packs help you bundle related functionalities (such as a set of Google Drive tasks) to:
- Reduce token consumption.
- Simplify configuration.
- Expose multiple related actions under one logical unit.
3. Actions
Actions are the operations performed when an ability is triggered. They are defined within markdown-style fenced code blocks. The syntax specifies an action name (like fetch
, search
, email
, etc.) followed by any additional parameters. For example:
```fetch POST https://weather.com HTTP/1.1 Content-Type: application/json { "location": "London" } ```
markdown
Actions can include both a code block (the operational part) and free-form text instructions. These details ensure consistency in how actions are executed. Below is a summary table of available actions and properties:
Action | Property | Description |
---|---|---|
search | type | The type of search to perform (web, news, images, videos). |
datasetId | ID of the dataset to search within. | |
fetch | timeout | Maximum timeout in milliseconds (default is 10,000 ms). |
format | Output format (text, markdown, json). | |
jsonpath | JSONPath expression to extract data from a JSON response. | |
jmespath | JMESPath expression to extract data from a JSON response. | |
to | Recipient email address. | |
replyTo | Email address for reply-to. | |
subject | Email subject line (defaults applied if omitted). | |
view | text | Uses a vision model to describe an image from a URL. |
text | model | ChatbotKit language models (e.g., gpt-3.5-turbo, gpt4). |
image | model | ChatbotKit image models (e.g., stablediffusion, dalle2/dalle3). |
size | Supported sizes: 256x256, 512x512, 1024x1024. | |
pack | – | Groups multiple abilities together. |
4. Using Parameters
Parameters in actions allow dynamic input handling and secure management of secrets or conversation metadata. ChatbotKit supports several syntaxes:
-
Secrets/Conversation Info:
Use
${SECRET_NAME}
or{{SECRET_NAME}}
to reference a secret,${CONVERSATION_ID}
or{{CONVERSATION_ID}}
for the conversation ID, or${CONVERSATION_META_FIELD}
for metadata. -
User Input Parameters:
Use
$[param]
or[[param]]
to define placeholders that will be populated by the user.
This enhanced parameterization not only improves accuracy but also enriches the user experience by guiding the underlying model on the expected input.
Getting Started: Practical Examples
1. Fetching Web Pages
When a user requests a webpage, your chatbot can output the URL as a markdown code block:
When the user asks the bot to read, fetch, or pull a web page, the bot must only output the URL of the root webpage as a markdown code block, with the language specified as "fetch". For example: ```fetch/format=markdown URL of the webpage, e.g https://... or HTTP request ```
markdown
Behavior: The agent listens for commands like “read,” “fetch,” or “pull” a webpage. If the request isn’t related, it will respond that it cannot fulfill the request.
2. Retrieving Weather Forecasts
For fetching weather information, use a parameterized URL:
GET https://wttr.in/{location}?format=4 HTTP/1.1 User-Agent: curl/7.61.1
http
Example for London:
GET https://wttr.in/London?format=4 HTTP/1.1 User-Agent: curl/7.61.1
http
Multiple Locations:
GET https://wttr.in/{London,Paris}?format=4 HTTP/1.1 User-Agent: curl/7.61.1
http
Outcome: The response will be a plain text weather summary based on the specified location(s).
3. Searching a Dataset
To search within a dataset, include a dataset ID and a query parameter:
```search/datasetId=clvmk6ksl0039vsm3k5wve3pp ${query|The search query related to search for information} ```
markdown
Usage: The agent extracts the search query and uses it to perform a dataset-specific search.
4. Sending Support Emails
For summarizing a conversation and sending a support email:
```email/to=contact@acme.com/replyTo={user email} [The summary of the conversation] ```
plain
Example:
If a user with email test@test.com
requests help, the action becomes:
```email/to=contact@acme.com/replyTo=test@test.com [The summary of the conversation] ```
markdown
5. Generating Text
To generate creative text such as a song based on user input:
```text/model=gpt-4o The user's input text converted to a prompt suitable for song generation ```
markdown
Integration: The user's input is combined with this ability instruction to generate a complete text output.
6. Generating Images
To create images from textual prompts:
```image/model=stablediffusion The user's input text ```
markdown
Enhancements: Further prompt enhancements may be applied; refer to hub examples such as “Logo Maker” or “Fashion AI” for additional guidance.
Creating and Managing Skillsets
Step-by-Step Process
- Access the Skillset Interface:
- Navigate to the “Skillsets” section in the ChatbotKit dashboard.
- Create a New Skillset:
- Click on the "Create Skillset" button.
- Provide a name and description.
- Save your new skillset.
- Add Abilities:
- With your skillset selected, click "Create Ability".
- Define the ability’s name, description, and detailed instruction.
- Save the ability.
Ability Instruction Templates
ChatbotKit provides pre-designed instruction templates accessible via the "Templates" button. These templates can be used as-is or customized to fit your application’s needs.
Troubleshooting & Additional Considerations
-
Logging:
Ensure that your implementation includes sufficient logging to trace the execution of actions.
-
Automatic Retries:
The
fetch
action includes built-in timeout and retry logic. Verify that your parameters (e.g.,timeout
) are set appropriately for your use case. -
Token Usage:
Since descriptive fields (especially in abilities) contribute to token usage, balance detail with brevity to maintain performance.
Conclusion
Skillsets in ChatbotKit empower you to create dynamic and context-aware chatbot behaviors through natural language instructions. By using the ChatbotKit SDK, developers can define and manage abilities, packs, actions, and parameters to create robust conversational applications. Experiment with the provided examples and templates to tailor your chatbot’s capabilities to your users’ needs.