ByteChef LogoByteChef

JDBC Chat Memory

JDBC Chat Memory stores session-based conversation history in a relational database.

Categories: Artificial Intelligence

Type: jdbcChatMemory/v2


Actions

Add Messages

Name: addMessages

Adds messages to a conversation, creating the conversation if it does not exist.

Properties

NameLabelTypeDescriptionRequired
conversationIdConversation IDSTRINGThe unique identifier for the conversation.true
userIdUser IDSTRINGUser id assigned to the conversation when it is created.false
messagesMessagesARRAY
Items [{STRING(role), STRING(content)}]
The messages to add to the conversation.true

Example JSON Structure

{
  "label" : "Add Messages",
  "name" : "addMessages",
  "parameters" : {
    "conversationId" : "",
    "userId" : "",
    "messages" : [ {
      "role" : "",
      "content" : ""
    } ]
  },
  "type" : "jdbcChatMemory/v2/addMessages"
}

Output

Type: OBJECT

Properties

NameTypeDescription
conversationIdSTRING
messageCountINTEGER

Output Example

{
  "conversationId" : "",
  "messageCount" : 1
}

Get Messages

Name: getMessages

Retrieves the messages of a conversation.

Properties

NameLabelTypeDescriptionRequired
conversationIdConversation IDSTRINGThe unique identifier for the conversation.true
includeCompactedHistoryInclude compacted historyBOOLEAN
Options true, false
When off, only the messages the agent currently sees are returned.false

Example JSON Structure

{
  "label" : "Get Messages",
  "name" : "getMessages",
  "parameters" : {
    "conversationId" : "",
    "includeCompactedHistory" : false
  },
  "type" : "jdbcChatMemory/v2/getMessages"
}

Output

Type: OBJECT

Properties

NameTypeDescription
conversationIdSTRING
messagesARRAY
Items [{STRING(role), STRING(content)}]

Output Example

{
  "conversationId" : "",
  "messages" : [ {
    "role" : "",
    "content" : ""
  } ]
}

Delete Conversation

Name: deleteConversation

Deletes a conversation and all of its messages.

Properties

NameLabelTypeDescriptionRequired
conversationIdConversation IDSTRINGThe unique identifier for the conversation.true

Example JSON Structure

{
  "label" : "Delete Conversation",
  "name" : "deleteConversation",
  "parameters" : {
    "conversationId" : ""
  },
  "type" : "jdbcChatMemory/v2/deleteConversation"
}

Output

Type: OBJECT

Properties

NameTypeDescription
conversationIdSTRING
deletedBOOLEAN
Options true, false

Output Example

{
  "conversationId" : "",
  "deleted" : false
}

List Conversations

Name: listConversations

Lists the conversation IDs of a user.

Properties

NameLabelTypeDescriptionRequired
userIdUser IDSTRINGLists the conversations of this user.false

Example JSON Structure

{
  "label" : "List Conversations",
  "name" : "listConversations",
  "parameters" : {
    "userId" : ""
  },
  "type" : "jdbcChatMemory/v2/listConversations"
}

Output

Type: OBJECT

Properties

NameTypeDescription
conversationIdsARRAY
Items [STRING]
countINTEGER

Output Example

{
  "conversationIds" : [ "" ],
  "count" : 1
}

How is this guide?

Last updated on

On this page