lore_search
Search memories by semantic and keyword query, or retrieve specific memories by ID. Filter by score, date, source type, and more.
Instructions
Search memories by semantic + keyword query, or bulk-fetch by ID.
When ids is provided, skips the vector/BM25 pipeline entirely and does
a direct SQL lookup by lore_id. query is ignored in that path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | No | When set, returns these specific lore_ids directly from SQL, bypassing the search pipeline. Silently skips unknown IDs. Pair with ``format='title'`` for a two-step list-then-fetch workflow. Max 50 IDs (configurable via ``max_search_ids``). | |
| limit | No | Max results to return (default from settings). | |
| query | No | Search text. Required unless ``ids`` is set. | |
| format | No | ``'full'`` (default) returns complete memory objects with relevance scores. ``'title'`` returns compact ``{id, title, score}`` dicts — lower token cost for listing before a targeted fetch. | full |
| sort_by | No | ``'relevance'`` (default) ranks by hybrid score when the search pipeline runs. In ``ids`` lookup mode there is no scoring, so ``'relevance'`` preserves the caller-provided ``ids`` order instead. ``'recent'`` sorts by ``updated_at DESC``. ``'frequent'`` sorts by ``usage_count DESC``. Composes with timestamp filters. | relevance |
| min_score | No | Minimum combined_score threshold (default 0.1). | |
| refine_from | No | Restrict search candidates to these lore_ids (configurable cap, default 200 via ``LORE_MAX_REFINE_FROM_IDS``). | |
| source_type | No | Optional provenance filter. When set, only return memories with this exact source_type. One of: ``observed``, ``inferred``, ``user_stated``, ``consolidated``, ``injected``, ``unknown``. | |
| created_after | No | ISO 8601 UTC timestamp. Only return memories created on or after this time (e.g. ``'2026-06-04T00:00:00'``). UTC only; non-UTC offsets raise a validation error. | |
| include_links | No | Attach memory links to results (default True; forced off in ``format='title'`` mode since links add tokens with no gain). | |
| updated_after | No | ISO 8601 UTC timestamp. Only return memories updated on or after this time. Composes with ``created_after`` and all other filters. | |
| include_deleted | No | Include soft-deleted memories (default False). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||