Skip to main content
This document describes key workflows when using the Agent Builder SDK to enable tenant administrators to create and manage AI agents and knowledge contexts within your platform.

Available Components Overview

The Agent Builder SDK provides four main components for agent and context management:

Agent Builder

<mindset-agents-manager>Display all agents with create/edit/delete capabilities

Agent Configuration

<mindset-agent-configuration>Standalone agent creation/editing interface

Context Builder

<mindset-contexts-manager>Display all knowledge contexts with create/edit/delete capabilities

Context Configuration

<mindset-context-configuration>Standalone context creation/editing interface

Component Comparison Matrix

Components:
  • <mindset-agents-manager>
  • <mindset-contexts-manager>
Features:
  • ✅ Complete CRUD interface
  • ✅ List view included
  • ✅ Built-in create/edit dialogs
  • ✅ Delete functionality
  • ✅ Search and filtering
  • Min Height: 600px
Best For: Standard admin interfaces with full management capabilities

Use Case 1: Agent Management with Agent Builder

This flow shows how to embed a complete agent management interface where tenant administrators can view, create, edit, and delete agents in one unified interface.

Prerequisites

externalTenantId

The unique identifier for the tenant organization

externalId

The unique identifier for the admin user within your system

appUid

Your application’s unique identifier provided by Mindset

Step-by-Step Flow

1

Authenticate the Tenant Admin

Call the SDKUsers Auth API to create an auth token for the tenant admin user:
Response:
This call:
  • Creates or updates the user in Mindset’s system
  • Registers them as an admin of the specified externalTenantId
  • Returns an auth token scoped to that tenant
2

Construct the Web Page with Agent Builder

Create an HTML page containing the Agent Builder component:
Key Benefits:
  • Zero configuration - complete agent management in one component
  • Built-in list view with search and filtering
  • Automatic create/edit dialogs
  • Delete confirmation handling
3

Optional - Control Displayed Tabs

You can control which configuration tabs are shown in the agent dialogs:
Available tabs: Policy, Options, LLM, Contexts, Bias, Preview
Settings and Personality tabs are always displayed.

Use Case 2: Standalone Agent Creation/Editing

This flow shows how to embed a standalone agent creation or editing interface.

Prerequisites

Authentication

Same as Use Case 1

agentUid (optional)

UID of existing agent to edit

Step-by-Step Flow

1

Authenticate

Follow the authentication steps from Use Case 1.
2

Construct the Web Page with Agent Configuration

Key Points:
  • Omit agentUid attribute to create a new agent
  • Include agentUid attribute to edit an existing agent
  • The onClose callback fires when the user closes the config dialog
  • The SDK automatically saves the agent with the externalTenantId tag
3

Configuration Component Integration Pattern

For dynamic Configuration Component, create fresh elements each time:

Use Case 3: Knowledge Context Management with Context Builder

This flow shows how to embed a complete knowledge context management interface where tenant administrators can view, create, edit, and delete contexts.
What are Knowledge Contexts?Knowledge Contexts are bundles of files, links, and data that agents can reference—essentially a dynamic library for your agents.

Prerequisites

Same as Use Case 1 (authentication and tenant setup)

Step-by-Step Flow

1

Authenticate

Follow the authentication steps from Use Case 1.
2

Construct the Web Page with Context Builder

Create an HTML page containing the Context Builder component:
Key Benefits:
  • Complete context management in one component
  • Built-in list view with search capabilities
  • Automatic create/edit dialogs
  • Delete confirmation handling
3

Optional - Control Displayed Tabs

You can control which configuration tabs are shown in the context dialogs:
Available tabs: Prompts, Bias
General tab is always displayed.

Use Case 4: Standalone Context Creation/Editing

This flow shows how to embed a standalone context creation or editing interface.

Prerequisites

Authentication

Same as Use Case 1

contextUid (optional)

UID of existing context to edit

Step-by-Step Flow

1

Authenticate

Follow the authentication steps from Use Case 1.
2

Construct the Web Page with Context Configuration

Key Points:
  • Omit contextUid attribute to create a new context
  • Include contextUid attribute to edit an existing context
  • The onClose callback fires when the user closes the configuration component
  • The SDK automatically saves the context with the externalTenantId tag
3

Configuration Component Integration Pattern

For dynamic configuration component, create fresh elements each time:

Understanding fetchAuthentication

The fetchAuthentication parameter is a function that returns a Promise resolving to an auth token. This enables a deferred authentication pattern:
1

Page Loads

Your page loads and displays the Agent Builder SDK UI immediately
2

SDK Requests Auth

The SDK calls fetchAuthentication() only when it actually needs authentication
3

Client Calls Backend

Your client-side code makes a request to your backend API
4

Backend Generates Token

Your backend calls the Mindset SDKUsers Auth API to generate the token
5

Token Returned

Your backend returns the token to your frontend
6

SDK Authenticated

The SDK uses the token for authenticated operations

Example Implementation

Benefits of this approach:
  • API key security: Your Mindset API key never leaves your backend
  • Faster UI rendering: The page displays immediately without waiting for authentication
  • Session validation: Your backend can verify the user’s session before generating tokens
  • Token refresh: The SDK will call fetchAuthentication() again if tokens expire

Component Attributes Reference

Agent Builder

Agent Configuration

Context Builder

Context Configuration

Security Best Practices

  • The externalTenantId in the auth call registers the user as an admin for that tenant
  • Backend validates that the user is authorized before allowing any create/edit operations
  • Tenant admins can only see and manage resources tagged with their externalTenantId
  • Auth tokens should be generated server-side, not exposed in client code
  • Implement the fetchAuthentication callback to request tokens from your backend
  • Tokens have expiration times and will be refreshed automatically by the SDK
  • Never hardcode API keys in client-side code
Important: When using configuration components in modals or overlays, always create a fresh element each time:CORRECT:
INCORRECT:

Receiving Notifications (Optional)

When users save agents or contexts, you have two options to get the resource details:
If you’ve registered a webhook for events, you’ll receive a notification within 5 seconds:

Next Steps

Complete Integration Guide

See the full Agent Builder SDK documentation for detailed customization options

Webhook Setup

Configure webhooks to receive real-time notifications for agent and context events

API Reference

Explore the complete API documentation for Agents, Contexts, and SDKUsers APIs

Theme Customization

Learn how to customize the SDK appearance to match your platform’s branding