jido_chat is the core adapter contract and canonical data model for Jido.Chat integrations.
This package is being prepared for the Jido 1.x chat package release line.
Jido.Chat is an Elixir implementation aligned to the Vercel Chat SDK
(chat-sdk.dev/docs).
This package is intentionally scoped to the adapter layer:
jido_chatowns typed content/event models, adapter contracts, typed thread/channel handles, and deterministic fallback behavior.jido_messagingowns supervised runtime concerns such as webhook ingress, delivery queues, retries, room/session state, bridge lifecycle, and process trees.
It provides:
Jido.Chatas a lightweight struct + event-loop facade for local/in-memory flows- typed thread and channel handles (
Thread,ChannelRef) - canonical outbound payloads (
Postable,PostPayload,FileUpload,StreamChunk) - rich content models (
Markdown,Card,Modal,ModalResponse) - typed normalized inbound/event payloads (
Incoming,Message,SentMessage,Response,EventEnvelope) - explicit adapter capability negotiation and fallback behavior (
Jido.Chat.Adapter,CapabilityMatrix) - lightweight state and concurrency hooks used by
Jido.Chattoday (StateAdapter,Concurrency) - framework-agnostic AI history conversion (
Jido.Chat.AI)
def deps do
[
{:jido_chat, github: "agentjido/jido_chat", branch: "main"}
]
endJido.Chat.Adapter is the canonical contract for new integrations.
Jido.Chat.ChannelRef and Jido.Chat.Thread are the typed handles for room and thread operations.
Adapters can expose native rich posting through post_message/3, which receives the full
typed Jido.Chat.PostPayload including attachments. send_file/3 remains the low-level
upload hook used by the core fallback path for single-upload posts.
- Implement the required
Jido.Chat.Adaptercallbacks for your transport. - Declare explicit surface support through
capabilities/0instead of relying on callback inference. - If you build directly on the lightweight
Jido.Chatfacade and ship a customJido.Chat.StateAdapter, implementlock/5,release_lock/3, andforce_release_lock/2, and persistlockspluspending_locksin snapshots. - Treat
Jido.Chat.PostPayloadas the canonical outbound contract. It can now carry text, markdown, raw payloads, cards, streams, attachments, andFileUploadvalues. - Run
mix qualityandmix coverallsbefore publishing adapter changes. Release candidates should meet the current Jido coverage threshold.
chat =
Jido.Chat.new(
user_name: "jido",
adapters: %{telegram: Jido.Chat.Telegram.Adapter}
)
|> Jido.Chat.on_new_mention(fn thread, incoming ->
Jido.Chat.Thread.post(thread, "hi #{incoming.display_name || "there"}")
end)ai_messages = Jido.Chat.AI.to_messages(history, include_names: true)
payload =
Jido.Chat.PostPayload.new(%{
text: "Hello",
files: [%{path: "/tmp/report.pdf", filename: "report.pdf"}]
})Jido.Chatincludes lightweight subscription/state/concurrency hooks today so the core facade can run locally without a larger runtime.- Production ingress, retries, room/session state, and supervised delivery orchestration belong in
jido_messaging, not this package. - The AI conversion helpers are structurally compatible with Chat SDK / AI SDK message shapes, but they keep Elixir-native naming and callback conventions.
The package-level parity matrix and migration notes are tracked in the
proj_jido_chat workspace while this package is moving through the 1.x release
batch.