Skip to main content

Volatile Knowledge

Introduction

The Volatile Knowledge module allows agents to use files attached by final users on an instance. Serenity* Star automatically analyzes and segments these documents, creates and stores embeddings, and will then use the information obtained throughout the execution.

How to Attach a file

The method for attaching a file to your execution will depend on the channel you are using.

API

To attach a file when executing an agent through the API, you first need to upload the file using the Volatile Knowledge endpoint. Once the file was processed, it can be attached in the Execution endpoint.

Preview

Use the attach file button to attach a file to a message or instance.

image

WhatsApp

If you are using our WhatsApp integration, you can attach files using the WhatsApp interface and they will be directly processed.

How are the files used?

The usage of the file depends on the configuration of the agent and the length of the conversation.

  1. Public URLs for all files: All Volatile Knowledge files are uploaded to the file manager as public files. This ensures that every file, regardless of type, has a public URL reference. The chat history displays the file name and its corresponding public URL for any file uploaded by the user.

  2. Separation of FILES and KNOWLEDGE: Volatile Knowledge files are organized into distinct sections in the chat history:

    • FILES: Contains all Volatile Knowledge files, including their content and public URLs. This section is enclosed between FILES and ENDFILES.
    • KNOWLEDGE: Contains other knowledge sources, ensuring clear distinction.
  3. Message-specific references: Volatile Knowledge files are referenced in the specific message where they were uploaded. For example, if a user uploads a file in a message, the file name and URL are included in that message. The included content of the file is appended to the last message.

  4. Vision support: If the model supports Vision and it is enabled in the agent, the images attached are sent directly to the LLM in the corresponding message. The reference (file name and public URL) is also included in that specific message.

  5. Context-based usage: Depending on the context defined in the agent, the length of the conversation, and the size of the file, the information obtained from the files can either be sent in its entirety or used for similarity search. This ensures that the most relevant information is utilized effectively.

Example Chat History

Here is an example of how the chat history looks:

{
"Role": "assistant",
"Content": "Please provide your ID to proceed."
},
{
"Role": "user",
"Content": "Here is my document FILES\nFile Name: IdExample.jpg\nDownload URL: https://api.serenitystar.ai/api/v2/file/download/public/fake-guid-1234-5678-90ab-cdef12345678\nENDFILES"
},
{
"Role": "assistant",
"Content": "Thank you. Now, please attach your resume."
},
{
"Role": "user",
"Content": "cv FILES\nFile Name: resumeExample.pdf\nDownload URL: https://api.serenitystar.ai/api/v2/file/download/public/fake-guid-8765-4321-ba09-fedcba987654\nProcessed file content...\nENDFILES"
}

You can always see the specific chat history for your execution in the instance details.

image

Tip

If you need to use the files in any related skill such as, sending the file to an API for posting a form or for validating the image, you need to ask the LLM to send the public URL for those files. The LLM doesn't have access to the base 64 of the file, so it can't ask to post the whole file, but it can ask for the public URL to be posted in the API.

An example of this would be to configure the following skill to receive the link of the files attached:

image

Supported File Formats

The following file formats are supported for upload and processing in the Volatile Knowledge module:

FILE FORMATMIME TYPE
.txttext/plain
.pdfapplication/pdf
.docapplication/msword
.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
.csvtext/csv
.mdtext/markdown
.jpg, .jpegimage/jpeg
.pngimage/png