Activation - Create Prompt Profiles for AI Session Summaries

Who can use this feature?
- Part of Anywhere: Activation.
- 1000 Activations per month available with Enterprise and Advanced plans.
- Additional Activations available with Anywhere: Activation. Learn more.
- Requires an Admin or Architect role to configure.

With Anywhere: Activation, you can integrate AI-generated session summaries in other applications. This includes both turnkey solutions, such as Activation session summaries for Salesforce, as well as custom solutions using the Generate Summary API.

Prompt profiles are a powerful way to instruct the AI model to address your specific input and output needs, allowing controls for the specific slice of the session, context and event filtering, LLM prompt specification, and the response schema.

Prompt profile configuration

While the default prompt profile is fairly generic, it provides a helpful starting place for knowing what to customize. When viewing the Sessions > Create Profile API, you'll notice multiple fields that you can configure. We'll start with the llm object.

llm prompt defaults

Within the llm object, you can provide prompt instructions to guide the AI-generated results. These are the defaults:

  • prePrompt: “The following json encodes a user session as a sequence of page views and events, comprising the user's experience. Keep in mind the data is raw, and some values may not be relevant.”
  • postPrompt: “Please summarize the user's experience.”

Note especially how the default specification for postPrompt is quite generic. The example below demonstrates how you can update the prompt configuration to instruct the AI to format the session summary to your specific needs.

Additional configuration options

In addition to the llm prompt configuration options, there are several other objects within the Request body that can be specified. The below list is only a summary. Refer to the documentation for a complete schema and detailed explanation of each object.

  • slice: Determine which part of the session is being summarized. This is useful if you know there's a specific part of the session that needs to be summarized.
  • context: Controls the context of the session by including or excluding certain fields. For example, you might choose to ignore the user's location when summarizing the session.
  • events: Filter for specific event types, defined events, API events, selectors, etc. For example, you might choose to exclude Server API events when generating the summary.
  • llm.response_schema: Specify a JSON schema for the generative AI to use when formatting the output. This is useful when the results will be fed into an external system. Refer to the response_schema documentation for specific implementation details.
  • name: The name of the prompt profile. Useful for keeping track of various prompt profiles.

Example: Customizing llm.postPrompt for a specific business case

In this example, we have a car rental business that allows customers to browse for vehicles to rent in their market. Instead of providing a generic summary of the session, we want to modify the postPrompt to tell us what vehicles the customer viewed as well as any frustration signals they encountered. Here's a quick two-minute overview:


By default, when we call Generate Summary using the default config profile, we're going to get back a generic response. The information is detailed, but it doesn't match my specific business case. Further, the format is likely to change significantly each time a summary is generated. This is evidenced by the example below appearing quite different from the example in the video above.

Note: When working with the Generate Summary API, you'll need to provide a URL-encoded session_id value. See this article for help with working with session ID values and the API.

Here's the returned response summary, rendered as HTML from the returned JSON markdown:

Here's a summary of the user's session, based on the provided JSON data:

Overall Flow:

The user, Mary Scott, starts by visiting the homepage and interacting with a promo banner. They then explore the blog, and return to the homepage. They then search for cars in Nashville, Tennessee, but find no results. They then search for cars in San Francisco, and successfully find cars. They then view the details of a Maserati Granturismo, attempts to log in, and then proceeds to the checkout page. They then go back to the product page, and view the details of a Maserati Merak. The user also creates two support tickets.

Key Actions and Events:

  • Homepage & Blog: The user starts on the homepage, sees a promo, and explores the blog.
  • Car Search - Nashville: The user searches for cars in Nashville, Tennessee, but no cars are found.
  • Car Search - San Francisco: The user searches for cars in San Francisco, and successfully finds cars.
  • Filtering: The user uses filters (Maserati, price range) to narrow down the search results.
  • Product Page - Maserati Granturismo: The user views the details of a Maserati Granturismo, attempts to log in, and then proceeds to the checkout page.
  • Checkout: The user proceeds to the checkout page.
  • Product Page - Maserati Merak: The user views the details of a Maserati Merak.
  • Support Tickets: The user creates two support tickets, likely related to not finding a car.
  • Experimentation: The user is exposed to A/B testing experiments.
  • Promo Interaction: The user interacts with promo banners.
  • Dead Clicks: The user experiences dead clicks on the share button.
  • Calendar Interaction: The user interacts with the calendar picker.

Potential Issues and Observations:

  • No Cars in Nashville: The user's initial search for cars in Nashville was unsuccessful, leading to a network error.
  • Login Failure: The user attempted to log in but was unsuccessful.
  • Dead Clicks: The user experienced dead clicks on the share button.
  • Support Tickets: The user created support tickets, indicating potential issues or frustrations.
  • Abandoned Checkout: The user went to the checkout page, but it's unclear if they completed the booking.
  • Experiment Exposure: The user was exposed to A/B testing experiments.

In summary, the user's session involves car searching, filtering, product viewing, and checkout attempts, with some potential issues like no cars found in Nashville, login issues, and dead clicks. The user also engaged with promotional content and created support tickets.

To tailor the generated response to our car rental business, we're going to use the Create Profile API to override the default post_prompt value, which is normally the generic, “Please summarize the user's experience.” Instead, we're going to ask it to put a list of vehicles that were browsed at the very top. We'll also provide a template. 

Here's what the request body looks like:

{
    "llm": {
        "pre_prompt": "The following json encodes a user session as a sequence of page views and events, comprising the user's experience. Keep in mind the data is raw, and some values may not be relevant.",
        "post_prompt": "Provide a bulleted list of the names of any rental vehicles the user viewed during their session. Below the list of vehicles, provide a summary of the user's experience. Use the following template:\n\n**Vehicles Viewed**\n\n<bulleted list of vehicles viewed>\n\n**Quick Summary**\n\n<one paragraph summary>\n\n**Frustration Signals**\n\n<bulleted list of frustration signals identified>"
    }
}

Now, using this config_profile when calling Generate Summary against the same session as before, we get back a summary that matches the template we supplied in our post_prompt and is a much better fit for our business's needs.

Here's the returned response summary, rendered as HTML from the returned JSON markdown:

Vehicles Viewed

  • Maserati Granturismo 2023
  • Maserati Merak 2023

Quick Summary

The user, Mary Scott, began her session on the homepage, viewing a promo banner and exploring the blog. She then searched for cars in Nashville, Tennessee, but encountered an error indicating no cars were available. After returning to the homepage, she explored the FAQ section and then searched for cars in San Francisco. She applied filters to the search results, selecting a Maserati Granturismo 2023 and then a Maserati Merak 2023. The user then attempted to log in, and then returned to the Maserati Granturismo 2023 page and attempted to checkout. The user then went back to the product page, and then back to the Maserati Merak 2023 page. The user also created two support tickets.

Frustration Signals

  • Encountered "No cars in Nashville, Tennessee" error.
  • Dead clicks on the share button.
  • Dead clicks on the trip start input.
  • Created two support tickets, indicating potential issues or confusion.

Was this article helpful?

Got Questions?

Get in touch with a Fullstory rep, ask the community or check out our developer documentation.