Back to Guides & Cookbooks
Cookbook

How to make AI learn from repeated interactions

When Cadreen sees the same pattern repeated, it proposes turning it into a reusable procedure. You approve. The system gets smarter.

1

Four types of memory

Cadreen has four memory types. Each serves a different purpose. All persist across sessions and surfaces.

Episodic

Every past interaction, searchable by meaning

Finds related past interactions by how similar they are

Semantic

Structured knowledge (facts, decisions, past recoveries)

Organized knowledge that catches contradictions

Procedural

Reusable step-by-step procedures from repeated patterns

Spots repeated sequences, proposes them as permanent shortcuts

Observer/Learning

Full interaction logs with pattern detection

Validates improvements before suggesting them

2

Repeated patterns become reusable procedures

When Cadreen sees you do the same thing repeatedly, it proposes turning that pattern into a permanent shortcut. You decide whether to keep it.

ObserveDetect patternProposeGovernanceCrystallize"I've seen this pattern enough times. Want me to make it permanent?"
3

See learning in action

Query learning insights
// What patterns has Cadreen detected?
const patterns = await cadreen.learning.patterns();
console.log(patterns);
// [
// {
// pattern: "create_invoice → send_invoice → log_to_accounting",
// occurrences: 23,
// crystallized: false,
// proposed: true
// }
// ]

// What episodes inform the learning?
const episodes = await cadreen.learning.episodes();

// What suggestions does Cadreen have?
const suggestions = await cadreen.learning.suggestions();
CLI
cadreen learning patterns      # detected patterns
cadreen learning episodes # interaction history
cadreen learning suggestions # improvement suggestions
Note
Crystallized procedures are stored as knowledge items. They persist across sessions and are shared across all surfaces. Future requests skip the inference step — faster and cheaper.
Note
Next: Building a governed CI/CD pipeline — governance as the pipeline itself.