lore_search
Find and retrieve memories using hybrid semantic and keyword search, or fetch specific lore entries by ID. Supports filtering by creation time, update time, source type, and scoring thresholds.
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 |
|---|---|---|---|
| query | No | Search text. Required unless ``ids`` is set. | |
| limit | No | Max results to return (default from settings). | |
| min_score | No | Minimum combined_score threshold (default 0.1). | |
| include_links | No | Attach memory links to results (default True; forced off in ``format='title'`` mode since links add tokens with no gain). | |
| include_deleted | No | Include soft-deleted memories (default False). | |
| refine_from | No | Restrict search candidates to these lore_ids (configurable cap, default 200 via ``LORE_MAX_REFINE_FROM_IDS``). | |
| 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 |
| 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``). | |
| 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. | |
| updated_after | No | ISO 8601 UTC timestamp. Only return memories updated on or after this time. Composes with ``created_after`` and all other filters. | |
| 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 |
| 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``. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||