Messages and decisions
Follow inbound messages through delivery, evaluation, replies, and concrete operations.
Message flow
Organic activity or an API call creates an incoming message.
A tick assigns actors and moves due messages into history.
Messages that need action create an organic decision request.
The decision sends a reply, books, changes state, adds a note, or does nothing.
Outbound work runs through local-sim, mock-random, or a connector.
A profile with a pending decision waits before another message is delivered. This keeps a single actor from accumulating contradictory unresolved actions.
Channels and intents
| Dimension | Values |
|---|---|
| Direction | profile-to-practice, practice-to-profile, world-to-profile |
| Channel | sms, email, phone, portal, system |
| Intent | booking, triage, admin, follow-up, emotion, clinical-update, world |
| Source | random-profile, practice-api, test-user, manual, world, agent |
Directions also determine default actor assignment. Profile-to-practice messages select an affiliated clinician or practice staff member; practice replies target the profile; world messages target the affected actor directly.
Evaluation modes
Deterministic
A rules-based evaluator converts booking intent into a booking request and other actionable messages into concrete follow-up tasks.
Ask human
The request remains visible for human review. Submit an evaluator response to /api/simulation/organic when a person has chosen the action.
Ask AI
Claude returns schema-constrained JSON. Praxis validates the action against the request’s available actions and falls back deterministically if generation fails.
Decision actions
| Field | Meaning |
|---|---|
send-message | Create an in-character reply and optionally follow-up work |
create-appointment | Queue a booking request through the booking substrate |
change-profile-state | Apply the response stress delta and create follow-up work |
add-note | Record operational reasoning and create follow-up work |
no-action | Resolve the request without creating an operation or task |
curl -X POST http://localhost:3000/api/simulation/messages \
-H 'Content-Type: application/json' \
-d '{
"profileId":"profile_…",
"direction":"profile-to-practice",
"channel":"sms",
"intent":"booking",
"body":"Could I come in tomorrow afternoon?"
}'