Load it for the matching job
The ferry price
Skills package reusable domain instructions (like pricing rules or checklists) in a clean SKILL.md file. Activating a skill loads its instructions into the agent only when needed so your base prompt stays lean.
activate reads the instructions. The agent then answers from them.
The result is the price from the skill: four pounds.
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")
agent.skill_manager.activate(skill)
print(agent.start("What is the ferry price?"))Example explained
- activate — Reads the instructions in SKILL.md.
- start — Asks the agent, which should use those instructions.
No match, no price
Ask about apples — the ferry skill should not drive the answer.
Expected output: the ferry question activates the skill and returns 'four pounds', while the unrelated apple question answers normally without the ferry rule.
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\nThe ferry costs four pounds.\n"
)
agent = Agent(instructions="Do not invent prices. Say unknown if no skill applies.", skills=[str(folder)])
print(agent.start("Where do apples grow?"))Example explained
- from praisonai import Agent — Imports Agent needed for no match, no price.
- Agent(…) — Instantiates the Agent configured for no match, no price.
- .start(…) — Executes the configured run for no match, no price and returns the result.
Reference: documentation