Jump to a workflow
Embed a Dashboard
Most common starting point
Multi-Tenant Embeds
Per-client dashboards with RLS
Query Data
Natural language to SQL
Brand & Theme
Colors, fonts, responsive layout
Self-Serve Metrics
End-user metric creation
Filters
Dropdowns, date ranges, SQL
Embed an Existing Dashboard
The most common workflow. You have a dashboard built in the Databrain UI and want to embed it in your application. Ask your AI assistant:“Embed my sales dashboard in my React app”What happens behind the scenes:
Ensure API token
Checks for an existing API token via
list_api_tokens. Creates one with create_api_token if needed.Select workspace
Lists workspaces with
list_workspaces. Auto-selects if you only have one, otherwise asks you to choose.Create embed
Creates the embed configuration via
create_embed with the selected dashboard and resolved datamart.embed-existing-dashboard
What you get: A working embed ID, a guest token, and copy-pasteable frontend code for your framework (React, Next.js, Vue, Angular, Svelte, or vanilla JS). You can paste it into your app and see the dashboard immediately.
Multi-Tenant / Per-Client Embeds
Each of your customers gets their own dashboard with row-level security via aclientId.
Ask your AI assistant:
“Create per-client dashboard embeds for my SaaS app”What happens:
- Lists data apps and datamarts to understand your setup
- For each client, calls
create_embedwith a uniqueclientId - Each embed is scoped to that client’s data through row-level security
- Generates guest tokens per client for frontend use
embed-blank-dashboard
Multi-tenant embeds use
clientId in create_embed to scope data. The underlying tenancy model (table-level, schema-level, or database-level) is configured in the Databrain UI.Query Data with Natural Language
Ask questions about your data and get answers with chart suggestions — no dashboard or embed setup required. Ask your AI assistant:“What was total revenue last month?”
“Show me the monthly revenue trend for the past year”
“Compare sales by region — break it down by quarter”What happens:
Populate if needed
If the semantic layer is empty, auto-generates descriptions from column names using
update_semantic_layer.“Now show only the top 5 regions”Prompt name:
query-data
What you get: A data result set (rows and columns) plus a suggested chart type for visualization. For follow-up questions, results build on the previous conversation context.
Brand and Theme an Embed
Customize colors, fonts, chart styles, responsive breakpoints, and card styling to match your product. Ask your AI assistant:“Make my embed match our brand — primary color #4F46E5, dark mode, Inter font”
“Apply the corporate theme preset and hide the dashboard name”What happens:
- Identifies the target embed via
list_embedsorget_embed_details - Applies theme changes through
customize_embed_theme— supports presets, custom colors, font family, card styling, chart appearance (tooltips, legends, axes), and responsive breakpoints - Applies UI options through
configure_embedfor toggles like hiding the dashboard name
brand-my-embed
What you get: Your embed updated with the new theme. Remember to regenerate your guest token afterward — tokens encode the theme at creation time.
Enable Self-Serve Metric Creation
Let your end-users build their own metrics using drag-and-drop or AI-powered chat mode. Ask your AI assistant:“Enable metric creation on my embed with the visual builder”What happens:
- Lists embeds to find the target
- Updates embed access settings via
update_embedto enable metric creation permissions - Configures the creation mode (drag-and-drop or chat) through
configure_embed - Validates the setup with
diagnose_embed_health
enable-metric-creation
Set Up Filters
Add dashboard-level filters to your embeds — dropdowns, date ranges, and server-side SQL filters. Ask your AI assistant:“Add a date range filter and a region dropdown to my dashboard”What happens:
- Retrieves current embed configuration with
get_embed_details - Configures filters through
configure_embed— supports string filters, number filters, date filters, and SQL-based server-side filters - Optionally hides specific dashboard filters using the
hideDashboardFiltersoption
setup-filters
Localize an Embed
Set up multi-language support, translations, and calendar format. Ask your AI assistant:“Set up French translations for my embed”What happens:
- Retrieves current embed configuration
- Sets the language and calendar type through
configure_embed - Applies custom translation strings for UI labels
localize-embed
Secure an Embed
Configure permissions, access controls, and role-based guest tokens. Ask your AI assistant:“Lock down the embed so users can only view, not edit”What happens:
- Reviews current embed access settings via
get_embed_details - Updates permissions through
update_embed— controls what end-users can do (view, download, create metrics, etc.) - Generates a guest token with
generate_guest_tokenincluding the appropriatepermissionsobject
secure-my-embed
Manage Existing Embeds
List, compare, and review your embed configurations. Ask your AI assistant:“Show me all my embeds and their current settings”What happens:
- Lists all embeds via
list_embeds - Retrieves details for specific embeds with
get_embed_details - Optionally runs
diagnose_embed_healthto check for configuration issues
manage-embeds
Populate the Semantic Layer
Bootstrap table and column descriptions to enable natural language querying. Ask your AI assistant:“Check the semantic layer quality for my orders datamart and add descriptions”What happens:
Inspect current state
Calls
get_semantic_layer to see the current completion score and which tables/columns lack descriptions.Auto-generate descriptions
Generates human-readable descriptions from table and column names for any missing entries.
Push updates
Writes the new descriptions, synonyms, and example questions via
update_semantic_layer.populate-semantic-layer
A well-populated semantic layer significantly improves
ask_question accuracy. Add synonyms for business terms (e.g., “revenue” → “total_sales”) and example questions to guide the AI.
