Skip to content
Governed learning loop Context Graph Processing Graph Governed corpus How To? 10 reference agents Proof Documentation GitHub Open source Get started
09 / Healthcare

Clinical referrals

A referral agent that can use an outside coding service without sending patient identity with the task.

What this example teachesPseudonymized context on egress

One namespace policy protects every model-facing read while authorized local work stays identified.

Reference agent / keylessCI asserted
Before

A referral desk needs outside coding or model judgment, but privacy logic duplicated across every tool will eventually miss an identifier.

With Areev

One namespace policy pseudonymizes every model-facing read into typed placeholders. The authorized clinic view remains identified and the final letter is rehydrated inside the trusted process.

The processing graph

The job, the gate, and the learning path.

The plan is content-addressed. Each run becomes a journal. The person is an explicit node—not an optimistic note in the system prompt.

01 Referral letter Identified inside the clinic boundary
02 Pseudonymize Typed placeholders on every egress read
03 Code + triage Outside service sees minimum necessary context
04 Clinician review Accept, redirect, or correct
05 Rehydrate letter Identity returns only inside the trusted process
06 Learn protocol Signed correction becomes clinic policy
Where it becomes adaptive

Production history changes the next run—after review.

A clinician’s signed correction becomes the clinic’s own triage rule, allowing the next matching referral to move correctly without waking someone again.

History→Evidence→Proposal→Person→Next run↺
What the example proves

Assertions, not a happy-path demo.

The repository runs the keyless floor on every release. The exact fixtures and expected outcomes are committed beside the agent.

  1. 01

    The wire log is checked against every identifier in every fixture.

  2. 02

    Zero patient identifiers leave the process in the keyless test.

  3. 03

    A signed correction becomes a rule used by the next referral.

Use it as a pattern

What you will learn by rebuilding it.

  • How egress policies cover recall, CAL, trigger context, and run journals together.
  • How typed placeholders support deterministic rehydration inside an authorized boundary.
  • How domain corrections become governed protocol instead of prompt folklore.
Run the two actsno API key required
$ git clone https://github.com/AreevAI/areev
$ cd areev/examples/agents/clinical-referrals
$ python/smoke.sh
$ python/improve.sh
committed fixtures deterministic floor human gates asserted
Read the complete README