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 toread_patientto 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:
search_patientwith a keyword to get candidate pathsread_patienton the most relevant path to get full content- 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.
Read a Condition Story
Read _story.md via MCP tool or REST, and choose the right format and token budget for your use case.
Audit Entity Resolution
Read the resolution report to understand how entities from different sources were merged, what conflicts were found, and which resolver made each decision.