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, orunknown - 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 rememberdomain- Where this appliestask_type- Category of workoutcome- 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:
- Accumulate memories in a domain
- Analyze for patterns (3+ similar memories)
- Generate skills from detected patterns
- 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| observation | string | Yes | What happened |
| domain | string | Yes | Domain/project |
| task_type | string | Yes | Type of task |
| outcome | string | Yes | success/failure/partial/unknown |
| tools_used | string[] | No | Tools involved |
| tags | string[] | No | Free-form tags |
recall
Semantic search over memories.
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | No | Search query |
| domain | string | No | Filter by domain |
| limit | number | No | Max results |
correct
Update a memory with a correction.
| Parameter | Type | Required | Description |
|---|---|---|---|
| memory_id | string | Yes | Memory to correct |
| correction | string | Yes | Updated observation |
forget
Mark a memory as forgotten.
| Parameter | Type | Required | Description |
|---|---|---|---|
| memory_id | string | Yes | Memory to forget |
| superseded_by | string | No | Replacement memory ID |