You can connect external sources like GitHub, Slack, Sentry, Datadog, and have your agent act on emitted events using Mastra’s signal system. These events are durable and they have priority.
Agent notification inboxes and priority signals let you build more attentive agents. An AI SRE agent could wake up and try to auto-remediate a 5XX error from Datadog. A personal assistant agent could text you when it receives urgent email in your inbox.
This is not an email inbox though stay tuned.
Before this, you could inject context into an agent's memory thread using sendSignal(), but there wasn't a standard shape for durable records, priority-aware delivery, or a tool agents could use to read notifications and action high priority items.
With notification signals, each event becomes a durable record in the notifications storage domain, keyed by threadId — they contain a source, kind, priority, summary, and any structured payload you want to include.
The createNotificationInboxTool() gives the agent direct access to every record. The delivery policy decides how each is handled — urgent wakes the agent so it can act autonomously, lower priorities stay in the inbox until the agent is asked to read them, and all are persisted in storage and queryable.
Get started
There are three parts to notification signals:
- Send events to the agent with .sendNotificationSignal().
- Give an agent the createNotificationInboxTool().
- Configure the delivery policy to handle event priority.
@mastra/core@1.39.0 or later, added in PR #17241.sendNotificationSignal()
Call sendNotificationSignal() from the server endpoint configured to receive events from external systems.
import { mastra } from "./src/mastra/index";
const agent = mastra.getAgent("sreAgent");
await agent.sendNotificationSignal(
{
source: "datadog",
kind: "incident",
priority: "urgent",
summary: "API returning 503 on /checkout",
payload: { service: "checkout-api", region: "us-east-1" }
},
{ resourceId: "sre-agent", threadId: "demo-thread" }
);createNotificationInboxTool() and deliveryPolicy
import { Agent } from "@mastra/core/agent";
import { LibSQLStore } from "@mastra/libsql";
import { createNotificationInboxTool } from "@mastra/core/notifications";
const storage = new LibSQLStore({ id: "sre-storage", url: "file:./mastra.db" });
const notificationsStorage = await storage.getStore("notifications");
export const sreAgent = new Agent({
// ...
tools: {
notificationInbox: createNotificationInboxTool({ storage: notificationsStorage! })
},
notifications: {
deliveryPolicy: {
priorities: {
low: { action: "discard" },
medium: { action: "defer" },
high: { action: "summarize" },
urgent: { action: "deliver" }
}
}
}
});Priority behavior is fully configurable. See the Agent constructor reference for the full list of actions: deliver, defer, summarize, persist, discard and notifications.deliveryPolicy options.
For more information and full configuration options, see:
