Read Memories and Their Links to Facts
List the memories learned about a patient and follow each one to the facts it speaks to.
Read the memories the Context Engine learned from a patient's sessions, then follow each one to the facts in the patient's record it speaks to. A memory is attributed to the person who said it, as described in Attribution, so it stays apart from the facts formed from systems of record.
Prerequisites
- A patient with at least one session whose ingestion has settled, as described in Learn Memories from a Transcript or Manage a Session.
- An access token with the
readscope, as described in Authentication and Credentials.
List the memories
List the memories one session produced:
curl "https://<workspace-id>.w.clinia.cloud/v1/patients/{patientId}/sessions/{sessionId}/memories" \
-H "Authorization: Bearer <access-token>"{
"data": [
{
"id": "lm_tz4a98xxat96iws9zmbrgj3a",
"type": "adherence",
"content": "Stopped taking the Empagliflozin a few weeks ago, it was upsetting their stomach.",
"sessionId": "session-456",
"createdAt": "2026-07-27T14:03:02.000Z"
}
],
"meta": { "total": 1, "page": 0, "perPage": 100 }
}To list memories across every session of the patient, query the learned_memory nodes of the patient graph. The filter takes an optional type and an optional sessionId:
curl -X POST "https://<workspace-id>.w.clinia.cloud/v1/patients/{patientId}/graph/nodes/learned_memory/query" \
-H "Authorization: Bearer <access-token>" \
-H "Content-Type: application/json" \
-d '{ "filter": { "type": { "eq": "adherence" } } }'Each node carries the memory under payload, with its type, its content and the sessionId it was said in. Both calls return the same lm_ id, sort newest first, and paginate with page and perPage.
Find the facts a memory speaks to
Only symptom memories, which link to conditions, and adherence memories, which link to medications, can be linked to facts. concern and preference memories are never linked.
List the relationship edges that touch the memory:
curl "https://<workspace-id>.w.clinia.cloud/v1/patients/{patientId}/graph/edges/relationship/items?touching={memoryId}" \
-H "Authorization: Bearer <access-token>"{
"data": [
{
"type": "relationship",
"id": "rel_q8w2e4r6t8y0u2i4o6p8a0s2",
"createdAt": "2026-07-27T14:03:09.000Z",
"updatedAt": "2026-07-27T14:03:09.000Z",
"from": { "type": "learned_memory", "id": "lm_tz4a98xxat96iws9zmbrgj3a" },
"to": { "type": "fact", "id": "fct_k3j5h7g9f1d3s5a7p9o1i3u5" },
"payload": {
"type": "conflicts",
"source": "llm_inferred",
"confidence": 0.9,
"reasoning": "The patient reports having stopped Empagliflozin, while the record lists it as active.",
"attributes": { "fields": ["status"] }
}
}
],
"meta": { "total": 1, "page": 0, "perPage": 100 }
}Each edge runs from the memory to a fact. payload.type says how the memory relates to that fact. The possible values are:
corroborates- The memory agrees with the fact.attributes.fieldsnames the fields it agrees with.enriches- The memory adds information the fact does not carry. It names no fields.conflicts- The memory contradicts the fact.attributes.fieldsnames the fields it contradicts.
payload.reasoning explains the link in a sentence. payload.confidence scores it between 0 and 1. A memory can hold several links to the same fact, such as one that corroborates its dose and one that contradicts its status, with at most one link of each type.
Open the fact
Open the fact the edge points to:
curl "https://<workspace-id>.w.clinia.cloud/v1/patients/{patientId}/graph/nodes/fact/items/{factId}" \
-H "Authorization: Bearer <access-token>"{
"type": "fact",
"id": "fct_k3j5h7g9f1d3s5a7p9o1i3u5",
"payload": {
"type": "medication",
"display": "Empagliflozin 10 MG Oral Tablet",
"status": "active"
}
}The response is shortened to the fields this example needs. The fact still reads active, because a link never changes the fact it points to, even when the memory contradicts it.
Gotchas
- A
symptomoradherencememory has no link when nothing in the patient's record matched it, or when its ingestion settled aspartialbecause some links could not be made. - A link can appear after the session, because a condition or medication fact that arrives later is compared with the memories already stored.
- Links are recomputed when a fact they point to changes, so a link's type can differ from one ingestion to the next.
- An agent reads the same memories in the virtual file system, as described in How Interactions Become Memory.
Next steps
- Audit the Patient Graph to list every contradiction between what a patient said and the record in one query.
- From Theory to Practice for the rules a link follows.
Learn Memories from a Transcript
Send the transcripts of conversations that already happened, so the Context Engine learns memories from them.
How Agents Get Patient Context
Why agents read a patient's memory through a file system, the three ways to read it, and why assembled context costs fewer tokens than raw records.