Memory Types
Understanding the five memory types — rules, decisions, facts, notes, and skills.
Every memory in memories.sh has a type that describes its purpose. The type affects how the memory is presented to AI agents and how it's prioritized in context.
Types answer "what kind of memory is this?" (rule, decision, fact, note, skill).
For lifecycle segmentation (session vs semantic vs episodic vs procedural), see
Memory Segmentation.
Types
Rule
Rules are always-active coding standards, preferences, and constraints. They are always included when context is requested, regardless of the query.
memories add --rule "Always use TypeScript strict mode"
memories add --rule "Prefer named exports over default exports"
memories add --rule "Use early returns to reduce nesting"Rules are the most important memory type. They appear at the top of generated files and are always returned by memories recall and the MCP get_context tool.
Rules can be path-scoped so they only apply to specific files:
memories add --rule "Use RESTful naming conventions" --paths "src/api/**"
memories add --rule "Mock all external services" --paths "**/*.test.ts"Decision
Decisions capture the reasoning behind architectural and technical choices. They help AI agents understand why something was done a certain way.
memories add --decision "Chose PostgreSQL over MySQL for JSONB support and better array handling"
memories add --decision "Using Supabase for auth because of built-in RLS and generous free tier"Fact
Facts store specific project knowledge — numbers, configurations, constraints, and other concrete information.
memories add --fact "API rate limit is 100 requests per minute per user"
memories add --fact "The main database runs PostgreSQL 15 on Supabase"
memories add --fact "Deploy target is Vercel with Edge Functions"Note
Notes are the default type for general-purpose memories that don't fit the other categories.
memories add "Legacy API will be deprecated in Q3 2026"
memories add "The billing module was written by the contractor team"Skill
Skills define reusable capabilities or workflows that AI agents can invoke. They follow the Agent Skills open standard and generate SKILL.md files in the .agents/skills/ directory.
memories add --type skill "## Deploy to Production\n\n1. Run tests\n2. Build artifacts\n3. Push to registry" \
--category deploy \
--metadata '{"name": "deploy", "description": "Deploy the app to production"}'Skills require a --category to group them into directories (e.g., deploy, review, testing). The category becomes the skill's folder name in .agents/skills/{category}/SKILL.md.
Extended Fields
In addition to the type, memories can carry optional metadata that enriches generated configurations:
paths
Comma-separated glob patterns that scope a memory to specific files. When set, the memory only appears in path-scoped rule files rather than global instructions.
memories add --rule "Use React Query for data fetching" --paths "src/components/**,src/hooks/**"Path-scoped memories translate into:
.claude/rules/*.mdwithpaths:frontmatter.cursor/rules/*.mdcwithglobs:frontmatter- Inline path annotations in flat-file targets
category
A free-form grouping key. For rules, the category determines the output filename (e.g., --category api produces rules/api.md). For skills, it determines the directory name.
memories add --rule "Validate all request params" --paths "src/api/**" --category apimetadata
A JSON object for extended attributes. Primarily used for skills (name, description, allowed tools), but available on any memory type for future use.
memories add --type skill "..." --metadata '{"name": "code-review", "description": "Systematic code review"}'How Types Affect Context
When an AI agent requests context via memories recall or the MCP server:
- All rules are always included (both global and project-scoped), with path information when available
- Other types are included based on search relevance or explicit request
- Generated files include rules by default, with decisions and facts optional via
--types
Choosing the Right Type
| If the memory... | Use |
|---|---|
| Should always be followed | rule |
| Explains a past choice | decision |
| States something concrete and specific | fact |
| Is general context or temporary | note |
| Defines a reusable agent workflow | skill |