ReplyBrain Docs LLMs

Drafts and Publications

Draft

A draft is a reply ReplyBrain wrote for a case: its words, its channel, and every claim it makes tied to what backs it (an approved answer, a fact your app served). A draft that states something nothing backs is refused before anyone sees it.

Publication

A publication is one attempt to put a draft in front of the customer. It has its own id (publication_id) and an effect_key, the same on every retry, so a reply is never placed twice.

  • Managed (mail). A person approves the draft in the console and it is sent from your mailbox.
  • Connected (your app). ReplyBrain calls your app's message.publish with mode: "draft": your app stores it as a draft in its desk and answers drafted(<your draft id>). A person on your team sends it there. mode: "publish" (your app sends it at once) is only ever used for an app that declares it can check the conversation's turn and send atomically, and the assistant's own words go that way only to an app that also renders their disclosure. By default, your app only ever receives drafts.

Taking a draft back

A draft can lose its backing after it was placed: the answer it quotes is withdrawn, or the facts it states expire. ReplyBrain then asks your app to take it back through message.withdraw. That is why an app that does not serve message.withdraw is sent no assistant draft at all: the case asks a person in ReplyBrain instead. A teammate's own words are unaffected.

valid_until

A draft that states the customer's own facts holds only as long as those facts. An app that declares it enforces it receives valid_until with each such draft and refuses to send it after that time; ReplyBrain also withdraws a draft still unsent at its valid_until. An app that does not declare it is sent no draft resting on the customer's facts; drafts that rest only on your approved answers still go.

Reconciliation

When a call to your app times out, ReplyBrain never sends it again blindly. It asks your app's lookup whether a draft or a message exists for that effect_key, and records what really happened.