Core Concepts

Memories

Memories are the foundation of Kyew. They store observations from your interactions that can be recalled later to inform future work.


What is a Memory?

A memory is a structured observation with context:

{
  "id": "mem-abc123",
  "observation": "Fixed CORS by adding Access-Control-Expose-Headers: Mcp-Session-Id",
  "context": {
    "domain": "cloudflare",
    "task_type": "debugging",
    "outcome": "success",
    "tools_used": ["curl", "wrangler"]
  },
  "tags": ["cors", "headers", "mcp"],
  "created": "2024-01-15T10:30:00Z"
}

Key Fields

  • observation: What happened - the core knowledge to remember
  • domain: Project or area (e.g., "cloudflare", "react-app", "personal")
  • task_type: Category of work (e.g., "debugging", "deployment", "testing")
  • outcome: Result - success, failure, partial, or unknown
  • tools_used: Optional list of tools involved
  • tags: Optional free-form categorization

Storing Memories

Use the remember tool to store observations:

"remember that the deployment script needs NODE_ENV=production or it skips the build step"

Claude extracts the context and stores it:

{
  "observation": "Deployment script needs NODE_ENV=production or it skips the build step",
  "domain": "deployment",
  "task_type": "configuration",
  "outcome": "success"
}

With Explicit Context

You can be more explicit about the context:

"remember in the cloudflare domain that wrangler dev requires --local for D1 to work, outcome success"

Required Fields

The remember tool requires:

  • observation - What to remember
  • domain - Where this applies
  • task_type - Category of work
  • outcome - What happened

Recalling Memories

Use the recall tool to search memories:

"recall memories about CORS issues"

The search uses semantic similarity to find relevant memories even with different wording.

Filter by Domain

"recall memories in the cloudflare domain"

Limit Results

"recall the 5 most relevant memories about testing"

Correcting Memories

If a memory contains an error, use correct:

"correct memory mem-abc123 - the header should be X-Custom-Header not Mcp-Session-Id"

This creates a new memory that supersedes the old one, maintaining history:

{
  "id": "mem-def456",
  "observation": "Fixed CORS by adding Access-Control-Expose-Headers: X-Custom-Header",
  "supersedes": "mem-abc123"
}

Forgetting Memories

To archive outdated memories:

"forget memory mem-abc123"

This soft-deletes the memory. It won't appear in searches but is retained for audit purposes.

Superseding

You can specify that a memory is replaced by another:

"forget memory mem-abc123, superseded by mem-def456"

Memory Best Practices

Be Specific

Specific memories are more useful than vague ones:

# Good
"remember that vitest snapshot tests need --update flag to refresh"

# Better
"remember that vitest snapshot tests fail with 'obsolete snapshot' error and need npx vitest --update to refresh the expected output"

Include Context

Context helps with future retrieval and pattern matching:

# Minimal context
"remember that tests fail on CI"

# Rich context
"remember in the github-actions domain that tests fail on CI because of missing env vars - need to add DATABASE_URL to secrets, outcome failure then success"

Use Consistent Domains

Group related work under consistent domain names:

# Consistent
domain: "cloudflare-workers"
domain: "cloudflare-workers"
domain: "cloudflare-workers"

# Inconsistent (harder to find patterns)
domain: "cloudflare"
domain: "cf-workers"
domain: "workers"

Record Both Successes and Failures

Failures are valuable learning opportunities:

"remember that using async in the handler without await causes the response to complete before the database write, outcome failure"

How Memories Power Skills

Memories are the raw material for skill generation:

  1. Accumulate memories in a domain
  2. Analyze for patterns (3+ similar memories)
  3. Generate skills from detected patterns
  4. Approve to activate the skill

The more specific and consistent your memories, the better the generated skills.


Memory API Reference

remember

Store an observation with context.

ParameterTypeRequiredDescription
observationstringYesWhat happened
domainstringYesDomain/project
task_typestringYesType of task
outcomestringYessuccess/failure/partial/unknown
tools_usedstring[]NoTools involved
tagsstring[]NoFree-form tags

recall

Semantic search over memories.

ParameterTypeRequiredDescription
querystringNoSearch query
domainstringNoFilter by domain
limitnumberNoMax results

correct

Update a memory with a correction.

ParameterTypeRequiredDescription
memory_idstringYesMemory to correct
correctionstringYesUpdated observation

forget

Mark a memory as forgotten.

ParameterTypeRequiredDescription
memory_idstringYesMemory to forget
superseded_bystringNoReplacement memory ID
Previous
Quick Start
Next
Skills