Mendari sandbox · synthetic data only
Theme

Mendari for developers

Every example and every record here is synthetic.

What Mendari is

Every decision ends in one of four outcomes. Act on the outcome; the recommendation says what to do.

How a decision is made An input passes the agent's input schema, provider slots answer its questions, and the decision policy chooses one of four outcomes, which is recorded. The list beside the picture says the same in words. Your EHR, app or script FHIR R4 · CDS Hooks · REST Input schema checks the input (FHIR: R4, US Core) Provider slots rules · an agent service · a language model Decision policy thresholds, rules, risk-level caps AUTO HUMAN_REVIEW ABSTAIN BLOCK Recorded audit trail · review queue · FHIR Task
  1. Your EHR, app or script sends an input: FHIR R4, a CDS Hooks request, or JSON over REST.
  2. The agent's input schema checks it. FHIR input first passes a structural R4 check, then R4 and US Core rules.
  3. Provider slots answer the agent's questions: rules, an agent service or a language model, each a variant the deployment chooses.
  4. The decision policy turns the answers into an outcome with thresholds, rules and the agent's risk-level caps. Policy only ever lowers automation.
  5. The outcome is AUTO, HUMAN_REVIEW, ABSTAIN or BLOCK.
  6. Every decision is recorded in a hash-chained audit trail. One that needs a person waits in the review queue, and each decision can be read as a FHIR Task.

Quickstart in three calls

List the agents, decide on a synthetic patient message, and read the decision's audit record. The examples need curl and jq. First name the server and, with sign-in on, your API key:

Check outcome, not only the status code: an input that fails the agent's schema is a recorded decision with outcome: BLOCK.

FHIR in, FHIR out

The FHIR base is /fhir. GET /fhir/metadata is its CapabilityStatement, and $decide's OperationDefinition says what the operation takes. POST /fhir/$decide takes Parameters (agent, and data as a Bundle) and returns the decision as a FHIR Bundle, a GuidanceResponse first: act on its outcome, not its status. Decisions are read and searched as Task, and their audit trail as AuditEvent and Provenance, your organization's only. Mendari is a decision engine, not a FHIR data server: it stores and serves no clinical resources.

CDS Hooks

GET /cds-services lists the services, one per agent that declares a hook (the discover permission: every role, and a key or token scoped to decide; never an EHR launch), and POST /cds-services/{id} decides on a hook's context and prefetch (decide), answering with cards. A part of the record it cannot read gives a recorded ABSTAIN and an info card that says what. A card's uuid is its decision's id, and POST /cds-services/{id}/feedback records what the clinician did with it, accepted or overridden, as codes and ids only. An EHR calls them with a key from the cds-hooks preset or, once the deployment registers it (MENDARI_CDS_CLIENTS), with its own signed token. With sign-in off, they answer on this machine only.

SMART on FHIR

Authentication

What each call needs

Reference and more