We can think of AI CoPilot as consisting of 3 components:
- A “Question Helper” component that identifies relevant metadata to attach to a user’s Input question. It sends the question, metadata, and a set of instructions to (2).
- The “OpenAI large language model (LLM)”, which takes everything given from (1) and returns a response with a set of instructions for (3).
- An “Answer Helper”, which lives inside the Heap app and has access to the same data available to the authenticated end user. It takes the response from (2), generates a chart, and shows it to the end user in the Heap app.
Here’s an end-to-end example of how these components work together:
Let’s say the user asks AI CoPilot: “How many signups have I had in France this week?”.
- The “Question Helper” component of AI CoPilot attaches a property to the question, such as the ‘’country” property. This question, the metadata, and a set of instructions is sent to the OpenAI LLM.
- The OpenAI LLM returns a response with another set of instructions that tells the Heap user interface what kind of chart to create. In this example, the instructions would be something like: ‘’create a line chart’’, ‘’use the country property’’, and ‘’set the date range to ‘last 7 days’’.
- The “Answer Helper” creates a line chart using the “country” property that looks at data from the last 7 days. This chart is shown to the end user in the Heap app.
Heap owns and develops (1) and (3), and OpenAI owns and develops (2). We carefully control which data we send to OpenAI. See additional FAQs below for more context on these controls.