Skip to content

AMSDAL Skills

Skills are reusable, named sets of instructions that an AI assistant can discover and follow during a conversation. They let you encode domain-specific procedures (how to onboard a customer, how to apply a discount, what to check before deleting data) once and have the assistant apply them consistently.

Skills are stored as AmsdalSkill records and surfaced to MCP clients through the list_available_skills tool on the Model Explorer server.

The AmsdalSkill Model

AmsdalSkill is a contrib model (table amsdal_skill) with the following fields:

Field Type Description
name str Unique name of the skill
description str Short description of what the skill does
instructions str Full instructions the assistant must follow when the skill applies
use_when str \| None Condition / triggers indicating when the skill should be used
requires_user_approval bool If true, the assistant must ask the user before executing the skill (default false)

Create skills like any other AMSDAL model:

from amsdal_ml.models.amsdal_skill import AmsdalSkill

skill = AmsdalSkill(
    name='Apply Discount',
    description='Apply a percentage discount to a customer order.',
    instructions='1. Find the order. 2. Validate the percentage is 0-100. 3. Update the order total.',
    use_when='The user asks to discount or reduce the price of an order.',
    requires_user_approval=True,
)
await skill.asave()

How Skills Are Used

In the MCP/agent chat flow, list_available_skills is called first so the assistant learns which skills exist and their use_when triggers. The flow is:

  1. Discover — the assistant calls list_available_skills, which returns each skill's name, description, use_when, and requires_user_approval (note: the full instructions are not returned here).
  2. Match — when a request matches a skill's use_when, the assistant proceeds.
  3. Approval — if requires_user_approval is true, the assistant asks the user and waits for explicit confirmation before continuing.
  4. Read instructions — the assistant reads the full instructions via perform_crud_operation(operation='read', model_name='AmsdalSkill', query='Find skill by name <Skill Name>').
  5. Execute — the assistant follows the instructions exactly.

The assistant is also instructed to periodically re-fetch the skill list as the conversation grows so it does not lose track of available skills.

Authorization

Like all Model Explorer operations, skill records are accessed through AMSDAL's permission system, so users only see and run skills they are authorized for. The requires_user_approval flag adds a second, explicit human-in-the-loop gate on top of those permission checks.