---
name: aprendizaje-continuo-agentes-ia
description: Guía e infraestructura para implementar memoria persistente y aprendizaje continuo en agentes IA, con memoria de dos niveles (global y local), hooks de captura automática de patrones y compactación inteligente.
license: MIT
metadata:
  id: 317eb9c0
  slug: aprendizaje-continuo-agentes-ia
  titulo: "Aprendizaje Continuo para Agentes IA"
  servicio: Agentes-IA
  categoria_recurso: IA-Generativa
  tipo: sistema
  nivel: avanzado
  idioma: es
  idioma_original: en
  acceso: gratis
  precio_eur: 0
  plataformas: [GitHub Copilot, VS Code, SQLite]
  dependencias: [SQLite, bash hooks]
  licencia: { spdx: MIT, redistribuible: true, uso_comercial: true }
  fuente:
    repo: microsoft/skills
    url: https://github.com/microsoft/skills/tree/main/.github/skills/continual-learning
    commit: dee7bef
    autor: microsoft
    nombre_original: continual-learning
    duplicados_en: []
  seguridad: { veredicto: seguro, riesgo: bajo, escaneado: "2026-06-14", motor: "grep-estatico+auditor-llm" }
  ficha:
    que_hace: "Dota a los agentes IA de memoria persistente entre sesiones mediante una base de datos SQLite de dos niveles (global y por proyecto) que captura patrones, errores y preferencias."
    como_lo_hace: "Instala hooks que observan resultados de herramientas y detectan fallos recurrentes, almacena aprendizajes por categoría (patron, error, preferencia) y los aplica al inicio de cada nueva sesión con compactación automática por antigüedad."
  content_hash: "317eb9c0d2cba2af730fdc216cf420dc96a9df7ae963d356ecd71f0baf4a32ac"
  version: 1.0.0
---

# 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):
```bash
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:
```sql
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:
```markdown
# .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
