AI Data as Data Source

Add an AI Data node to your Data Flow to use content from files that need to be processed by AI before they can be used as a data source in your workflow. You can drag and drop images, entire documents (like PDF, Word, PowerPoint), audio files and even video - or any other supported file type onto the Properties panel, and then supply a prompt that describes the data to extract from the file. The LLM uses the prompt to extract and augment the data from the file for use as source data.

Getting the LLM to derive source data from a file lets you bring external or ad hoc data into your workflow quickly and easily. Typically, you are expected to join or "mash up" data extracted in this way with data from other sources already in your workflow, enriching existing datasets.

Warning: When using LLMs, your assets are generated using public domain algorithms. This can produce erroneous and inconsistent or random results. Use at your own risk.

Using AI to Create a Data Source

Important: You can only make use of this functionality if your administrator has selected to Enable Generative AI in the AI Settings page of the Admin Console. Otherwise, the function is not available for use.

Before you begin

  • You must have access to a Data Flow that you want to add your new source to.
  • You must have access to an enabled LLM.

Configure your AI Data node

From the Data Flow page:

  1. Drag and drop the AI Data node from File Sources onto the Data Flow canvas (purple arrow below):
  2. Select the AI Data node on the canvas.
  3. The Properties panel opens to the right. In the first instance, the AI Data Source panel shows the File Upload options.

  4. Upload your local file or link to a shared file.
  5. The available mechanisms are Upload (drag and drop or select the file), Shared (browse to a shared network location), or URL (enter a direct link to the file). For more details, see below.

    Once your file is uploaded, you will see it in the Properties panel as shown above (blue highlight).

  6. Specify the prompt to send to the LLM along with the uploaded file. This prompt indicates what data the LLM needs to extract from the file. It may also include requests to augment the data from the file.
  7. You can type a prompt directly into the text window or select the Expression checkbox to build a PQL Expression in the PQL Editor. You can also select an alternative LLM to use for this action if you know that a different LLM type is better suited to the job.

  8. In the Tables panel below the AI Data Source panel, click Add Table.
  9. An individual Table node is created and connected to the AI Data node. The data is generated using your prompt and written to your table.

    Important: There is always a one-to-one mapping between the AI Data node and a single Table node. If you want to extract data from two different files, you need to create two AI Data nodes and Tables, and use a Join to connect the table nodes to each other.

  10. Optional. You can preview the data in your table by selecting the Table node on the canvas. This opens the Preview panel at the bottom of the page.
  11. You can run the Preview panel using the Eye icon wherever you see it. For more information, see Datasource Preview.

What next?

You should add more nodes to your Data Flow:

Examples

The following examples show how you could use the AI Data node to pull data from simple files using an LLM prompt.

Important: The outcome of running this node will differ each time and may differ according to your LLM.

AI Data Source Properties

Upload File

Where there is no uploaded file, the Upload File fields are shown in the Properties panel. Start by selecting the method you want to use to provide the file.

Uploaded File

To upload a file, either drag and drop the file from its folder location onto the Properties panel or click Upload File and then find and select the file from its folder location.

Shared File

Provide a pointer to a shared file, rather than uploading the file into Pyramid. When the model is processed, the file is read and included in the model. The file path must include the file name and its extension.

  • Expression: If you want to build a dynamic file path to connect to your data source, you will need to select this checkbox and then use the PQL Editor to build your custom expression.

Note: The shared file must use a UNC file path format to the shared directory and file on the network. Pyramid's host machine must have access to the shared file location. If the Pyramid services are running on different machines, the Runtime and Task Servers must be given access to the shared file location.

URL

Provide a direct URL to a file hosted online or in a web-accessible location. The data will be downloaded from the URL when the model is processed. To connect to a URL, enter the URL and its required authentication.

  • Expression: If you want to build a dynamic URL to connect to your data source, you will need to select the Expression checkbox and then use the PQL Editor to build your custom expression.
  • Authentication:
    • None: Select None if no authorization is required.
    • Basic Authentication: Select if basic authentication is required.
    • Custom Header: Select if custom header authorization is required.
  • Custom HTTP Request Fields: Use this table to supply any custom headers you want to add to your HTTP request to send to the server.

Source File

Once your File is updated, you can see it in the AI Data Source panel (blue highlight above).

Tip: You can click the name of your file or its Download icon to download it.

Prompt

Type the prompt that you want to send to the LLM along with the uploaded file. This prompt indicates what the LLM needs to extract from the file and may include requests to augment that data.

You can either type a prompt directly into the text window or select the Expression checkbox and then build a PQL Expression that creates the prompt using the PQL Editor.

Alternative LLM Provider

Typically, your default LLM (as selected in the Admin Console's AI Settings page) is used for all generative activities in Pyramid. However, if you have a specialist task to perform, and you know that one of your other LLMs performs that type of action well, then you can use the LLM Provider options to select your preferred LLM just for this task.

To use an alternative LLM for the task represented by the selected node:

  1. Select the Alternative LLM Provider checkbox.
  2. Select the LLM Provider you want to use from the dropdown list.

Note: This list of LLM Providers only includes those LLM Providers in the Admin Console's LLM Manager page that are available to your tenant.

Options

  • Change Source: Click to clear your source selection and restart the configuration.
  • Update Table: Refresh the table data. If you update your prompt after the table is created, you should use this button to update your table to reflect your recent changes.