What is the Agent Builder SDK?
Agent Builder SDK lets your tenants create, build, and manage custom AI agents directly inside your application — without you building the UI or managing hundreds of custom agent requests. Embed pre-built components that give your customers the power to create, configure, and manage their own agents in minutes. The Agent Builder SDK is a premium feature that enables you to embed agent-building capabilities directly into your product.Currently Available Components
Agent Management:- Agent Builder (
<mindset-agents-manager>) — List and manage AI agents - Agent Configuration (
<mindset-agent-configuration>) — Create and edit individual agents
- Context Builder (
<mindset-contexts-manager>) — List and manage knowledge contexts - Context Configuration (
<mindset-context-configuration>) — Create and edit individual contexts
How It Works
1
Load JavaScript
Load Mindset AI’s JavaScript via a
<script> tag.2
Place Custom Elements
Place custom HTML elements in your page — embed single components or combine multiple components on the same page.
3
Initialize the SDK
Call
window.mindset.init() to configure and initialize.4
Components Render
Components render automatically with full functionality.
Quick Start Example
Here’s a minimal working example that embeds multiple components on the same page:Available Components
Tab Control Works for Both Component TypesThe
displayTabs attribute works identically for both Builder and Configuration components:- Builder components (
<mindset-agents-manager>,<mindset-contexts-manager>) — Controls tabs in the built-in create/edit dialogs - Configuration components (
<mindset-agent-configuration>,<mindset-context-configuration>) — Controls tabs in the standalone interface
displayTabs to show only the tabs your tenants need, regardless of which component type you choose.1. Agent Builder — <mindset-agents-manager>
Displays a list of all agents for the tenant with the ability to:
- View all agents
- Create new agents
- Edit existing agents
- Delete agents
- Search and filter agents
Examples:
2. Agent Configuration — <mindset-agent-configuration>
Displays the agent creation or editing dialog for a single agent. This component is useful when you want to:
- Embed agent creation/editing in a form
- Control when and how the configuration interface appears
- Build your own custom list view UI
Usage Examples:
Agent Configuration Tabs
The<mindset-agent-configuration> component displays multiple configuration tabs:
Always Displayed:
- Settings — Basic agent configuration (name, description, etc.)
- Personality — Agent behavior and tone
Optional Tabs (controlled via displayTabs):
- Policy — Agent policies and guidelines
- Options — Additional agent options
- LLM — Language model configuration
- Contexts — Knowledge base associations
- Bias — Bias detection configuration
- Preview — Agent preview
displayTabs value.
3. Context Builder — <mindset-contexts-manager>
Displays a list of all knowledge contexts for the tenant with the ability to:
- View all contexts
- Create new contexts
- Edit existing contexts
- Delete contexts
- Search and filter contexts
Examples:
Note on Synced ContextsThe Context Builder SDK does not allow tenants to create synced contexts directly. However, if an application administrator creates a synced context for a specific tenant using the Contexts API, that synced context will be visible to the tenant in the builder.
What are Knowledge Contexts?
Knowledge Contexts are bundles of files, links, and data that agents can reference — essentially a dynamic library for your agents.- Contexts — Documents, articles, and structured knowledge
- Custom Prompts — Instructions that guide the AI’s responses
- Bias — Overview of bias within your Contexts
4. Context Configuration — <mindset-context-configuration>
Displays the context creation or editing dialog for a single knowledge context. This component is useful when you want to:
- Embed context creation/editing in a form
- Build your own custom list view UI
Usage Examples:
The Back button is always visible on the manager components (
<mindset-agents-manager>, <mindset-contexts-manager>). The hideBackButton... attributes only apply to the standalone configuration components, since users need the Back button to return to the list view.Context Configuration Tabs
The<mindset-context-configuration> component displays configuration tabs:
Always Displayed:
- General — Basic context information (name, description, type)
Optional Tabs (controlled via displayTabs):
- Prompts — Custom system prompts and instructions
- Bias — Allows you to analyze the bias within your content
Integration Patterns
Pattern 1: Builder Components Only (Recommended)
Use builder components for a complete, zero-configuration experience:Pattern 2: Configuration Component Integration
Use configuration components in forms if you want to create your own list view UI.Shadow DOM Support
The Agent Builder SDK supports Shadow DOM encapsulation, allowing you to embed admin widgets with proper style isolation. This is useful when integrating into applications that use Shadow DOM for component encapsulation.Basic Setup
Pass an optionalshadowRoot parameter to window.mindset.init(). You can provide either a direct reference or a function getter:
When
shadowRoot is a function, the SDK calls it each time it needs to access the shadow root, ensuring it always has the latest valid reference. This prevents stale reference errors that can occur when a shadow root is destroyed and recreated while the SDK holds an old reference.
How It Works
When you provide theshadowRoot parameter, the SDK:
- Resolves function getters — Calls the function to obtain the current shadow root each time access is needed
- Scopes element detection — Restricts its MutationObserver to detect widgets only within that boundary
- Provides style isolation — Prevents conflicts between your host application and admin widgets
Backward Compatibility
TheshadowRoot parameter is optional. If not provided, the SDK operates in standard DOM mode without any changes needed:
Technical Details
Element Detection:- With Shadow DOM:
shadowRoot.querySelectorAll(selector) - Without Shadow DOM:
document.querySelectorAll(selector)
- With Shadow DOM: Observes
shadowRootwith{ childList: true, subtree: true } - Without Shadow DOM: Observes
document.bodywith{ childList: true, subtree: true }
Appendix: Complete Component Reference
Agent Components
<mindset-agents-manager>
<mindset-agent-configuration>
Context Components
<mindset-contexts-manager>
<mindset-context-configuration>