Delphidelphi

learn

Encode a lesson into long-term memory.

Writes a durable fact, rule, or preference to the appropriate memory file so it applies to all future sessions.

Parameters

NameTypeRequiredDescription
lessonstring✓The fact, rule, or preference to remember
categorystring✓Where to store it (see below)
skill_namestring—Slug for the skill file (only when category="skill")

Categories

CategoryWritten toUse for
skillNew skill file in skills/Repeatable workflows, formatting rules
behaviorHOUSE_RULES.mdAlways/never rules about how to act
preferenceUSER_PROFILE.mdWorking style, communication preferences
contextBUSINESS_CONTEXT.mdBusiness, project, team, or tech stack facts

Examples

learn(
  lesson="Always reply in short form unless the user explicitly asks for detail",
  category="preference"
)

learn(
  lesson="We use NZD for all financial figures. Never use USD.",
  category="context"
)

learn(
  lesson="Never send a Slack message without showing the user a draft first",
  category="behavior"
)

learn(
  lesson="When the user says 'morning report', pull GitHub PRs and format as...",
  category="skill",
  skill_name="morning-report"
)

Notes

  • The agent calls learn proactively — you rarely need to call it directly.
  • Trigger it naturally: "remember that...", "always...", "never...", "from now on...", "I prefer..."