Getting started

This guide demonstrates how to access AIP Logic, introduces the AIP Logic interface, and describes how to set up a basic Logic function by composing LLM blocks and examining the LLM’s chain of thought (CoT) in the Debugger.

Access AIP Logic

AIP Logic can be accessed from the platform’s workspace navigation bar or by using the quick search shortcuts CMD + J (macOS) or CTRL + J (Windows). Alternatively, you can create a new Logic function from your Files by selecting +New and then selecting AIP Logic, as shown below.

Create new AIP Logic window.

After opening AIP Logic, you can create a new Logic file. Note that Logic files must be saved in a project folder, not in your home folder.

Application interface

There are three main components of AIP Logic’s interface, numbered left-to-right in the notional screenshot below:

  1. Inputs, blocks, and outputs configuration
  2. Debugger
  3. Run panel

AIP Logic interface

Workflow overview

In a typical AIP Logic workflow, you might begin by configuring the input (A), blocks (B), and outputs (C) on the left panel (1), then using the Run panel (3) to generate a sample output. After running your Logic, you will be able to see the LLM’s chain-of-thought (CoT) prompting in the Debugger (2) and the steps the LLM took to produce the output. You can also visualize your final output in the Debugger in combination with the Run panel. The Run panel enables you to see the most recent Logic runs and create unit tests. On the right-hand sidebar, you can find more functionality, such as integration of Logic with the Automate application.

Inputs, blocks, and outputs configuration

When you first begin using AIP, you will see the Run panel on the right and three types of boards on the left: inputs, for optionally choosing an object and its properties, blocks for defining your Logic instructions, and outputs that represent the desired Logic function results. The output from one block can be fed into subsequent blocks.

The screenshot below shows the configuration area for inputs, blocks, and outputs with the Run panel collapsed.

Input, blocks, and Output configuration view.

Inputs

AIP Logic takes a variety of inputs: these can be either primitives or object types in the Ontology. In the Inputs block (labeled as "A" in the application interface guide), you can specify the input name, type (whether the input is a primitive or an object), and the primitive type or object type. Supported primitives include array, boolean, date, double, float, integer, long, short, string, and timestamp.

Blocks

An AIP Logic function is composed of blocks (labeled as "B" in the application interface guide), which represent ways that an LLM can interact with your data. You can choose between four types of AIP Logic blocks: create variable, get object property, use LLM, and transform block. The output of a block can be used in subsequent blocks. The three types of blocks are further detailed in individual sections below.

Create variable

The Create variable block creates a variable that can be used in future blocks. The variable can be of the following types: array, boolean, date, double, integer, long, string, or timestamp.

Create variable section block.

Get object property

The Get object property block returns properties from an object. When an input object is selected, you can choose a property from the object.

Get object property block.

Use LLM

The Use LLM block is the heart of AIP Logic and enables you to leverage LLMs to define a Logic block. Logic blocks are composed of a prompt, tools, and an output.

LLM Block.

Transform block

The Transform block allows you to use expressions within AIP Logic.

Transform block.

This is a great way to perform transformations on your data with AIP Logic such as convert a string to a date, parse JSON, perform mathematical expressions, and more.

Transform block "Convert a string to date" option.

Apply Action block

The Apply Action block allows you to deterministically call actions without having to go via an LLM block. This block gives you precise control over how parameters are filled out and speeds up the execution. In this example, we can call an action that attributes a priority status to a given incident.

Calling an AIP Logic function from an Action is required for edits to be written back to the Ontology. The Ontology will not be edited unless the Logic function is executed from an Action, even if the function contains an Apply Action block.

Apply Action block.

Execute block

You can use functions deterministically in AIP Logic. The Execute block is useful in loading specific data to pass to an LLM block as well as in complementing the Transforms block when desired expressions are not available. In this example, the Execute block is used to leverage the output from a semantic search function to help return the resolution text from similar incidents.

Execute block1/2. Execute block2/2.

Prompts

Prompts are instructions for an LLM, written in natural language. We recommend starting with the most important information (such as an overview of the task the LLM should complete), followed by the data the LLM will need and guidance on when to use the tools. When composing a prompt, keep in mind that an LLM only has access to what you specifically provide.

In the following notional prompt, we use the LLM to search for information from previous email conversations to provide a response to a customer seeking a solution. The notional prompt begins with the overview of the task:

You are my complaint helper agent. Find other emails that describe similar events to those described in the input email. Look only at the email body. Determine the best solution based on what has worked in the past. Return your one solution recommendation, do not list findings from every email.

Then, the prompt specifies the data to query (in this case, the complaints emails, represented as complaint objects). After entering the prompt, you can provide the LLM access to your inputs by typing “/“ and selecting one or more variables available in your analysis; in the screenshot below, we choose properties of the email object.

Notional prompt sharing an overview of the task "You are my complaints helper agent. Find other emails that describe similar events to those described in the input email. Look only at the email body. Determine the best solution based on what has worked in the past. Return your one solution recommendation, do not list findings from every email."

Tools

Tools are the mechanism by which AIP Logic enables the LLM to read or write to the Ontology and power real-world operations. AIP Logic leverages three categories of Ontology-driven tools - data, logic, and action - to effectively query data, execute logical operations, and safely take actions.

AIP Logic tools available for selection: Apply actions, Call function, Query objects, Calculator tool.

The available tools include:

Apply actions

The Apply actions tool enables the LLM to use Actions to edit the Ontology. You can describe when the LLM should use the Action provided. For more details on how to apply changes to the Ontology, review Make Ontology edits using Logic functions below.

Apply "Adjust delivery completion date" action on "[Titan] Delivery".

Call function

The Call function tool allows you to select functions that the LLM can call. Functions can be code-defined in repositories, or can be existing Logic functions.

Call function tool with "extractAnswer" function selected from function dropdown.

Query objects

The Query objects tool specifies object types that the LLM can access. You can add as many object types as needed and specify which properties the LLM can access in order to make the query more token-efficient.

Query objects tool with three objects of "[Titan] customer order", "[Titan] Distribution center", and "[Titan] Finished good" added.

Calculator tool

The Calculator tool enables you to perform accurate mathematical calculations with an LLM.

Outputs

You can define an intermediary output for every Logic block. The last block in your Logic path is the output of Logic function, labeled as "C" in the application interface guide.

  • Block output: Intermediary outputs that are passed between blocks. The output of your block can either be a primitive or an object for use in subsequent blocks.

  • Logic function output: The output of the Logic function that you want to return. This can be either a Value (primitive or object) or all the Ontology edits that your function has made.

Debugger

Once you have composed your Logic function, you can test the Logic function by selecting Run on the right side of the view. When the Logic has been run, Debugger will open to display the LLM’s chain-of-thought (CoT).

Debugger view with example.

The debugger allows you to expand and collapse block cards, clear tool calls, and easily review generated prompts, making it easier to interpret the chain of thought.

Run panel

From the Run panel, you can run and evaluate your Logic, as well as review recent runs. The right-hand sidebar lets you set unit tests, run automations, and view run history.

Run view with flight example in result box.

At the bottom of the Run panel, you can also select any of your recent runs to view their output and debug log.

Run and Run history view

Select the unit tests icon (Unit tests icon.) to save a version of your input for performance evaluation purposes.

Unit tests examples featuring notional flight changes.

Use a Logic function

Logic functions can be used the same way you would use a regular function on objects (FoO) in the platform.

  • You can back an action with a Logic function, then call the action from Workshop.
Create a new action type window with function and inputs selected from dropdown menus.
  • You can also call a Logic function to back a Markdown widget in Workshop; in this case, the output type from the Logic function must be a string.
Example showing Markdown widget setup popover in Workshop application.
  • You can call a Logic function in other Logic functions, as well as in functions on objects, via the Ontology function tool in AIP Logic.

Make Ontology edits using Logic functions

When running the function in Logic, you will see all the proposed Ontology edits in your scenario in the Debugger. These edits will not actually be executed. If you wish to apply your edits to the Ontology, either:

  • Call your Logic function from an action; or,
  • Call your Logic function from an automation. You can start creating a new automation from your Logic dashboard using the Automations Automate icon option located on the right-hand side.

For a Logic function to be able to edit the Ontology, you must:

  1. Set up an Apply actions tool in a Use LLM block that the Logic function can call. This allows the LLM to edit the Ontology.

Example showing Apply actions tool with prompt to "Make changes to the flight as described" where an action has been preselected from a dropdown menu.

  1. When you are done iterating on your Logic function, find and select the Publish option located next to save to publish the Logic function.

  2. Next, create a new action backed by the Logic function you have just published.

Example of wrapping your logic function into an action.

  1. You can now use this new action in a Workshop module to power an operational workflow. Workshop configuration panel with Flight Change action selected from dropdown.

Next steps

If you have access to AIP Logic, we recommend that you begin experimenting with LLM blocks to interact with your Ontology and build out a use case of your own. You may find it helpful to review the documentation on Functions in the platform.