A folder of instructions

Write the file

SKILL.md is a short note with a name and a description. The agent is pointed at that folder.

The result prints the skill name, then the description. The instructions stay in the file until the next page loads them.

Example

from pathlib import Path
from praisonai import Agent

folder = Path("/tmp/ferry-skill")
folder.mkdir(exist_ok=True)
(folder / "SKILL.md").write_text(
    "---\nname: ferry\ndescription: Use when asked the ferry price.\n---\n\n"
    "The ferry costs four pounds. Reply with that price only.\n"
)
agent = Agent(instructions="Follow the skill.", skills=[str(folder)])
skill = agent.skill_manager.get_skill("ferry")
print(skill.properties.name)
print(skill.properties.description)

Try it Yourself

Example explained

  • SKILL.md — The file. The top lists the name and when to use it.
  • skills — The folder to load.

Tighten the description

Skills activate on description match. Make the description narrow so unrelated jobs do not load it.

Example

from pathlib import Path
from praisonai import Agent

folder = Path("/tmp/refund-skill")
folder.mkdir(exist_ok=True)
(folder / "SKILL.md").write_text(
    "---\nname: refund\ndescription: Use only when user asks about refund policy.\n---\n\nRefunds within 14 days.\n"
)
agent = Agent(instructions="Follow activated skill only.", skills=[str(folder)])
print(agent.skill_manager.get_skill("refund").properties.description)

Try it Yourself

Example explained

  • from praisonai import Agent — Imports Agent needed for tighten the description.
  • Agent(…) — Instantiates the Agent configured for tighten the description.

Reference: documentation