SmartMemory
ExamplesClinical trials

Clinical trial operations

Four runnable examples, each in Python and JavaScript, for a clinical trial operations team that wants a record of what the study decided, when, and on what evidence. They use a fictional Phase II study (KVR-417-201) with four sites, a CRO and a sponsor, all invented for the demo.

ExampleWhat it does
Ingest a monitoring visit reportAdd a new CRA visit report with the visit date as its valid time
Ask an as-of questionWhich consent form version should site 03 have used on 2026-03-03
Provenance of a decisionWho recommended and who decided dose level 2, what was rejected, and the evidence
Export the audit trailDownload the workspace and write one audit line per record

Before you run them

You need the "Clinical trial demo" workspace, an API key for it, and the SmartMemory 2.0 SDKs (the ones whose add returns a save receipt).

pip install smartmemory-client       # Python, 2.0 line
npm install @smartmemory/sdk-js      # JavaScript, 2.0 line

export SMARTMEMORY_API_KEY=...            # your key
export SMARTMEMORY_WORKSPACE_ID=...       # the demo workspace id
# optional, defaults to https://api.smartmemory.ai
# export SMARTMEMORY_BASE_URL=...

The JavaScript files are ES modules. Run them with node 01_ingest_visit_report.mjs and the Python files with python 01_ingest_visit_report.py.

Each example has its own page with the full code: ingest a visit report, ask an as-of question, provenance of a decision, and export the audit trail.

Read more

What this is not

SmartMemory keeps a traceable, exportable record next to your trial systems. It does not make clinical decisions and it does not replace your EDC or CTMS.

On this page