AI Common
  • 29 Oct 2024
  • 3 Minutes to read
  • Dark
    Light

AI Common

  • Dark
    Light

Article summary


Module Details

Core or Github ModuleCore
Requires Restart?No
Steps ExposedYes
Settings Location
  • [Project Name] > Manage > Integrations > AI
Step Location
  • AI > Common 
Requirements

Overview

The AI Common Module is essential for utilizing various AI integrations within the platform. This is a shared module between other AI modules and provides necessary functionalities, tools, and interfaces as a foundational layer for integrating different AI services. 

The Common module is installed when any other AI related module (Google Vertex, AWS Bedrock, etc) is installed. For PostgreSQL users there are three steps that are specific for their environment.

In v9.4 users have access to a Prompt Management Dashboard where they can review created Prompts and how each model used responds to them.


Available Steps

Installing the Module exposes the following steps found in the toolbox at AI > Common, AI > Text Manipulation, AI > Prompt Management, AI > Postgres, and AI > Vector Preparation.

Common

Step NameDescription
Chat CompletionThis step allows for a prompt to be submitted to a large language model (LLM) and will return the response the LLM gives back. Prompts can added directly or pulled from the Flow. Users can also select the model they want to review the prompt.
Get Embedding for TextThis will fetch the embeddings for a Text input to allow review.

Providers

Step NameDescription
Get Chat Completion ModelsThis will list all the models available for a given Provider.
Get Feature NamesFetches a list of all the Feature Names used by a given Provider.
Get ProvidersProduces a list of all available Providers.

Postgres

Step NameDescription
Ensure Postgres Vector ExtensionThis step configures the PostgreSQL database to support vector data storage. It allows setting table and column names to store vector data in PostgreSQL. This step ensures that the necessary extensions are in place for optimal vector data management.
Query Table with Vector DataThis step facilitates querying a PostgreSQL table with vector data. It takes as input the 'Vector Storage Info' and the specific vector to find, which includes a JSON Representation, ReferenceID, and TokenCount. This step is useful for retrieving relevant information based on vector data stored in the PostgreSQL database.
Save Vector Embedding to PostgresThis step allows the storage of vector embeddings in a PostgreSQL table. It takes the 'Vector Storage Info' and the list of vectors to store as input. This step is valuable for saving embeddings generated from various sources into the PostgreSQL database, providing a centralized location for vector data.

Prompt Management

Step NameDescription
Escape Json In TextRemoves JSON specific characters from a string so that the data can be cleanly used elsewhere.
Prepare Text for EmbeddingsThis step allows users to add text that will be used for an embedding within a LLM. There are also pre-built options like stripping out HTML and removing square brackets [ ].
Remove Control Characters From TextUnneeded control characters are removed from an inputted string with this step.
Remove HTMLTags From TextAny text used as an Input for this step will have its HTML removed.
Split Long Text Into ChunksThis step is used for building chunks that an LLM can more easily use. The text to use and the size of the chunk are defined in the step's properties.

Text Manipulation

Step NameDescription
Escape JSON in TextThis step takes in text input containing JSON content and escapes special characters, ensuring proper JSON format. This is useful with textual data that includes JSON content to prevent parsing errors or unintended behavior.
Prepare Text for EmbeddingsThis step is intended for text preprocessing for natural language processing (NLP) tasks. It aims to optimize text data for embedding models.
Remove Control Characters From TextThis step helps to process text inputs and eliminate any control characters present in the text. Control characters are non-printable characters that can cause text processing, display, or interpretation issues. This step ensures that the output text is free from such characters, promoting cleaner and more readable text.
Remove HTML Tags From TextThis step removes HTML tags from the text, ensuring only plain text is left. This is important when dealing with content extracted from web pages or HTML-formatted text.
Split Long Text into ChunksThis step helps break long text into manageable chunks. Useful for data exceeding maximum size and processing limits. This is particularly helpful when dealing with text data that exceeds a specified maximum size, preventing issues related to processing limitations or model constraints.

Vector Preparation

Step NameDescription
Ensure Postgres Vector ExtensionPostgreSQL users can use this step to guarantee a connection with their LLM's vector database.
Query Table With Vector DataThis step will send a query to the AI's vector database and return a specified number of results.
Save Vector Embedding to PostgresPostgreSQL users will need to use this step when saving text embeddings to their database.

Feature Changes

DescriptionVersionRelease DateDeveloper Task
Updated the AI Common module to provide more Steps.9.3October 2024[DT-041798]

Was this article helpful?