deja
Patterns

Memory patterns & recipes

Battle-tested recipes for agent memory. Each pattern solves a real problem with concrete code.

Looking for where memory interfaces are heading? Explore our 20 Memory Interface Research explorations.

recall beginner

Single Agent Recall

Give a single AI agent persistent memory by storing learnings after tasks and injecting relevant memories before new ones. The foundational deja pattern.

multi agent intermediate

Multi-Agent Shared Memory

Connect multiple AI agents through a single deja instance using scope isolation. Shared scope for cross-agent knowledge, agent-specific scopes for specialization.

human in loop beginner

Human-in-the-Loop Teaching

Let humans explicitly teach agents by saying 'remember this.' The agent stores the teaching with appropriate confidence and scope using deja's learn() API.

multi agent advanced

Agent-to-Agent via Shared Memory

Enable asynchronous agent-to-agent communication through shared deja memory. Agent A learns, Agent B injects -- no direct messaging required.

steering intermediate

Inner Loop Steering

Use inject() at the start of every agent loop iteration to continuously steer behavior with relevant memories. Pre-task injection guides decisions in real time.

recall intermediate

Incident Response Automation

Capture postmortem learnings in deja and automatically inject them during similar future incidents. Turn every outage into institutional memory.

maintenance beginner

Memory Hygiene

Keep deja memory clean and useful over time. Patterns for confidence decay, pruning stale memories, consolidating duplicates, and scheduled cleanup.