Skip to main content
The User Memory Store captures unstructured observations about users: preferences, behaviors, and context that don’t fit into structured profile fields.

Basic Usage

The agent knows to include code examples and may relate to ML context.

Always Mode

Memories are extracted automatically after each response.
Tradeoff: extra LLM call per interaction.

Agentic Mode

The agent receives tools to manage memories explicitly.
Available tool: update_user_memory (supports add, update, and delete operations). Clearing all memories requires enable_clear_memories=True. Tradeoff: agent may miss implicit observations.

What Gets Captured

Memory Data Model

Accessing Memories

Context Injection

Relevant memories are injected into the system prompt:

Curation

The Curator does not work with the User Memory Store in v2.7.2. lm.curator.prune() and lm.curator.deduplicate() read the User Profile store, which has no memories field, so both calls return 0 without removing any user memories. To remove memories, use the agentic update_user_memory tool, which supports delete operations.

Combining with User Profile

Use both stores for comprehensive user understanding: