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.
- Your EHR, app or script sends an input: FHIR R4, a CDS Hooks request, or JSON over REST.
- The agent's input schema checks it. FHIR input first passes a structural R4 check, then R4 and US Core rules.
- Provider slots answer the agent's questions: rules, an agent service or a language model, each a variant the deployment chooses.
- The decision policy turns the answers into an outcome with thresholds, rules and the agent's risk-level caps. Policy only ever lowers automation.
- The outcome is
AUTO,HUMAN_REVIEW,ABSTAINorBLOCK. - 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
- The API reference: every operation, with its parameters, synthetic examples and "Try it out".
- The OpenAPI document, for code generators and API clients.
- The dashboard: the review queue, the audit trail and evaluations, and Try it, a decision without code.
- The agent store, where the operator has switched it on: your organization's own versions of agents, copied or uploaded, evaluated and promoted by people who sign in. No key reaches it, so it has no example here; its operations are in the API reference under "Agent store".