Messaging and notification system for the Jido ecosystem.
Usage
Define a messaging module in your application:
defmodule MyApp.Messaging do
use Jido.Messaging,
persistence: Jido.Messaging.Persistence.ETS
endAdd it to your supervision tree:
children = [
MyApp.Messaging
]Use the API:
{:ok, room} = MyApp.Messaging.create_room(%{type: :direct, name: "Chat"})
{:ok, message} = MyApp.Messaging.save_message(%{
room_id: room.id,
sender_id: "user_123",
role: :user,
content: [%{type: :text, text: "Hello!"}]
})
{:ok, messages} = MyApp.Messaging.list_messages(room.id)For app-level chat commands that should notify realtime consumers, use the eventful command APIs:
{:ok, result} = MyApp.Messaging.post_message(%{
room_id: room.id,
sender_id: "user_123",
role: :user,
content: [%{type: :text, text: "Hello!"}]
})
[%Jido.Signal{type: "jido.messaging.room.message_added"}] = result.signalssave_message/1 remains the low-level persistence primitive. post_message/2
persists and emits committed jido.messaging.* CloudEvents through the
instance Signal Bus.
Summary
Functions
Add a participant reaction to a message and emit a committed reaction signal.
Advance an onboarding flow.
Assign a thread to an agent.
Fetch runtime status for one bridge worker.
Cancel an onboarding flow.
Complete an onboarding flow.
Create or ensure a bridge-backed room topology in one idempotent call.
Create a new participant
Create a new room
Create a binding between an internal room and an external platform
Delete bridge config.
Delete adapter-scoped provider ingress subscription for a bridge.
Delete a message
Delete a room
Delete a room binding
Delete room routing policy.
Lookup a single directory entry.
Search directory entries.
Dispatch a custom room-scoped Jido Signal event.
Ensure adapter-scoped provider ingress subscription for a bridge.
Fetch bridge config by id.
Get a message by ID
Get a message by its external ID within a channel/instance context
Fetch an onboarding flow.
Get or create participant by external ID
Get or create room by external binding
Get a participant by ID
Get a room by ID
Get room by external binding (without creating)
Fetch room routing policy.
Get a thread by ID
Get a thread by external thread ID
Get a thread by root message ID
List registered agents for a room.
List bridge configs.
List runtime status for all bridge workers.
List running bridge workers for an instance module.
List adapter-scoped provider ingress subscriptions for a bridge.
List messages for a room
List all bindings for a room
List rooms
List threads for a room
Emit a canonical participant joined signal for a room.
Emit a canonical participant left signal for a room.
Emit a canonical participant presence changed signal.
Emit a canonical participant typing signal.
Persist a message and emit the committed jido.messaging.room.message_added signal.
Create or update bridge config.
Create or update room routing policy.
Register an agent with a room.
Remove a participant reaction from a message and emit a committed reaction signal.
Resolve configured outbound adapter routes for a room.
Resume an onboarding flow.
Return raw timeline and thread grouping for a room.
Route outbound text through bridge bindings/policy for a room.
Route direct payload through bridge-config transform path into ingest.
Route webhook payload through bridge-config parse/verify path into ingest.
Route webhook request and return typed response + ingest outcome.
Save a message
Save an already-constructed message struct (for updates)
Save a room struct directly (for custom IDs)
Save a thread
Save an already-constructed thread struct (for updates)
Start (or resume) an onboarding flow.
Subscribe to Jido Signal events for an instance module.
Fetch thread assignment for a room thread.
Unassign a thread.
Unregister an agent from a room.
Unsubscribe from a Jido Signal Bus subscription.
Update a message's external_id
Find onboarding worker PID.
Functions
Add a participant reaction to a message and emit a committed reaction signal.
Advance an onboarding flow.
Assign a thread to an agent.
Fetch runtime status for one bridge worker.
Cancel an onboarding flow.
Complete an onboarding flow.
Create or ensure a bridge-backed room topology in one idempotent call.
This helper ensures:
- optional bridge configs are upserted
- room exists
- bridge-scoped room bindings exist
- optional routing policy exists
Create a new participant
Create a new room
Create a binding between an internal room and an external platform
Delete bridge config.
Delete adapter-scoped provider ingress subscription for a bridge.
Delete a message
Delete a room
Delete a room binding
Delete room routing policy.
Lookup a single directory entry.
Search directory entries.
Dispatch a custom room-scoped Jido Signal event.
Ensure adapter-scoped provider ingress subscription for a bridge.
Fetch bridge config by id.
Get a message by ID
Get a message by its external ID within a channel/instance context
Fetch an onboarding flow.
Get or create participant by external ID
Get or create room by external binding
Get a participant by ID
Get a room by ID
Get room by external binding (without creating)
Fetch room routing policy.
Get a thread by ID
Get a thread by external thread ID
Get a thread by root message ID
List registered agents for a room.
List bridge configs.
List runtime status for all bridge workers.
List running bridge workers for an instance module.
List adapter-scoped provider ingress subscriptions for a bridge.
List messages for a room
List all bindings for a room
List rooms
List threads for a room
Emit a canonical participant joined signal for a room.
This is a transport-agnostic helper for apps that receive participant lifecycle information from Phoenix Presence, adapters, polling, or any other source.
Emit a canonical participant left signal for a room.
Emit a canonical participant presence changed signal.
Emit a canonical participant typing signal.
Persist a message and emit the committed jido.messaging.room.message_added signal.
This is the eventful command API for chat apps. save_message/2 remains the
low-level persistence primitive for migrations, imports, and tests that need
no side effects.
Create or update bridge config.
Create or update room routing policy.
Register an agent with a room.
Remove a participant reaction from a message and emit a committed reaction signal.
Resolve configured outbound adapter routes for a room.
Resume an onboarding flow.
Return raw timeline and thread grouping for a room.
This helper returns canonical message structs grouped into top-level timeline messages, thread replies, and reply counts. Apps still own their user-facing chat context and UI projections.
Route outbound text through bridge bindings/policy for a room.
Route direct payload through bridge-config transform path into ingest.
Route webhook payload through bridge-config parse/verify path into ingest.
Route webhook request and return typed response + ingest outcome.
Save a message
Save an already-constructed message struct (for updates)
Save a room struct directly (for custom IDs)
Save a thread
Save an already-constructed thread struct (for updates)
Start (or resume) an onboarding flow.
Subscribe to Jido Signal events for an instance module.
Fetch thread assignment for a room thread.
Unassign a thread.
Unregister an agent from a room.
Unsubscribe from a Jido Signal Bus subscription.
Update a message's external_id
Find onboarding worker PID.