Clinia
How-to Guides

Search Patient Data

Use the search_patient MCP tool to find entities, events, and narrative content by keyword.

Search Patient Data

Patient Memory maintains a BM25 full-text index over all ingested patient data. The index covers entity display names, clinical codes, attribute text, and narrative section content. Search is available via the search_patient MCP tool.

Make the call

search_patient(
  patientId = "{patientId}",
  query     = "{query}"
)

Query patterns

Single term (matches entity names, codes, and attribute values):

search_patient(patientId = "{patientId}", query = "tiotropium")

Multi-term (BM25 ranks results by combined term frequency across all indexed fields):

search_patient(patientId = "{patientId}", query = "COPD exacerbation")

Code search (SNOMED, ICD-10, LOINC, and RxNorm codes are indexed):

search_patient(patientId = "{patientId}", query = "J44.1")

Phrase in narratives (condition story content is indexed, so you can find concepts mentioned in pre-assembled narratives):

search_patient(patientId = "{patientId}", query = "FEV1 below target")

Interpreting results

Results are returned as an array of matches ordered by relevance score:

[
  {
    "path": "/patient/jeanne-72f-copd/medications/current/tiotropium_18mcg",
    "preview": "Tiotropium 18mcg daily - active since 2015"
  },
  {
    "path": "/patient/jeanne-72f-copd/conditions/active/chronic_obstructive_lung_disease/_story.md",
    "preview": "...tiotropium is the primary long-acting bronchodilator for this condition..."
  }
]

Each result includes:

  • path: the VFS path of the matching item. Pass this directly to read_patient to retrieve the full content.
  • preview: a short excerpt showing why the item matched.

Agent workflow

Search is most useful when the agent doesn't know the exact VFS path. A typical pattern:

  1. search_patient with a keyword to get candidate paths
  2. read_patient on the most relevant path to get full content
  3. Repeat for additional context if needed

Prefer browse_patient when the agent knows the category it wants (e.g. "list active conditions"). Use search when the agent knows a term but not where in the VFS it lives.

On this page