extract_memories
Extract structured preferences, facts, and skills from conversation text using rule-based or semantic LLM modes, with optional auto-save and fallback reporting.
Instructions
Extract structured memories from conversation text. mode="rule" (default) detects preferences, facts, and skills via keyword pattern matching. mode="llm" instead understands the full context (optionally pairing assistant_text) semantically — uses the configured LLM extraction provider, and degrades to rule-based extraction (reported via fallback_used/fallback_reason) when no provider is configured or the LLM call fails. Returns extracted items; with auto_save=true it also writes them and requires agent auth when the agent has a registered key. Invalid occurred_at is an error, never a silent drop.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Extraction mode: "rule" (default, keyword pattern matching) or "llm" (semantic extraction over the full context; uses the configured LLM extraction provider, falling back to rule-based when none is configured or the LLM call fails — see fallback_used in the result). | |
| text | Yes | Text to extract memories from (conversation content, e.g. the user's turn) | |
| api_key | No | API key for agent authentication (required if agent has a registered key) | |
| agent_id | No | Agent ID to attribute saved memories to | unknown |
| auto_save | No | Whether to auto-save extracted memories | |
| occurred_at | No | When the extracted facts actually happened in the source conversation (RFC 3339), stored as `occurred_at` on saved memories — distinct from `created_at` (ingestion time). Invalid input is an error, never a silent drop. | |
| assistant_text | No | Optional paired assistant/response text for mode="llm" — passing both sides of the exchange lets the model resolve references and implicit preferences a single text can't. |