All skills
microsoft avatar

/continual-learning

@6737dcb
by microsoftmicrosoft/skills3.1k stars
351

Guide for implementing continual learning in AI coding agents โ€” hooks, memory scoping, reflection patterns. Use when setting up learning infrastructure for agents.

Use this Skill: https://skilld.dev/gh/microsoft/skills/continual-learning

This session only. Nothing lands on disk.

SKILL.md

โ‰ˆ46 tokens always: the name and description. โ‰ˆ595 when used: this file.

Continual Learning for AI Coding Agents

Your agent forgets everything between sessions. Continual learning fixes that.

The Loop

Experience โ†’ Capture โ†’ Reflect โ†’ Persist โ†’ Apply
     โ†‘                                       โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Quick Start

Install the hook (one step):

cp -r hooks/continual-learning .github/hooks/

Auto-initializes on first session. No config needed.

Two-Tier Memory

Global (~/.copilot/learnings.db) โ€” follows you across all projects:

  • Tool patterns (which tools fail, which work)
  • Cross-project conventions
  • General coding preferences

Local (.copilot-memory/learnings.db) โ€” stays with this repo:

  • Project-specific conventions
  • Common mistakes for this codebase
  • Team preferences

How Learnings Get Stored

Automatic (via hooks)

The hook observes tool outcomes and detects failure patterns:

Session 1: bash tool fails 4 times โ†’ learning stored: "bash frequently fails"
Session 2: hook surfaces that learning at start โ†’ agent adjusts approach

Agent-native (via store_memory / SQL)

The agent can write learnings directly:

INSERT INTO learnings (scope, category, content, source)
VALUES ('local', 'convention', 'This project uses Result<T> not exceptions', 'user_correction');

Categories: pattern, mistake, preference, tool_insight

Manual (memory files)

For human-readable, version-controlled knowledge:

# .copilot-memory/conventions.md
- Use DefaultAzureCredential for all Azure auth
- Parameter is semantic_configuration_name=, not semantic_configuration=

Compaction

Learnings decay over time:

  • Entries older than 60 days with low hit count are pruned
  • High-value learnings (frequently referenced) persist indefinitely
  • Tool logs are pruned after 7 days

This prevents unbounded growth while preserving what matters.

Best Practices

  1. One step to install โ€” if it takes more than cp -r, it won't get adopted
  2. Scope correctly โ€” global for tool patterns, local for project conventions
  3. Be specific โ€” "Use semantic_configuration_name=" beats "use the right parameter"
  4. Let it compound โ€” small improvements per session create exponential gains over weeks

Source: SKILL.md on GitHub

1 warning17d5 checks ยท Risk SAFE
  • Gen Agent Trust Hub17d

    This skill provides documentation and infrastructure patterns for implementing memory persistence in AI agents. It includes instructions for setting up hooks and managing local and global memory files to improve agent performance over time.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW ยท No issues

  • Runlayer7mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 ยท 2 sections analyzed

Signed by skilld at 6737dcb. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 18 hours ago.

Activeupdated 7 months ago

README badge

README badge for microsoft/skills/continual-learning