Semantic search
semantic_searchRank free-text health records by relevance using keyword search across notes, events, and clinical details. Returns best matches first with source references and highlighted snippets.
Instructions
Relevance-ranked full-text search across all free-text health history.
Unlike search_records (exact case-insensitive substring), this builds a transient SQLite FTS5 index over every free-text field — notes, event details, encounter reasons/assessments/plans, lab flags, imaging findings, document text, care-task notes, and more — stems terms, and ranks hits by BM25. So the model can query history by meaning/keywords instead of an exact key and gets the best matches first. This is lexical ranking (local, no embeddings or network), not vector semantics.
Every hit carries source_table + record_id (feed them to get_record to pull the exact row) and a highlighted snippet, so findings can be grounded in a row.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | No | which person; defaults to the primary user. | |
| limit | No | max hits to return (ranked best-first). | |
| query | Yes | free-text query; terms are OR-ed with prefix + stemming for recall. | |
| tables | No | optional comma-separated subset of tables to search. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||