5 min readUpdated Mar 2, 2026

AiContextSettings Documentation

Overview

The AiContextSettings component is designed for managing snippets of contextually relevant text within the Vantage analytics and data platform. It facilitates both organization-level and personal snippets, allowing users to create, edit, and delete context snippets that can enhance AI interactions by providing relevant information. This tool is integral for ensuring the AI can access a rich knowledge base that personalizes responses based on user or organizational needs.


Settings

1. Snippets Management

What it is:

The snippets state holds the list of snippets fetched from the server. Each snippet can be an organization-level or personal snippet containing useful context for AI interactions.

Input Type:

Array of objects.

Default Value:

[] (empty array).

Functionality:

The component initializes with an empty snippets state, which gets populated by fetching snippets from the API. The snippets can be organization-wide, shared with team members, or personal, designated for individual use.


2. Loading Indicator

What it is:

The loading state controls the display of a loading animation while snippets are being fetched.

Input Type:

Boolean.

Default Value:

true.

Functionality:

The loading state is initially set to true, displaying a spinner until the snippets are successfully fetched. Once the fetching is complete, this state changes to false, and the snippets are displayed.


3. Error State

What it is:

The error state captures any errors encountered during fetching snippets or any other operation.

Input Type:

String or null.

Default Value:

null.

Functionality:

If an error occurs while fetching or manipulating snippets (e.g., due to network issues), an error message can be displayed to the user. This helps in managing user expectations and troubleshooting issues.


4. Editing Identifier

What it is:

The editingId state supports editing functionality by identifying which snippet is currently being edited.

Input Type:

String (snippet ID) or null.

Default Value:

null.

Functionality:

When a user chooses to edit a snippet, its ID is stored here. This can help the form differentiate between snippets that are being modified versus those that are simply displayed.


5. Expanded Identifier

What it is:

The expandedId state tracks which snippet is currently expanded to show additional details.

Input Type:

String (snippet ID) or null.

Default Value:

null.

Functionality:

Allows the user to expand a snippet for more context (e.g., viewing detailed content). Clicking on a snippet header updates this state, controlling the UI accordingly.


6. New Snippet Form Visibility

What it is:

The showNewForm state controls the display of the form for creating new personal snippets.

Input Type:

Boolean.

Default Value:

false.

Functionality:

When set to true, the form for entering new snippet details will be shown. This enhances user interactivity by enabling quick additions of context snippets.


7. New Organization Snippet Form Visibility

What it is:

The showOrgNewForm state governs the visibility of the form for creating new organization-level snippets.

Input Type:

Boolean.

Default Value:

false.

Functionality:

Similar to showNewForm, but specifically for organization-level snippets. It allows users with appropriate permissions to create shared snippets for the entire organization.


8. New Snippet Content

What it is:

The newSnippet state holds the data for the snippet being created or edited.

Input Type:

Object with properties name, content, and type.

Default Value:

{ name: '', content: '', type: 'static' }.

Functionality:

This object tracks the details of a new snippet, including its name, content, and type. The type can either be "static" for plain text snippets or "knowledge-base" allowing AI to dynamically use and manage content.


9. Saving State

What it is:

The saving state indicates whether a snippet creation or update operation is currently in progress.

Input Type:

Boolean.

Default Value:

false.

Functionality:

This state prevents users from submitting multiple requests simultaneously by disabling buttons during the operation, ensuring a smoother user experience.


10. Organizational Snippet Management Permission

What it is:

The canManageOrgSnippets state indicates whether the current user has permission to manage organization-level snippets.

Input Type:

Boolean.

Default Value:

false.

Functionality:

This state is set based on the response from the API and controls the visibility of options to create or manage organization-level snippets. Only users with this privilege will see the associated buttons.


Use Cases & Examples

Use Cases

  1. Organizational Knowledge Management: A marketing team can create shared snippets for campaign terminology, ensuring all members use consistent language and understanding when interacting with AI.

  2. Personalized AI Interaction: Individual users can create snippets detailing their preferences and working styles, allowing the AI to tailor responses in a way that aligns with their personal context.

  3. Dynamic Knowledge Base Expansion: AI can dynamically add new entries to the knowledge base, allowing the snippets to evolve based on ongoing learning and team contributions.

Example Configuration

Use Case: Enhancing Team Collaboration

For a marketing team, setting up organization-level snippets can greatly improve efficiency. They can create a snippet called "Campaign Guidelines" to provide AI with essential principles and standards for upcoming campaigns.

Sample Configuration Data

json
{
  "name": "Campaign Guidelines",
  "content": "Always align campaigns with brand messaging. Make use of seasonal themes to engage users effectively.",
  "type": "knowledge-base",
  "isOrgLevel": true
}

This data can be sent to the server via the POST request signature for creating new snippets, allowing the AI to leverage this context when generating responses related to marketing strategies or campaign planning.


This comprehensive documentation aims to provide users with a clear understanding of the AiContextSettings component, delineating its functions, settings, and potential applications within the Vantage platform.