Use AI Prompt Flow to iterate on and improve AI prompts

Written by:  Morgan T
Last updated:  

Lucidchart’s AI Prompt Flow extension enables everyone to experiment with LLMs (large language models) and improve their AI prompts, regardless of technical expertise. With the extension, you can build models of your AI flow with multiple user inputs, using sample interactions to help train responses. After you have created your model, share the results using Lucidchart’s sharing and collaboration capabilities.

Plan availability: Free, Individual, Team, and Enterprise.

 

Note: Lucid’s AI capabilities are currently available to all users but may be subject to a paid subscription model in the future.

Currently, our AI capabilities support English only.

Install AI Prompt Flow

Follow these steps to install the AI Prompt Flow extension:

  1. Log in to lucid.app.
  2. Click Integrations from the bottom-left of the navigation menu.
  3. Search “AI Prompt Flow” using the search bar at the top of the page.
  4. Click the AI Prompt Flow tile.
  5. Click Connect from the top-right of the page.

Set up the extension

After installing the extension, connect your AI model by following these steps:

  1. Open a Lucidchart document.
  2. Click ai-prompt-flow-icon.png the AI Prompt Flow icon from the Primary Toolbar on the far left-hand side.
  3. Select Settings at the top of the panel.
  4. Click Connect model.
  5. Enter a name for the model.
  6. Select a service type from the dropdown.
  7. Enter the Endpoint URL and API key for your GPT deployment.
    • Refer to the linked documentation from OpenAI and Azure to determine the appropriate Endpoint URL for chat completion APIs.
    • API keys are accessed through your OpenAI or Azure account.
  8. Enter the model you are using.
    • The AI Prompt Flow currently works with any model that supports chat completion APIs from OpenAI or Azure.
  9. Click Save.

Below is an example of the connection settings for Open AI’s GPT 3.5 Turbo model. Depending on the service type and model you use, your settings may be different.

connect-new-model-to-lucidchart-ai-scratchboard.png

Note: In order to use AI Prompt Flow, you may need to purchase API credit through OpenAI or Azure.

Parts of an AI model

Before configuring your first model, read through each of the sections below to acquaint yourself with the various parts you can include.

System prompt

The system prompt contains instructions about how the AI model is intended to behave. Consider including the following details:

  • The purpose of the AI workflow
  • The format you expect to receive
  • Any limitations, parameters, or context that help guide the output

system-prompt-in-ai-prompt-flow.png

User prompt

The user prompt is sample text that an end user would send through the AI flow.

user-prompt-in-ai-prompt-flow.png

Global variable

A global variable (or prompt segment) is a reusable piece of a prompt. These are useful if you have information you want to include in multiple system or user prompts—you can update it in one central location and it will be reflected anywhere it is referenced. You do not need to connect the global variable to the individual prompts that use it. To reference a global variable in a system or user prompt, use this format: ${PromptSegmentName}.

global-variable-prompt-segment-example.png

User-provided variables

User-provided variables allow you to create flexible prompts that take values from the end user. To reference the user variables in a user prompt, use this format: ${UserVariableName}.

user-provided-variables-in-ai-prompt-flow.png

Sample interactions

Sample interactions are a short list of example user prompts and the expected AI responses for them. If you connect the sample interactions table to a system prompt, the examples will be used to inform the AI’s output.

sample-interactions-few-shot-learning-ai-prompt-flow.png

Output

The output is what you can expect the AI to produce based on the parameters you have provided. This is generated by the AI Prompt Flow extension.

ai-prompt-flow-output-example.png

The example below shows each of these parts and how they interact with each other on the canvas.

example-of-all-parts-of-ai-prompt-flow-in-lucidchart.png

Configure and execute an AI prompt

Configure a prompt

To configure your AI model:

  1. Click ai-prompt-flow-icon.png the AI Prompt Flow icon from the Primary Toolbar on the far left-hand side of a Lucidchart document.
  2. Drag a System Prompt shape onto the canvas.
  3. Type your System Prompt parameters.
  4. Drag one or more User Prompt shapes onto the canvas.
  5. Type your sample user input.
  6. For added context on your model, drag a Prompt Segment, User Variables, or Sample Interactions onto the canvas. These are not required to execute a prompt.

Execute a prompt

Once you have configured your model, follow these steps to execute an AI prompt:

  1. Select a System Prompt or User Prompt shape on the canvas.
  2. Open the AI Prompt Flow panel from the top-right corner of the workspace.
  3. Click Execute prompt.

A new shape will appear on the canvas titled “Output”.

ai-prompt-flow-example-of-executing-prompt.gif

FAQ

How can I reference a prior response in the model?
You can use the response of one model as part of the prompt for a subsequent model. Connect an Output shape to a System Prompt and then use ${PriorResponse} in the System Prompt shape or User Prompt shape.

ai-prompt-flow-example-of-referencing-prior-response.png


Can I use AI Prompt Flow to create flowcharts?
Yes. If prompted, AI Prompt Flow can produce Mermaid code as an output. Mermaid is a flowchart and diagram visualization tool based on JavaScript. If the model output is in Mermaid code, Lucidchart will automatically generate the corresponding diagram.

create-diagram-using-ai-prompt-flow-example.png


How will you use my data?
Lucid is dedicated to upholding its commitments to you regarding the privacy, security, and safety of your data, including with any AI features. Your use of these features is subject to either our Terms of Service or your MSA with Lucid (as applicable) and Lucid's Supplemental AI Terms. Our current AI features are powered by Microsoft Azure OpenAI Service.

We do not use customer data to train models in a way that breaches the confidentiality of our customers' data. We do not use your prompt inputs to generate content for other customers based on your data. We do store documents for your use and any content on those documents are stored for your use as well.

As we expand our AI capabilities we will continue to do so in a way that does not breach the confidentiality of our customers' data.

Resources

To learn more about this feature, explore the additional resources below. These resources are available in English only.

Blog
Using AI throughout a project workflow: 5 common challenges solved by AI
 

Community post
Share your AI Prompt Flow models!

 

Give feedback on this article

Have feedback about this article? Tell us about your experience here

Did you find what you were looking for?

Still have a question or want to share what you have learned? Visit our Community   to get help and collaborate with others.