Skip to main content
Learn-skill turns real source material — code, docs, PDFs, configs, or this chat — into one grounded, reusable SKILL.md in a single command.

Quick Start

1

Learn from a repo

from praisonaiagents import Agent

agent = Agent()
agent.learn_skill(
    "Read ./my-repo and make a 'deploy-flow' skill"
)
2

Learn from multiple sources

from praisonaiagents import Agent

agent = Agent()
agent.learn_skill(
    "Read ./my-repo and the docs in ./docs/*.pdf and make a 'deploy-flow' skill"
)
3

Learn from the current chat

from praisonaiagents import Agent

agent = Agent()
agent.start("Walk me through deploying this service: …")
agent.learn_skill("Save what we just figured out as a 'deploy-flow' skill")

How It Works

The agent follows three rules when authoring a skill:
RuleWhat it means
Verbatim onlyOnly flags, paths, commands, env vars, and API names that appear verbatim in the gathered sources end up in the skill. Never invented.
Tight bodySKILL.md is kept to ~100–200 lines. Long material moves to supporting files referenced by relative path.
Named sources onlyThe agent reads only the sources you name. It does not browse unrelated material.
YAML frontmatterEvery generated skill has at least name + description.

Three Surfaces

from praisonaiagents import Agent

agent = Agent()
agent.learn_skill("Read ./my-repo and make a 'deploy-flow' skill")

Async

from praisonaiagents import Agent

agent = Agent()
result = await agent.alearn_skill(
    "Read ./my-repo and make a 'deploy-flow' skill"
)
alearn_skill is the async equivalent of learn_skill. Use it inside async functions or notebooks.

Approval Gate

Skills authored by learn_skill go through the same human approval gate as any other agent-created skill. By default the tool returns {"status": "pending", "id": "skl-…"} and disk is not touched until a human approves. See Skill Manage.

Common Patterns

From a single repo

from praisonaiagents import Agent

agent = Agent()
agent.learn_skill("Read ./my-repo and make a 'deploy-flow' skill")

Multi-source (repo + PDFs + URL)

The agent picks the right tool per source — file read, PDF read, or fetch — automatically.
from praisonaiagents import Agent

agent = Agent()
agent.learn_skill(
    "Read ./my-repo, the runbook at ./docs/runbook.pdf, "
    "and https://docs.example.com/api — make a 'deploy-flow' skill"
)

From the current chat

Phrases like "what we just figured out" or "this conversation" route the agent to use the chat as the source.
from praisonaiagents import Agent

agent = Agent()
agent.start("Walk me through deploying this service to AWS…")
agent.learn_skill("Save what we just figured out as a 'deploy-flow' skill")

CLI with model override

praisonai skills learn "the API in ./openapi.yaml as a 'stripe-billing' skill" --llm gpt-4o

Best Practices

Saying “read ./my-repo and ./docs/*.pdf” beats “learn about deploys” because the agent only reads what you name. Explicit paths give better, more grounded skills.
Include a quoted name like "… make a 'deploy-flow' skill". If you omit it, the agent derives one from the content — which may be less predictable.
learn / alearn are kept as backward-compat aliases. The canonical names are learn_skill / alearn_skill to avoid confusion with the memory learn= constructor param on Agent.
learn_skill automatically adds skill_manage, read_skill_file, and list_skill_scripts to agent.tools if they are missing. The call is idempotent — running it multiple times does not double-register tools.

Backward-compat Aliases

learn and alearn are aliases for learn_skill and alearn_skill:
agent.learn("Read ./my-repo and make a 'deploy-flow' skill")
await agent.alearn("Read ./my-repo and make a 'deploy-flow' skill")
Prefer learn_skill / alearn_skill in new code.

Skill Manage

The approval gate the authored skill flows through

Agent Skills

Invoking and discovering skills

Self-Improving Agents

Auto-curate skills from conversation (different mechanism)

Bot Chat Commands

/learn slash command in Telegram, Discord, and Slack