Skip to main content

Description

save_memory stores a piece of knowledge that should be remembered across sessions. MemContext automatically handles deduplication, versioning, and relationship classification — you just provide the content.

Parameters

ParameterTypeRequiredDescription
contentstringYesClear, complete, searchable statement. Full sentences work best — not fragments or keywords.
categorystringNoOne of preference, fact, decision, or context. See below.
projectstringNoProject scope. Use only for project-specific memories. Format: lowercase, no spaces (e.g. memcontext). Omit for general preferences.
validUntilstringNoISO 8601 datetime when this memory expires (e.g. 2026-05-01T00:00:00Z). Omit for permanent memories.

Categories

CategoryUse forExample
preferenceUser likes/dislikes”User prefers dark mode”
factObjective information”User uses macOS”
decisionChoices made”Chose PostgreSQL for database”
contextBackground information”Working on e-commerce app”

What happens on save

  1. Content is expanded into a more searchable form via LLM
  2. An embedding is generated
  3. Similar existing memories are found
  4. The relationship is classified (update, extend, similar, or duplicate)
  5. The memory is saved, supersedes an existing one, extends one, or is deduplicated

Response

The response includes a status field indicating what happened:
StatusMeaning
savedNew memory created
updatedSuperseded an existing memory (old one marked non-current)
extendedCreated a relation to an existing memory
duplicateContent already exists, nothing saved
Duplicates are handled automatically — re-saving an already-known fact is safe.

Example

save_memory({
  content: "User prefers TypeScript over JavaScript for type safety",
  category: "preference"
})

Content guidelines

Content should be written as clear, self-contained statements that will be searchable later:
  • Good: "User prefers TypeScript over JavaScript for type safety"
  • Bad: "TS > JS" (too vague, not searchable)
  • Bad: "user likes coding" (not specific enough to be useful)