Inspection-ready pharmacovigilance AI

Draft ICSRs and detect safety signals in minutes with an agent that proposes but never files — grounded in the source case to cut hallucination, with a validated, tamper-evident audit trail FDA and EMA now expect. Self-hosted, so patient data and IP never leave your environment.

Evaluating for a technical champion? Self-host in one docker compose, then bring us to your QPPV.

The pain we built this for

If you run a drug-safety or pharmacovigilance operation, the math is against you: “Case volume climbs 20–30% a year, every ICSR is a regulatory clock, our narrative quality is reviewer-dependent, and the one thing we cannot ship is a hallucinated adverse-event fact — so we can’t just point an LLM at it.”

  • ICSR volume grows every year while headcount does not — intake, triage, coding, and narrative writing all compete for the same reviewers against the same regulatory clock.
  • A generic LLM is disqualified on day one: a single hallucinated causality or seriousness statement in a safety narrative is not a bug, it is a compliance event.
  • Signals hide in the case series. By the time manual triage clusters the related reports, the pattern is weeks old.
  • 2026 FDA and EMA guidance expects AI in safety workflows to be explainable, validated, human-in-the-loop, and inspection-ready — not a black box that files on its own.
  • You cannot send patient narratives or proprietary signal data to a third-party AI API — so most "AI PV" offerings are off the table before the first demo.

See it — a drafting agent that can’t file, on a ledger that can’t be altered

This is the whole control model in a handful of SQL statements: an agent bounded to propose, a source-grounded draft, and an encrypted, tamper-evident audit ledger an inspector can verify.

-- A drug-safety drafting agent that PROPOSES but never files.
CREATE AGENT pv_case_drafter
  PERSONA 'You are a pharmacovigilance case processor. Draft the ICSR
           narrative ONLY from the cited source-case fields. If a fact is
           not in the case, say so — never invent it. Propose seriousness
           and causality for a qualified reviewer to confirm.'
  ALLOW_WRITES FALSE;                 -- proposes; a human approves

-- The inspection-ready audit ledger: tamper-evident + encrypted at rest.
CREATE IMMUTABLE TABLE pv_audit (
  case_id      TEXT,
  drafted_by   TEXT,
  model_version TEXT,
  sources      JSONB,                 -- exactly which case fields grounded it
  draft        TEXT,
  reviewed_by  TEXT,
  decision     TEXT                   -- approved / edited / rejected
) WITH (ENCRYPTION = 'AES256GCM');

-- Draft one case, grounded in its own record.
SELECT AGENT_RUN(
  'pv_case_drafter',
  'Draft the ICSR narrative for case ' || :case_id ||
  ' using only the reporter narrative, dechallenge/rechallenge, and
    concomitant medications on file. Cite each field you use.'
);

-- Later, for the inspector: prove the trail was never altered.
VERIFY TABLE pv_audit;

Seven safety workflows. One self-hosted stack.

Prove what the agent drafted, prove the record wasn’t altered, and prove nothing left your environment — in one engine, not a stitched-together pipeline.

ICSR intake & auto-draft — proposed, never filed

The case-drafter agent reads the inbound report, proposes seriousness and a causality assessment, and drafts the narrative. It runs with allow_writes=FALSE: it surfaces a draft for a qualified reviewer, and the human approves. The model proposes; the person decides.

CREATE AGENT · allow_writes=FALSE · GENERATE
Source-grounded narratives to cut hallucination

Every drafted sentence is grounded in — and cites — the specific case fields it drew from. Retrieval-augmented generation over your own case data means the narrative traces to evidence, not to model priors. Ungrounded claims are flagged for review.

Vector RAG · EMBED · citation grounding
Signal detection over the case series

Cluster related cases by narrative meaning and structured fields to surface emerging safety signals earlier than manual triage — disproportionality on top of semantic clustering, all in SQL over the same store that holds the cases.

Vector clustering · SQL analytics
Duplicate & related-case detection

Find near-duplicate reports and related cases across product, reaction, and reporter before they inflate the count — semantic similarity plus a relationship graph, so a reviewer sees the whole cluster, not one row.

Vector similarity · property graph
MedDRA coding assistance

Suggest MedDRA Preferred Terms by meaning from the verbatim reporter language, ranked with confidence, for coder confirmation — consistent coding without hard-coding a brittle dictionary lookup.

EMBED · semantic match
Validated, inspection-ready audit ledger

Every draft, source, model version, edit, and approval writes to a hash-chained immutable table. VERIFY TABLE proves nothing was altered. Replay exactly what the algorithm knew when a case was assessed — the reconstructable trail an inspector asks for.

CREATE IMMUTABLE TABLE · AES256GCM · VERIFY TABLE

The objections a safety lead raises first

Data residency, AI trust, validation, and footprint — answered before you have to ask.

Data residency & patient privacy

Fully self-hosted with local inference. No narrative, identifier, or signal ever transits a third-party AI API — embeddings and generation run inside your environment. The cloud-LLM data-processing question never comes up.

Is the AI trustworthy enough for safety data?

The agent is bounded by an allowlist and allow_writes=FALSE — it drafts and proposes, a qualified reviewer approves, and nothing files autonomously. Grounded citations make every claim checkable. Trust is engineered, not assumed.

Validation & inspection readiness

The audit ledger is tamper-evident and replayable; VERIFY TABLE gives you cryptographic proof of integrity. It complements your validated safety system rather than replacing it, so it fits an existing GxP validation posture.

Implementation & footprint

One docker compose brings up the engine; recipes are runnable SQL you adapt, not a bespoke ML build. It runs on modest hardware — vector, graph, and the audit ledger fit in a small footprint; the drafting model can be local or a cloud endpoint you control.

Run it yourself — the pharmacovigilance recipe library

Every claim on this page is a runnable recipe. These are the grounding, traceability, and deduplication patterns behind the workflows above — each certified against the latest release.

Why one engine beats a stitched pipeline

  • The vector RAG that grounds a narrative, the graph that clusters related cases, the agent that drafts it, and the immutable ledger that proves it — all in the same database, so the audit trail is complete by construction.
  • No copy of patient data crossing a network boundary to a separate vector store or a cloud model — one self-hosted engine, one security review.
  • Recipes are SQL you can read, validate, and adapt — not an opaque ML service you have to trust.

5-email course · free

Ship an agent with persistent memory in 5 emails

A 5-email course where you build a real agent with persistent memory — one runnable SQL recipe per email, no LangChain, no Pinecone, no Redis. Lesson 1 hits your inbox the second you sign up. After that: a new recipe every Monday. No spam.

Free forever. We'll never share your email.

Safety at the speed of the case volume — without the audit debt

An agent that drafts and proposes, grounding that cuts hallucination, a validated tamper-evident trail for the inspector, and self-hosting so nothing leaves. Book a walkthrough on your own cases, or self-host the free Community Edition today.