Skip to main content

Messages between agents

One agent can pass a message to another agent about one of that agent's people. For example, a scheduling agent can ask a patient's agent to offer a new appointment time. The receiving agent decides what to say to its person under its own instructions. The flow is sender → receiving agent → person.

Agent messaging is off by default and works in one direction only. You choose which agents a sender may message.

In the app​

  1. Choose Agents, then Settings on the sender's tile, then the Permissions tab.
  2. In the CatalEx card, expand Message other agents and tick only the agents the sender needs. Each is marked On this computer or On your other computers (the second while connected). An agent can message at most 20 others, and one that already messages this agent is disabled.
  3. The change saves at once and applies from the sender's next message.

Once the sender has a list, the same row shows Messages to other agents: each message with the receiving agent, the person and its state, newest first. Choose a row for its details, Show older for more, or Message another agent to send one yourself. Pick the agent, the person (one of its native chats) and the text.

To get the person reference for the CLI, open the receiving agent's native chat. While some agent can message that agent, its header shows Person ref ct_… with Copy person ref and the tip Other agents use this to message this person through this agent. A chat without a reference, or an agent that nothing can message, shows neither. To retry after a lost answer or a retry-later refusal, choose Send again; the same message is never delivered twice.

With the CLI​

catalex agents list
catalex agents edit SENDER_AGENT_ID --delegate-to RECEIVER_AGENT_ID

--delegate-to replaces the sender's whole list; separate several IDs with commas. --delegate-to none clears it. An agent cannot message itself, and a removed or unavailable agent receives nothing. Avoid reciprocal or chained routes: a received message cannot loop back through other agents.

Send and follow a message​

The agent sends these messages itself with its CatalEx tool. You can send one on its behalf, from the app as above or from a script:

catalex delegations send SENDER_AGENT_ID --to CONTACT_REF --text "The appointment moved to 3 pm." --idempotency-key appointment-42-moved

--to is the receiving agent's reference for the person (ct_...), read from that agent's chat. Use --to-chat CHAT_ID instead to name the person by the receiving agent's native chat. Reuse the same --idempotency-key for every retry of the same message; a retry never sends it twice.

catalex delegations list SENDER_AGENT_ID
catalex delegations status SENDER_AGENT_ID MESSAGE_ID

The Messages to other agents list shows each state in the app, and the CLI prints the status:

StateCLI statusMeaning
WaitingqueuedWaiting for the receiving agent's turn
With the agentdelivered_to_agentThe receiving agent has the message and is working on it
Doneturn_doneThe receiving agent finished its turn
Not deliveredheldThe receiving agent's chat was busy or recovering; send it again to retry
FailedfailedThe receiving agent's turn did not finish

Done means the receiving agent handled the message, not that the person received a reply. Check the receiving conversation and the actual delivery to the person, especially for appointment notices and other time-sensitive messages. A refusal keeps its code, such as DELEGATE_NOT_ALLOWED, DELEGATE_TARGET_UNKNOWN or DELEGATE_ROUTE_UNAVAILABLE.

Test before using it for real people​

Use test conversations for both roles. Send one allowed message, confirm the receiving agent's reply to its person, and check that a sender without permission is refused. Keep each role in its own folder with its own tool permissions, and make sure per-person tools select the right identity for each chat. Do not copy private details into another person's chat to work around an unknown identity.

To message a person directly rather than through another agent, see Messages the agent starts.