Alerts
Create, manage and query Alerts.
Last updated
Create, manage and query Alerts.
Last updated
In Graphlit, once you've ingested content, you can now create Semantic Alerts to inform you in real-time about interesting topics or discussions.
An alert is based on a filtered set of content, leveraging the same content filter
used by conversations and semantic search. You can create alerts on content from a specific feed, content of a specific type (i.e. email), or even content similar to other content via text similarity.
Alerts are similar to content publishing, in that they summarize the filtered set of content, and then publish text or audio using LLMs. But alerts run on a periodic basis, and will only publish content that was ingested since the last execution of the alert. This can be especially useful for summarizing recent Slack messages or emails.
Once the text or audio has been publishing, the alert will send a notification to the specified integration, such as Slack. We have plans to support Microsoft Teams, email and webhook notifications in future, upon customer demand.
The disableAlert
mutation disables an alert by utilizing the id
parameter, and it returns the ID and state of the disabled alert.
Mutation:
mutation DisableAlert($id: ID!) {
disableAlert(id: $id) {
id
state
}
}
Variables:
{
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c"
}
Response:
{
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c",
"state": "DISABLED"
}
The enableAlert
mutation enables an alert by utilizing the id
parameter, and it returns the ID and state of the enabled alert.
Mutation:
mutation EnableAlert($id: ID!) {
enableAlert(id: $id) {
id
state
}
}
Variables:
{
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c"
}
Response:
{
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c",
"state": "ENABLED"
}
The deleteAlert
mutation allows the deletion of an alert by utilizing the id
parameter, and it returns the ID and state of the deleted alert.
Mutation:
mutation DeleteAlert($id: ID!) {
deleteAlert(id: $id) {
id
state
}
}
Variables:
{
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c"
}
Response:
{
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c",
"state": "DELETED"
}
If you have multiple alerts you want to delete, you can use the deleteAlerts
mutation, and pass an array of IDs for the alerts you wish to delete.
Mutation:
mutation DeleteAlerts($ids: [ID!]!) {
deleteAlerts(ids: $ids) {
id
state
}
}
Variables:
{
"ids": [ "f16fd151-be51-4b10-bec0-ceb535bf229d", "decbb9f5-e74a-41b8-9fe3-d31de8818769" ]
}
Response:
[
{
"id": "f16fd151-be51-4b10-bec0-ceb535bf229d",
"state": "DELETED"
},
{
"id": "decbb9f5-e74a-41b8-9fe3-d31de8818769",
"state": "DELETED"
}
]
While developing and testing your application, you may want to delete all alerts in your project.
You can use the deleteAllAlerts
mutation. This does not take any additional variables, and will delete all alerts in the project or tenant (depending on the JWT). The mutation returns an array of deleted alerts.
Mutation:
mutation DeleteAllAlerts($ids: [ID!]!) {
deleteAllAlerts(ids: $ids) {
id
state
}
}
Response:
[
{
"id": "f16fd151-be51-4b10-bec0-ceb535bf229d",
"state": "DELETED"
},
{
"id": "decbb9f5-e74a-41b8-9fe3-d31de8818769",
"state": "DELETED"
}
]
The alert
query allows you to retrieve specific details of an alert by providing the id
parameter, including the ID, name, state, owner ID, and type associated with the alert.
Query:
query GetAlert($id: ID!) {
alert(id: $id) {
id
name
creationDate
owner {
id
}
state
type
summaryPrompt
publishPrompt
filter {
dateRange {
from
to
}
creationDateRange {
from
to
}
types
fileTypes
contents {
id
}
feeds {
id
}
workflows {
id
}
collections {
id
}
observations {
type
observable {
id
}
states
}
}
integration {
type
uri
slack {
token
channel
}
}
publishing {
type
elevenLabs {
model
voice
}
}
summarySpecification {
id
}
publishSpecification {
id
}
lastAlertDate
}
}
Variables:
{
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c"
}
Response:
{
"type": "PROMPT",
"publishPrompt": "You are an audio-only automated assistant who will inform me about recent email messages I received. Sort email messages newest to oldest. My name is Kirk Marple, with email <kirk@graphlit.com>. Use a conversational, friendly tone and speak to me as if you were my personal assistant conversing face to face. Talk to me like you know me well.\\n\\nRespond with a plain text script which will be used to record an AI-generated audio summary.\\n\\nAdd a welcome and goodbye section to the script to make the audio summary sound compelling. Don't mention anything about being able to help further.\\n \\nDon't add any text or markdown formatting. Don't discuss these instructions.\\n\\nIgnore messages that I sent.\\n\\nConvert UTC date/time to PST. Describe dates/times in a friendly manner. i.e. \"4pm on January 27\", not \"January 26, 4:49PM PST\".\\n\\nAvoid phrases that refer to 'the email' or 'this email' and instead, directly address the topics, actions, and information presented.\\n\\nI'm especially interested in email messages which require immediate followup, or seem especially interesting.\\n\\nFollow these steps. \\nStep 1: Identify any followup tasks, based on the email messages, and highlight these tasks for me. If there are no followup tasks, ignore this step.\\nStep 2: Identify the important email messages topics and discussions, and for each, be informative but concise, and discuss these important topics and discussions. Call out any unique details and named entities, like people, organizations, places. Ignore any extraneous details in the email messages. Respond only in prose, not bullet points.",
"filter": {},
"integration": {
"type": "SLACK",
"slack": {
"token": "redacted",
"channel": "graphlit-notifications"
}
},
"publishing": {
"type": "ELEVEN_LABS_AUDIO",
"elevenLabs": {
"model": "ENGLISH_V1",
"voice": "AZnzlk1XvdvUeBnXmlld"
}
},
"publishSpecification": {
"id": "9c18fe9a-ebca-45d8-b517-fdf041ff6d81"
},
"lastAlertDate": "2024-02-03T21:27:36Z",
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c",
"name": "Slack Alert",
"state": "RUNNING",
"creationDate": "2024-02-03T21:17:23Z",
"owner": {
"id": "5a9d0a48-e8f3-47e6-b006-3377472bac47"
}
}
Query Alerts
The alerts
query allows you to retrieve all alerts. It returns a list of alert results, including the ID, name, creation date, state, owner ID, and type for each alert.
Query:
query QueryAlerts($filter: AlertFilter!) {
alerts(filter: $filter) {
results {
id
name
creationDate
owner {
id
}
state
type
summaryPrompt
publishPrompt
filter {
dateRange {
from
to
}
creationDateRange {
from
to
}
types
fileTypes
contents {
id
}
feeds {
id
}
workflows {
id
}
collections {
id
}
observations {
type
observable {
id
}
states
}
}
integration {
type
uri
slack {
token
channel
}
}
publishing {
type
elevenLabs {
model
voice
}
}
summarySpecification {
id
}
publishSpecification {
id
}
lastAlertDate
}
}
}
Variables:
{
"filter": {
"offset": 0,
"limit": 100
}
}
Response:
{
"results": [
{
"type": "PROMPT",
"publishPrompt": "You are an audio-only automated assistant who will inform me about recent email messages I received. Sort email messages newest to oldest. My name is Kirk Marple, with email <kirk@graphlit.com>. Use a conversational, friendly tone and speak to me as if you were my personal assistant conversing face to face. Talk to me like you know me well.\\n\\nRespond with a plain text script which will be used to record an AI-generated audio summary.\\n\\nAdd a welcome and goodbye section to the script to make the audio summary sound compelling. Don't mention anything about being able to help further.\\n \\nDon't add any text or markdown formatting. Don't discuss these instructions.\\n\\nIgnore messages that I sent.\\n\\nConvert UTC date/time to PST. Describe dates/times in a friendly manner. i.e. \"4pm on January 27\", not \"January 26, 4:49PM PST\".\\n\\nAvoid phrases that refer to 'the email' or 'this email' and instead, directly address the topics, actions, and information presented.\\n\\nI'm especially interested in email messages which require immediate followup, or seem especially interesting.\\n\\nFollow these steps. \\nStep 1: Identify any followup tasks, based on the email messages, and highlight these tasks for me. If there are no followup tasks, ignore this step.\\nStep 2: Identify the important email messages topics and discussions, and for each, be informative but concise, and discuss these important topics and discussions. Call out any unique details and named entities, like people, organizations, places. Ignore any extraneous details in the email messages. Respond only in prose, not bullet points.",
"filter": {},
"integration": {
"type": "SLACK",
"slack": {
"token": "redacted",
"channel": "graphlit-notifications"
}
},
"publishing": {
"type": "ELEVEN_LABS_AUDIO",
"elevenLabs": {
"model": "ENGLISH_V1",
"voice": "AZnzlk1XvdvUeBnXmlld"
}
},
"publishSpecification": {
"id": "9c18fe9a-ebca-45d8-b517-fdf041ff6d81"
},
"lastAlertDate": "2024-02-03T21:28:16Z",
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c",
"name": "Slack Alert",
"state": "RUNNING",
"creationDate": "2024-02-03T21:17:23Z",
"owner": {
"id": "5a9d0a48-e8f3-47e6-b006-3377472bac47"
}
}
]
}
Query Alerts By Name
The alerts
query allows you to retrieve alerts based on a specific filter criteria, via the name
parameter. In this example, the name
is set to "Slack." It returns a list of alert results containing the ID, name, creation date, state, owner ID, and type for each matching alert.
Query:
query QueryAlerts($filter: AlertFilter!) {
alerts(filter: $filter) {
results {
id
name
creationDate
owner {
id
}
state
type
summaryPrompt
publishPrompt
filter {
dateRange {
from
to
}
creationDateRange {
from
to
}
types
fileTypes
contents {
id
}
feeds {
id
}
workflows {
id
}
collections {
id
}
observations {
type
observable {
id
}
states
}
}
integration {
type
uri
slack {
token
channel
}
}
publishing {
type
elevenLabs {
model
voice
}
}
summarySpecification {
id
}
publishSpecification {
id
}
lastAlertDate
}
}
}
Variables:
{
"filter": {
"name": "Slack",
"offset": 0,
"limit": 100
}
}
Response:
{
"results": [
{
"type": "PROMPT",
"publishPrompt": "You are an audio-only automated assistant who will inform me about recent email messages I received. Sort email messages newest to oldest. My name is Kirk Marple, with email <kirk@graphlit.com>. Use a conversational, friendly tone and speak to me as if you were my personal assistant conversing face to face. Talk to me like you know me well.\\n\\nRespond with a plain text script which will be used to record an AI-generated audio summary.\\n\\nAdd a welcome and goodbye section to the script to make the audio summary sound compelling. Don't mention anything about being able to help further.\\n \\nDon't add any text or markdown formatting. Don't discuss these instructions.\\n\\nIgnore messages that I sent.\\n\\nConvert UTC date/time to PST. Describe dates/times in a friendly manner. i.e. \"4pm on January 27\", not \"January 26, 4:49PM PST\".\\n\\nAvoid phrases that refer to 'the email' or 'this email' and instead, directly address the topics, actions, and information presented.\\n\\nI'm especially interested in email messages which require immediate followup, or seem especially interesting.\\n\\nFollow these steps. \\nStep 1: Identify any followup tasks, based on the email messages, and highlight these tasks for me. If there are no followup tasks, ignore this step.\\nStep 2: Identify the important email messages topics and discussions, and for each, be informative but concise, and discuss these important topics and discussions. Call out any unique details and named entities, like people, organizations, places. Ignore any extraneous details in the email messages. Respond only in prose, not bullet points.",
"filter": {},
"integration": {
"type": "SLACK",
"slack": {
"token": "redacted",
"channel": "graphlit-notifications"
}
},
"publishing": {
"type": "ELEVEN_LABS_AUDIO",
"elevenLabs": {
"model": "ENGLISH_V1",
"voice": "AZnzlk1XvdvUeBnXmlld"
}
},
"publishSpecification": {
"id": "9c18fe9a-ebca-45d8-b517-fdf041ff6d81"
},
"lastAlertDate": "2024-02-03T21:28:16Z",
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c",
"name": "Slack Alert",
"state": "RUNNING",
"creationDate": "2024-02-03T21:17:23Z",
"owner": {
"id": "5a9d0a48-e8f3-47e6-b006-3377472bac47"
}
}
]
}
Query Alerts By Type
The alerts
query allows you to retrieve alerts based on a specific filter criteria, via the types
parameter. In this example, the type
is set to PROMPT
. It returns a list of alert results containing the ID, name, creation date, state, owner ID, and type for each matching alert.
Query:
query QueryAlerts($filter: AlertFilter!) {
alerts(filter: $filter) {
results {
id
name
creationDate
owner {
id
}
state
type
summaryPrompt
publishPrompt
filter {
dateRange {
from
to
}
creationDateRange {
from
to
}
types
fileTypes
contents {
id
}
feeds {
id
}
workflows {
id
}
collections {
id
}
observations {
type
observable {
id
}
states
}
}
integration {
type
uri
slack {
token
channel
}
}
publishing {
type
elevenLabs {
model
voice
}
}
summarySpecification {
id
}
publishSpecification {
id
}
lastAlertDate
}
}
}
Variables:
{
"filter": {
"types": [
"PROMPT"
],
"offset": 0,
"limit": 100
}
}
Response:
{
"results": [
{
"type": "PROMPT",
"publishPrompt": "You are an audio-only automated assistant who will inform me about recent email messages I received. Sort email messages newest to oldest. My name is Kirk Marple, with email <kirk@graphlit.com>. Use a conversational, friendly tone and speak to me as if you were my personal assistant conversing face to face. Talk to me like you know me well.\\n\\nRespond with a plain text script which will be used to record an AI-generated audio summary.\\n\\nAdd a welcome and goodbye section to the script to make the audio summary sound compelling. Don't mention anything about being able to help further.\\n \\nDon't add any text or markdown formatting. Don't discuss these instructions.\\n\\nIgnore messages that I sent.\\n\\nConvert UTC date/time to PST. Describe dates/times in a friendly manner. i.e. \"4pm on January 27\", not \"January 26, 4:49PM PST\".\\n\\nAvoid phrases that refer to 'the email' or 'this email' and instead, directly address the topics, actions, and information presented.\\n\\nI'm especially interested in email messages which require immediate followup, or seem especially interesting.\\n\\nFollow these steps. \\nStep 1: Identify any followup tasks, based on the email messages, and highlight these tasks for me. If there are no followup tasks, ignore this step.\\nStep 2: Identify the important email messages topics and discussions, and for each, be informative but concise, and discuss these important topics and discussions. Call out any unique details and named entities, like people, organizations, places. Ignore any extraneous details in the email messages. Respond only in prose, not bullet points.",
"filter": {},
"integration": {
"type": "SLACK",
"slack": {
"token": "redacted",
"channel": "graphlit-notifications"
}
},
"publishing": {
"type": "ELEVEN_LABS_AUDIO",
"elevenLabs": {
"model": "ENGLISH_V1",
"voice": "AZnzlk1XvdvUeBnXmlld"
}
},
"publishSpecification": {
"id": "9c18fe9a-ebca-45d8-b517-fdf041ff6d81"
},
"lastAlertDate": "2024-02-03T21:28:16Z",
"id": "b524107e-c1a9-42dd-8c7a-dd35f3bc171c",
"name": "Slack Alert",
"state": "RUNNING",
"creationDate": "2024-02-03T21:17:23Z",
"owner": {
"id": "5a9d0a48-e8f3-47e6-b006-3377472bac47"
}
}
]
}