From a7f496b27281b808d6d0ad63f46f875c5637b5cb Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 13:58:45 +0000
Subject: [PATCH 01/14] Update guides/ai-agents/getting-started.mdx
---
guides/ai-agents/getting-started.mdx | 153 +++++++++++++++++++++++++++
1 file changed, 153 insertions(+)
create mode 100644 guides/ai-agents/getting-started.mdx
diff --git a/guides/ai-agents/getting-started.mdx b/guides/ai-agents/getting-started.mdx
new file mode 100644
index 00000000..0abd21df
--- /dev/null
+++ b/guides/ai-agents/getting-started.mdx
@@ -0,0 +1,153 @@
+---
+title: Getting started with AI agents
+description: Learn how to create and configure your first AI agent in Lightdash
+---
+
+Getting started with AI agents is simple - you can begin using them right away on any project in your Lightdash instance.
+
+## Creating your first AI agent
+
+
+
+
+
+1. **Find the "Ask AI" button** in your project - this will be your entry point to AI agents
+2. **Create a new agent** (only admins and developers can create new AI agents)
+3. **Configure your agent:**
+
+ - **Name and image** - Give your agent a memorable name and visual identity
+ - **Instructions (optional)** - Provide context about your models, tables, or specific use cases to help the AI give more relevant responses. Some templates are provided to get you started.
+ - **Enable Data Access (optional)** - Enable data access to allow your agent to analyze actual query results and provide insights based on the data. When disabled, agents work with metadata only
+ - **Enable Self-Improvement (optional, Beta)** - Allow your agent to propose changes to your semantic layer, including updating descriptions and creating new metrics. Changes are tracked in changesets for review
+ - **User and Group Access (optional)** - Control which users and groups can access your agent through the agent settings
+ - **Tags (optional)** - Use dbt tags to control which metrics and dimensions the agent can access
+ - **Slack Integration (optional)** - Connect your agent to Slack channels so users can interact directly from Slack
+
+Once set up, you can start asking questions immediately! Try asking "What kind of data can you access?" to get started.
+
+
+
+
+
+## Setting up multiple agents
+
+You can create multiple AI agents, each configured for different tasks, tones, languages, or teams. Each agent can have access to different datasets to focus results and give more accurate answers.
+
+
+
+
+
+## Limiting access to specific explores and fields
+
+For each AI agent, you can configure which fields are used to answer questions using the tags you've defined in your YAML files. You can add one or many tags - fields with **any** of the tags in the list will be considered by the AI agent.
+
+Use tags to control which metrics and dimensions each AI agent can access. This helps focus the AI on the most relevant data for analysis and ensures agents only work with appropriate datasets. You can add tags at the model level to give access to entire explores, or at the individual metric and dimension level for more granular control.
+
+### Adding tags at the model level
+
+Tag entire models to give your AI agent access to all metrics and dimensions within that explore:
+
+
+
+```yaml dbt 1.10+
+models:
+ - name: marketing_campaigns
+ config:
+ meta:
+ tags: ["marketing", "ai"] # <--------- tagging the entire model
+ columns:
+ - name: campaign_name
+ config:
+ meta:
+ dimension:
+ type: string
+ - name: impressions
+ config:
+ meta:
+ metrics:
+ total_impressions:
+ type: sum
+```
+
+```yaml dbt <=1.9
+models:
+ - name: marketing_campaigns
+ meta:
+ tags: ["marketing", "ai"] # <--------- tagging the entire model
+ columns:
+ - name: campaign_name
+ meta:
+ dimension:
+ type: string
+ - name: impressions
+ meta:
+ metrics:
+ total_impressions:
+ type: sum
+```
+
+
+
+### Adding tags to individual metrics & dimensions
+
+For more granular control, tag specific metrics and dimensions:
+
+
+
+```yaml dbt 1.10+
+models:
+ - name: orders
+ columns:
+ - name: status
+ config:
+ meta:
+ dimension:
+ tags: ["ai", "sales"] # <--------- tagging the dimension
+ - name: location
+ config:
+ meta:
+ dimension:
+ tags: ["ai", "operations"] # <--------- taggint the dimension
+ - name: amount
+ description: Total amount of the order
+ config:
+ meta:
+ metrics:
+ total_order_amount:
+ type: sum
+ format: usd
+ round: 2
+ tags: ["ai", "finance"] # <--------- tagging the metric
+```
+
+```yaml dbt <=1.9
+- name: orders
+ columns:
+ - name: status
+ meta:
+ dimension:
+ tags: ['ai', 'sales'] # <--------- tagging the dimension
+ - name: location
+ meta:
+ dimension:
+ tags: ['ai', 'operations'] # <--------- taggint the dimension
+ - name: amount
+ description: Total amount of the order
+ meta:
+ metrics:
+ total_order_amount:
+ type: sum
+ format: usd
+ round: 2
+ tags: ['ai', 'finance'] # <--------- tagging the metric
+```
+
+
From 6f6f3923be71754f925286cde8b1cbde62b9bf3b Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 13:59:31 +0000
Subject: [PATCH 02/14] Update guides/ai-agents/using-ai-agents.mdx
---
guides/ai-agents/using-ai-agents.mdx | 93 ++++++++++++++++++++++++++++
1 file changed, 93 insertions(+)
create mode 100644 guides/ai-agents/using-ai-agents.mdx
diff --git a/guides/ai-agents/using-ai-agents.mdx b/guides/ai-agents/using-ai-agents.mdx
new file mode 100644
index 00000000..8482461e
--- /dev/null
+++ b/guides/ai-agents/using-ai-agents.mdx
@@ -0,0 +1,93 @@
+---
+title: Using AI agents
+description: Learn how to interact with AI agents in Lightdash and Slack
+---
+
+## Core capabilities
+
+AI agents in Lightdash allow you to:
+
+- **Ask questions in natural language** - Simply type what you want to know about your data, like "What's our total revenue by region?" or "Show me user growth over the last 6 months"
+- **Get instant visualizations** - Receive bar charts, time series, and tables automatically generated based on your questions
+- **Explore interactively** - Follow up with additional questions, drill down into specific data points, or request different chart types
+- **Maintain conversation context** - AI agents remember your conversation history, so you can build on previous questions and refine your analysis
+- **Provide text-only responses** - Get answers in natural language when visualizations aren't needed
+- **Guide you to the right data** - Direct you to the most relevant explores or tables for your questions
+- **Discover existing content** - Find and share relevant charts and dashboards that have already been created in your project
+- **Generate complete dashboards** - Create multiple related visualizations at once that tell a cohesive story about your data, perfect for executive summaries or thematic analyses
+
+As mentioned earlier, Lightdash agents use the **semantic layer** defined in your dbt models to understand your data structure, relationships, and business logic.
+This ensures that the AI generates accurate queries and visualizations based on your specific data context.
+So, *when an Agent generates an answer, the output is a semantic query, **not SQL!*** This means that you can easily swap between the conversational AI interface and the standard Lightdash exploration experience.
+
+## Using AI agents in Slack
+
+Connect your AI agents to Slack for collaborative data analysis and team-wide insights sharing, here's how:
+
+1. Select or create an AI agent in your Lightdash instance
+2. Add the [Slack integration](https://docs.lightdash.com/guides/using-slack-integration#using-the-slack-integration) in your organization settings
+3. Under 'Integrations', add the channel you want to use
+ {" "}
+
+
+
+4. Tag your **Slack App** in the channel you want to use
+5. Start asking questions like "What kind of data can you access?" or "Show me total order amount over time"
+6. Get instant results directly in Slack
+
+You can also summon the bot on a thread to continue the conversation. In order for the bot to be able to respond, you need enable this context sharing in your Lightdash Integrations settings.
+
+
+
+
+
+### Demo
+
+Watch this comprehensive demo to see AI agents in action:
+
+
+
+
+
+## FAQs
+
+1. Does Lightdash store the query data?
+
+Lightdash only stores simple one-line answers so you can look back at your conversation history. We also save the basic query info to recreate these when needed. The actual data and detailed results stays in your warehouse and gets pulled fresh when the results are revisited (unless data access is enabled).
+
+2. Why can't I set multiple Agents for the same Slack channel?
+
+Since you have to mention the Slack App for your organization, and to avoid unexpected results, we don't allow multiple agents for the same slack channel. To align with best practices, we recommend one slack channel per project, so you prompt with confidence.
+
+## Known limitations
+
+
+ These limitations reflect the current state of AI agents as we continue
+ developing and improving the feature. Many of these constraints will be
+ addressed in future releases, so stay tuned! Your feedback and feature
+ requests help us prioritize what to build next.
+
+
+### Data analysis and calculations
+
+As mentioned in the [FAQs](#faqs), AI Agents currently work with your dbt model metadata rather than actual data values. This means they can't perform forecasting, predictive analytics or custom statistical calculations. They also can't create [table calculations](https://docs.lightdash.com/guides/table-calculations) or [custom fields](https://docs.lightdash.com/references/custom-fields) on-the-fly.
+
+### Query and visualizations constraints
+
+Results are limited by configurable query limits set at server level to ensure good performance. These limits can only be adjusted through environment variables at the moment.
+
+Agents can create bar charts, time series charts and tables, but don't yet support Lighdash's [full range of chart types](https://docs.lightdash.com/references/chart-types) including [custom visualizations](https://docs.lightdash.com/references/custom-charts), heat maps or bubble plots.
+
+### Data access and context
+
+Agent access to your data is controlled thorugh tags in your dbt models. If certain fields aren't accessible, check that they have the appropiate tags assigned to your agent.
+
+Agents don't remember context between different conversation sessions. Each chat start fresh.
From fb359432667a963030b223a0a09d94dff82d933c Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 13:59:38 +0000
Subject: [PATCH 03/14] Update guides/ai-agents/agent-memory.mdx
---
guides/ai-agents/agent-memory.mdx | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 guides/ai-agents/agent-memory.mdx
diff --git a/guides/ai-agents/agent-memory.mdx b/guides/ai-agents/agent-memory.mdx
new file mode 100644
index 00000000..52a6623d
--- /dev/null
+++ b/guides/ai-agents/agent-memory.mdx
@@ -0,0 +1,24 @@
+---
+title: Agent memory and learning
+description: How AI agents learn from your corrections and feedback
+---
+
+Agent memory can be modified by admins and developers only
+
+AI agents can now learn from your corrections and feedback. When you correct an agent's response or guide it to better understand your data, the agent can automatically update its own instructions to remember these preferences for future conversations. The memory will only be saved if you approve the agent's suggested learning.
+
+## How it works
+
+- When an agent makes a mistake or you provide clarification, it can capture this feedback
+- The agent updates its instructions field with the new learning
+- All future conversations with that agent will benefit from this accumulated knowledge
+- Memories are stored directly in the agent's instructions, which you can view and edit in agent settings
+
+## What agents can learn
+
+Agents can learn various types of corrections and preferences:
+
+- **Which tables or explores to use** for specific types of queries
+- **Field selection preferences** like "always use net_revenue instead of gross_revenue when generating revenue charts"
+- **Filter logic** such as "exclude test accounts when counting customers"
+- **General preferences** about formatting, ordering, or analysis approaches
From 655fdef87954fd0837b5bec5e40f6e90de7f267d Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 13:59:58 +0000
Subject: [PATCH 04/14] Update guides/ai-agents/self-improvement.mdx
---
guides/ai-agents/self-improvement.mdx | 105 ++++++++++++++++++++++++++
1 file changed, 105 insertions(+)
create mode 100644 guides/ai-agents/self-improvement.mdx
diff --git a/guides/ai-agents/self-improvement.mdx b/guides/ai-agents/self-improvement.mdx
new file mode 100644
index 00000000..ed293cd5
--- /dev/null
+++ b/guides/ai-agents/self-improvement.mdx
@@ -0,0 +1,105 @@
+---
+title: Self-improvement
+description: Enable AI agents to improve your semantic layer automatically
+---
+
+
+ This feature is currently in Beta. Enable it in your agent settings to start
+ testing with your team.
+
+
+AI agents can now improve your semantic layer by proposing changes to your data models. When enabled, agents can update field descriptions, create new metrics, and refine your data documentation based on conversations and user feedback. All changes are tracked in changesets and can be reviewed or reverted at any time.
+
+## How it works
+
+When self-improvement is enabled, your AI agent can:
+
+1. **Propose changes** to your semantic layer during conversations
+2. **Apply changes immediately** to a changeset (batch of changes)
+3. **Track all modifications** with full history and attribution
+4. **Allow review and rejection** of changes by authorized users
+
+Changes are visible in the chat interface and can be managed through the Project Settings > Changesets page.
+
+
+
+
+
+
+
+
+
+
+## What agents can improve
+
+**Update descriptions** for better documentation:
+
+- Explore descriptions to clarify data sources and use cases
+- Metric descriptions to explain calculations and business logic
+- Dimension descriptions to provide field context
+
+**Create new metrics** based on conversations:
+
+- Custom aggregations derived from existing dimensions
+
+## Enabling self-improvement
+
+To enable self-improvement for an agent:
+
+1. Go to your agent settings
+2. Toggle the "Enable Self-Improvement" switch
+3. Save your changes
+
+
+
+
+
+
+
+Only admins and developers can enable and use self-improvement
+
+## Managing changes
+
+All proposed changes are tracked in changesets, which you can access from Project Settings:
+
+**View all changes:**
+
+- Navigate to Project Settings > Changesets
+- See a complete list of proposed changes with details about what was modified
+- View who proposed each change and when
+
+
+
+
+
+
+
+**Review changes in chat:**
+
+- Each proposed change appears as a card in the conversation
+- Click "View Changeset" to see the full details
+- Use the "Reject" button to revert changes you don't want
+
+**Revert changes:**
+
+- Individual changes can be rejected directly from the chat interface
+- Use "Revert" in the changesets page to undo specific changes
+- Use "Revert All" to undo multiple changes at once
+- If a project is re-deployed, the changeset will be applied if possible
+
+
+ Once a change is reverted, the action cannot be undone. The semantic layer
+ will return to its previous state for that field or metric.
+
From 25d4eafacc6cc06e1ece0f4776eff139c4d109f9 Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 14:00:38 +0000
Subject: [PATCH 05/14] Update guides/ai-agents/best-practices.mdx
---
guides/ai-agents/best-practices.mdx | 184 ++++++++++++++++++++++++++++
1 file changed, 184 insertions(+)
create mode 100644 guides/ai-agents/best-practices.mdx
diff --git a/guides/ai-agents/best-practices.mdx b/guides/ai-agents/best-practices.mdx
new file mode 100644
index 00000000..d07d3588
--- /dev/null
+++ b/guides/ai-agents/best-practices.mdx
@@ -0,0 +1,184 @@
+---
+title: Best practices for AI agents
+description: Learn how to configure and optimize your AI agents for the best results
+---
+
+To get the most accurate and useful answers from your AI agents, follow these best practices for preparing your data and configuring your agents.
+
+## Think specialized, not general
+
+Think of AI agents as your specialized analysts - each one can be configured to focus on specific areas of your business. For example, you might create a "Marketing Assistant" that only has access to marketing data like campaign performance, lead generation, and customer acquisition metrics. This focused approach ensures more accurate, relevant responses and prevents sensitive data from being accessible to the wrong teams. To find out more about how to configure specific access, see [Limiting access to specific explores/fields](/guides/ai-agents/getting-started#limiting-access-to-specific-explores-and-fields).
+
+## Document your data thoroughly
+
+Good documentation is crucial for AI to understand your data models and provide meaningful insights. The quality of the results depend on the quality of your metadata and documentation.
+
+- **Write clear, descriptive names** for metrics and dimensions
+- **Add detailed descriptions** to all metrics and dimensions explaining what they represent
+- **Include example questions** in descriptions that AI could answer with the metric
+- **Use AI hints** to provide additional context specifically for AI agents
+
+Remember: If your colleague wouldn't understand your documentation, neither will the AI agent. The more context you provide, the better the AI can interpret and analyze your data.
+
+## Using AI hints
+
+AI hints are specialized metadata fields that provide additional context specifically for AI agents. These hints help the AI better understand your data models, business logic, and how to interpret your metrics and dimensions.
+
+
+ AI hints are internal metadata used only by AI agents and are not displayed to
+ users in the Lightdash interface. When both AI hints and descriptions are
+ present, AI hints take precedence for AI agent prompts.
+
+
+AI hints support both string and array of strings formats. The array format allows you to organize multiple distinct pieces of information as separate hints, making them easier to read and maintain.
+
+You can add AI hints at three levels:
+
+### Model-level hints
+
+Provide context about the entire table:
+
+
+
+```yaml dbt 1.10+
+models:
+ - name: customers
+ config:
+ meta:
+ ai_hint:
+ - This is a customers table containing customer information and derived facts
+ - Use this for customer demographics, behavior analysis, and segmentation
+```
+
+```yaml dbt <=1.9
+models:
+ - name: customers
+ meta:
+ ai_hint:
+ - This is a customers table containing customer information and derived facts
+ - Use this for customer demographics, behavior analysis, and segmentation
+```
+
+
+
+String format:
+
+
+
+```yaml dbt 1.10+
+models:
+ - name: customers
+ config:
+ meta:
+ ai_hint: |
+ This is a customers table containing customer information and derived facts.
+ Use this for customer demographics, behavior analysis, and segmentation.
+```
+
+```yaml dbt <=1.9
+models:
+ - name: customers
+ meta:
+ ai_hint: |
+ This is a customers table containing customer information and derived facts.
+ Use this for customer demographics, behavior analysis, and segmentation.
+```
+
+
+
+### Dimension-level hints
+
+Explain individual columns:
+
+
+
+```yaml dbt 1.10+
+columns:
+ - name: last_name
+ config:
+ meta:
+ dimension:
+ ai_hint:
+ - Customer's last name
+ - Contains PII data - use for identification but be mindful of privacy
+```
+
+```yaml dbt <=1.9
+columns:
+ - name: last_name
+ meta:
+ dimension:
+ ai_hint:
+ - Customer's last name
+ - Contains PII data - use for identification but be mindful of privacy
+```
+
+
+
+### Metric-level hints
+
+Clarify what metrics measure:
+
+
+
+```yaml dbt 1.10+
+columns:
+ - name: customer_id
+ config:
+ meta:
+ metrics:
+ unique_customer_count:
+ type: count_distinct
+ ai_hint:
+ - Unique customer count for business reporting
+ - Use this for customer acquisition and retention analysis
+```
+
+```yaml dbt <=1.9
+columns:
+ - name: customer_id
+ meta:
+ metrics:
+ unique_customer_count:
+ type: count_distinct
+ ai_hint:
+ - Unique customer count for business reporting
+ - Use this for customer acquisition and retention analysis
+```
+
+
+
+## Writing effective instructions
+
+Think of your instructions as teaching your AI agent about your world. The better you explain your business context and preferences, the more useful and relevant your agent's responses will be.
+
+Focus on four key areas: what your agent should know about your industry, your team's goals and constraints, how you like data analyzed, and how results should be communicated.
+
+### What to include
+
+- **Industry terminology and key metrics** including acronyms your team uses regularly (e.g., "CPM means Cost Per Mille, not cost per mile" or "Our ARR calculations exclude one-time setup fees")
+- **Communication style** for how results should be presented to your team (e.g., "Keep explanations simple for non-technical stakeholders" or "Always include actionable next steps")
+- **Business constraints** like regulatory requirements or budget limitations that affect decision-making
+- **Analysis preferences** your team relies on (e.g., "Always compare month-over-month growth" or "Flag any churn rates above 5% as concerning")
+- **Context for interpreting your data** (e.g., "Our Q4 always shows higher sales due to holiday promotions" or "Weekend traffic is typically 40% lower")
+
+
+ **Good example - Sales Team Agent:**
+ You analyze sales performance for our SaaS company. Focus on MRR, churn, and pipeline
+ health. When MRR growth drops below 10% month-over-month, flag it as concerning.
+ Present insights in simple terms that our sales managers can act on immediately.
+ Always include trend explanations and next steps.
+
+
+### What to avoid
+
+- **Contradictory instructions** that create confusion about priorities
+- **Overly complex rules** that are hard to follow consistently
+- **Vague guidance** like "be helpful" without explaining what that means for your situation
+- **Too many different focus areas** in one agent, remember to keep each agent focused, there are no limits on the number of agents you can create!
+- **Restating basic features**, don't tell the AI to "create charts" since it already does that
+
+
+ **Poor example - Too vague:**
+ Be helpful and analyze data well. Create good charts and explain things clearly.
+
From f8d2df0c3d3b601dfbb599efd9dea98edf67cdcf Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 14:00:48 +0000
Subject: [PATCH 06/14] Update guides/ai-agents/data-access.mdx
---
guides/ai-agents/data-access.mdx | 50 ++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
create mode 100644 guides/ai-agents/data-access.mdx
diff --git a/guides/ai-agents/data-access.mdx b/guides/ai-agents/data-access.mdx
new file mode 100644
index 00000000..4592045a
--- /dev/null
+++ b/guides/ai-agents/data-access.mdx
@@ -0,0 +1,50 @@
+---
+title: Data access control
+description: Understand how AI agents access and use your data
+---
+
+AI agents offer flexible data access control to balance insights with privacy and security. By default, agents work with metadata only, but you can optionally enable data access for deeper analysis.
+
+## Data access modes
+
+**Metadata-only mode (default):**
+
+- Agents can see your data structure, field names, and model definitions
+- They can generate appropriate queries and visualizations
+- No actual data values (except for one-row query results) are shared with the agent
+- Perfect for exploring data structure and creating initial analyses
+
+**Data access enabled:**
+
+- Agents receive actual query results in addition to metadata
+- Can provide specific insights, identify trends, and analyze patterns in your data
+- Offers detailed summaries and data-driven recommendations
+- Can search for actual field values to ensure accurate filters when building visualizations
+- Only shares data when explicitly enabled per agent
+
+
+ Data access is optional and controlled per agent. When disabled, agents only
+ work with your data model structure and cannot see actual data values. This
+ ensures sensitive information is only shared when you explicitly choose to
+ enable this capability.
+
+
+
+ To enable data access, go to your agent settings and toggle the "Data Access"
+ option.
+
+
+
+
+
+## User attributes and permissions
+
+
+AI Agents in the Lightdash app will follow row-level, column-level, and table-level data access based on [user attributes](/references/user-attributes).
+
+In Slack, the AI will have the user attributes of the user who set up the agent. We plan to respect user attributes based on Slack user email in the future, reach out if you need that feature!
+
+
From 51e5828ecc3c6089bd6c9a678da677e7e74fe00d Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 14:00:58 +0000
Subject: [PATCH 07/14] Update guides/ai-agents/evaluations.mdx
---
guides/ai-agents/evaluations.mdx | 42 ++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 guides/ai-agents/evaluations.mdx
diff --git a/guides/ai-agents/evaluations.mdx b/guides/ai-agents/evaluations.mdx
new file mode 100644
index 00000000..67ff98f4
--- /dev/null
+++ b/guides/ai-agents/evaluations.mdx
@@ -0,0 +1,42 @@
+---
+title: User-defined evaluations
+description: Test and validate your AI agent's performance with custom evaluation suites
+---
+
+Create custom evaluation suites to batch test your agent's performance and ensure consistent, high-quality responses across different scenarios.
+
+
+
+
+
+## How evaluations work
+
+1. **Define evaluation questions** - Build a set of test questions for each agent. You can either:
+ - Manually create questions that represent common use cases
+ - Select responses from existing agent conversations in the admin page to add to your evaluation set
+
+
+
+
+
+2. **Run batch tests** - Execute all prompts in your evaluation set against the agent to see how it responds
+
+3. **Review results** - Manually review the agent's responses to ensure they meet your quality standards and expectations
+
+## Using feedback to improve evaluations
+
+Encourage your team to actively use the thumbs-up/thumbs-down feature when interacting with AI agents. This feedback helps admins in two key ways:
+
+- **Identify improvement areas** - Thumbs-down responses highlight where the agent needs work
+- **Build better evaluation sets** - Filter and easily add thumbs-down responses to your evaluation suite to test fixes and prevent regressions
+
+This systematic testing approach helps you:
+
+- Verify agent performance before deploying changes
+- Ensure consistency across common queries
From 047f02af321c648faa875bd3ca463a536d2b0166 Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 14:01:22 +0000
Subject: [PATCH 08/14] Update guides/ai-agents.mdx
---
guides/ai-agents.mdx | 663 +++----------------------------------------
1 file changed, 41 insertions(+), 622 deletions(-)
diff --git a/guides/ai-agents.mdx b/guides/ai-agents.mdx
index cc76e284..156f8b89 100644
--- a/guides/ai-agents.mdx
+++ b/guides/ai-agents.mdx
@@ -26,630 +26,49 @@ AI agents transform the way you interact with your data by allowing you to ask q
AI agents automatically select the most relevant data models and metrics to answer your questions, build and execute queries with appropriate dimensions, metrics, and filters, and present results in the most insightful format.
-
-AI Agents in the Lightdash app will follow row-level, column-level, and table-level data access based on [user attributes](/references/user-attributes).
-
-In Slack, the AI will have the user attributes of the user who set up the agent. We plan to respect user attributes based on Slack user email in the future, reach out if you need that feature!
-
-
-
-## Get started
-
-Getting started with AI agents is simple - you can begin using them right away on any project in your Lightdash instance.
-
-### Creating your first AI agent
-
-
-
-
-
-1. **Find the "Ask AI" button** in your project - this will be your entry point to AI agents
-2. **Create a new agent** (only admins and developers can create new AI agents)
-3. **Configure your agent:**
-
- - **Name and image** - Give your agent a memorable name and visual identity
- - **Instructions (optional)** - Provide context about your models, tables, or specific use cases to help the AI give more relevant responses. Some templates are provided to get you started.
- - **Enable Data Access (optional)** - Enable data access to allow your agent to analyze actual query results and provide insights based on the data. When disabled, agents work with metadata only
- - **Enable Self-Improvement (optional, Beta)** - Allow your agent to propose changes to your semantic layer, including updating descriptions and creating new metrics. Changes are tracked in changesets for review
- - **User and Group Access (optional)** - Control which users and groups can access your agent through the agent settings
- - **Tags (optional)** - Use dbt tags to control which metrics and dimensions the agent can access
- - **Slack Integration (optional)** - Connect your agent to Slack channels so users can interact directly from Slack
-
-Once set up, you can start asking questions immediately! Try asking "What kind of data can you access?" to get started.
-
-
-
-
-
-## What agents can do
-
-### Core capabilities
-
-AI agents in Lightdash allow you to:
-
-- **Ask questions in natural language** - Simply type what you want to know about your data, like "What's our total revenue by region?" or "Show me user growth over the last 6 months"
-- **Get instant visualizations** - Receive bar charts, time series, and tables automatically generated based on your questions
-- **Explore interactively** - Follow up with additional questions, drill down into specific data points, or request different chart types
-- **Maintain conversation context** - AI agents remember your conversation history, so you can build on previous questions and refine your analysis
-- **Provide text-only responses** - Get answers in natural language when visualizations aren't needed
-- **Guide you to the right data** - Direct you to the most relevant explores or tables for your questions
-- **Discover existing content** - Find and share relevant charts and dashboards that have already been created in your project
-- **Generate complete dashboards** - Create multiple related visualizations at once that tell a cohesive story about your data, perfect for executive summaries or thematic analyses
-
-As mentioned earlier, Lightdash agents use the **semantic layer** defined in your dbt models to understand your data structure, relationships, and business logic.
-This ensures that the AI generates accurate queries and visualizations based on your specific data context.
-So, *when an Agent generates an answer, the output is a semantic query, **not SQL!*** This means that you can easily swap between the conversational AI interface and the standard Lightdash exploration experience.
-
-### Using AI agents in Slack
-
-Connect your AI agents to Slack for collaborative data analysis and team-wide insights sharing, here's how:
-
-1. Select or create an AI agent in your Lightdash instance
-2. Add the [Slack integration](https://docs.lightdash.com/guides/using-slack-integration#using-the-slack-integration) in your organization settings
-3. Under 'Integrations', add the channel you want to use
- {" "}
-
-
-
-4. Tag your **Slack App** in the channel you want to use
-5. Start asking questions like "What kind of data can you access?" or "Show me total order amount over time"
-6. Get instant results directly in Slack
-
-You can also summon the bot on a thread to continue the conversation. In order for the bot to be able to respond, you need enable this context sharing in your Lightdash Integrations settings.
-
-
-
-
-
-#### Demo
-
-Watch this comprehensive demo to see AI agents in action:
-
-
-
-
-
-## Agent memory and learning
-
-Agent memory can be modified by admins and developers only
-
-AI agents can now learn from your corrections and feedback. When you correct an agent's response or guide it to better understand your data, the agent can automatically update its own instructions to remember these preferences for future conversations. The memory will only be saved if you approve the agent's suggested learning.
-
-### How it works
-
-- When an agent makes a mistake or you provide clarification, it can capture this feedback
-- The agent updates its instructions field with the new learning
-- All future conversations with that agent will benefit from this accumulated knowledge
-- Memories are stored directly in the agent's instructions, which you can view and edit in agent settings
-
-### What agents can learn
-
-Agents can learn various types of corrections and preferences:
-
-- **Which tables or explores to use** for specific types of queries
-- **Field selection preferences** like "always use net_revenue instead of gross_revenue when generating revenue charts"
-- **Filter logic** such as "exclude test accounts when counting customers"
-- **General preferences** about formatting, ordering, or analysis approaches
-
-## Self-Improvement
-
-
- This feature is currently in Beta. Enable it in your agent settings to start
- testing with your team.
-
-
-AI agents can now improve your semantic layer by proposing changes to your data models. When enabled, agents can update field descriptions, create new metrics, and refine your data documentation based on conversations and user feedback. All changes are tracked in changesets and can be reviewed or reverted at any time.
-
-### How it works
-
-When self-improvement is enabled, your AI agent can:
-
-1. **Propose changes** to your semantic layer during conversations
-2. **Apply changes immediately** to a changeset (batch of changes)
-3. **Track all modifications** with full history and attribution
-4. **Allow review and rejection** of changes by authorized users
-
-Changes are visible in the chat interface and can be managed through the Project Settings > Changesets page.
-
-
-
-
-
-
-
-
-
-
-### What agents can improve
-
-**Update descriptions** for better documentation:
-
-- Explore descriptions to clarify data sources and use cases
-- Metric descriptions to explain calculations and business logic
-- Dimension descriptions to provide field context
-
-**Create new metrics** based on conversations:
-
-- Custom aggregations derived from existing dimensions
-
-### Enabling self-improvement
-
-To enable self-improvement for an agent:
-
-1. Go to your agent settings
-2. Toggle the "Enable Self-Improvement" switch
-3. Save your changes
-
-
-
-
-
-
-
-Only admins and developers can enable and use self-improvement
-
-### Managing changes
-
-All proposed changes are tracked in changesets, which you can access from Project Settings:
-
-**View all changes:**
-
-- Navigate to Project Settings > Changesets
-- See a complete list of proposed changes with details about what was modified
-- View who proposed each change and when
-
-
-
-
-
-
-
-**Review changes in chat:**
-
-- Each proposed change appears as a card in the conversation
-- Click "View Changeset" to see the full details
-- Use the "Reject" button to revert changes you don't want
-
-**Revert changes:**
-
-- Individual changes can be rejected directly from the chat interface
-- Use "Revert" in the changesets page to undo specific changes
-- Use "Revert All" to undo multiple changes at once
-- If a project is re-deployed, the changeset will be applied if possible
-
-
- Once a change is reverted, the action cannot be undone. The semantic layer
- will return to its previous state for that field or metric.
-
-
-## Best practices
-
-To get the most accurate and useful answers from your AI agents, follow these best practices for preparing your data and configuring your agents.
-
-### Think specialized, not general
-
-Think of AI agents as your specialized analysts - each one can be configured to focus on specific areas of your business. For example, you might create a "Marketing Assistant" that only has access to marketing data like campaign performance, lead generation, and customer acquisition metrics. This focused approach ensures more accurate, relevant responses and prevents sensitive data from being accessible to the wrong teams. To find out more about how to configure specific access, see [Limiting access to specific explores/fields](#limiting-access-to-specific-explores/fields).
-
-### Document your data thoroughly
-
-Good documentation is crucial for AI to understand your data models and provide meaningful insights. The quality of the results depend on the quality of your metadata and documentation.
-
-- **Write clear, descriptive names** for metrics and dimensions
-- **Add detailed descriptions** to all metrics and dimensions explaining what they represent
-- **Include example questions** in descriptions that AI could answer with the metric
-- **Use AI hints** to provide additional context specifically for AI agents
-
-Remember: If your colleague wouldn't understand your documentation, neither will the AI agent. The more context you provide, the better the AI can interpret and analyze your data.
-
-#### Using AI hints
-
-AI hints are specialized metadata fields that provide additional context specifically for AI agents. These hints help the AI better understand your data models, business logic, and how to interpret your metrics and dimensions.
-
-
- AI hints are internal metadata used only by AI agents and are not displayed to
- users in the Lightdash interface. When both AI hints and descriptions are
- present, AI hints take precedence for AI agent prompts.
-
-
-AI hints support both string and array of strings formats. The array format allows you to organize multiple distinct pieces of information as separate hints, making them easier to read and maintain.
-
-You can add AI hints at three levels:
-
-**Model-level hints** - Provide context about the entire table:
-
-
-
-```yaml dbt 1.10+
-models:
- - name: customers
- config:
- meta:
- ai_hint:
- - This is a customers table containing customer information and derived facts
- - Use this for customer demographics, behavior analysis, and segmentation
-```
-
-```yaml dbt <=1.9
-models:
- - name: customers
- meta:
- ai_hint:
- - This is a customers table containing customer information and derived facts
- - Use this for customer demographics, behavior analysis, and segmentation
-```
-
-
-
-String format:
-
-
-
-```yaml dbt 1.10+
-models:
- - name: customers
- config:
- meta:
- ai_hint: |
- This is a customers table containing customer information and derived facts.
- Use this for customer demographics, behavior analysis, and segmentation.
-```
-
-```yaml dbt <=1.9
-models:
- - name: customers
- meta:
- ai_hint: |
- This is a customers table containing customer information and derived facts.
- Use this for customer demographics, behavior analysis, and segmentation.
-```
-
-
-
-**Dimension-level hints** - Explain individual columns:
-
-
-
-```yaml dbt 1.10+
-columns:
- - name: last_name
- config:
- meta:
- dimension:
- ai_hint:
- - Customer's last name
- - Contains PII data - use for identification but be mindful of privacy
-```
-
-```yaml dbt <=1.9
-columns:
- - name: last_name
- meta:
- dimension:
- ai_hint:
- - Customer's last name
- - Contains PII data - use for identification but be mindful of privacy
-```
-
-
-
-**Metric-level hints** - Clarify what metrics measure:
-
-
-
-```yaml dbt 1.10+
-columns:
- - name: customer_id
- config:
- meta:
- metrics:
- unique_customer_count:
- type: count_distinct
- ai_hint:
- - Unique customer count for business reporting
- - Use this for customer acquisition and retention analysis
-```
-
-```yaml dbt <=1.9
-columns:
- - name: customer_id
- meta:
- metrics:
- unique_customer_count:
- type: count_distinct
- ai_hint:
- - Unique customer count for business reporting
- - Use this for customer acquisition and retention analysis
-```
-
-
-
-### Writing effective instructions
-
-Think of your instructions as teaching your AI agent about your world. The better you explain your business context and preferences, the more useful and relevant your agent's responses will be.
-
-Focus on four key areas: what your agent should know about your industry, your team's goals and constraints, how you like data analyzed, and how results should be communicated.
-
-#### What to include
-
-- **Industry terminology and key metrics** including acronyms your team uses regularly (e.g., "CPM means Cost Per Mille, not cost per mile" or "Our ARR calculations exclude one-time setup fees")
-- **Communication style** for how results should be presented to your team (e.g., "Keep explanations simple for non-technical stakeholders" or "Always include actionable next steps")
-- **Business constraints** like regulatory requirements or budget limitations that affect decision-making
-- **Analysis preferences** your team relies on (e.g., "Always compare month-over-month growth" or "Flag any churn rates above 5% as concerning")
-- **Context for interpreting your data** (e.g., "Our Q4 always shows higher sales due to holiday promotions" or "Weekend traffic is typically 40% lower")
-
-
- **Good example - Sales Team Agent:**
- You analyze sales performance for our SaaS company. Focus on MRR, churn, and pipeline
- health. When MRR growth drops below 10% month-over-month, flag it as concerning.
- Present insights in simple terms that our sales managers can act on immediately.
- Always include trend explanations and next steps.
-
-
-#### What to avoid
-
-- **Contradictory instructions** that create confusion about priorities
-- **Overly complex rules** that are hard to follow consistently
-- **Vague guidance** like "be helpful" without explaining what that means for your situation
-- **Too many different focus areas** in one agent, remember to keep each agent focused, there are no limits on the number of agents you can create!
-- **Restating basic features**, don't tell the AI to "create charts" since it already does that
-
-
- **Poor example - Too vague:**
- Be helpful and analyze data well. Create good charts and explain things clearly.
-
-
-## Set up multiple agents
-
-You can create multiple AI agents, each configured for different tasks, tones, languages, or teams. Each agent can have access to different datasets to focus results and give more accurate answers.
-
-
-
-
-
-### Limiting access to specific explores and fields
-
-For each AI agent, you can configure which fields are used to answer questions using the tags you've defined in your YAML files. You can add one or many tags - fields with **any** of the tags in the list will be considered by the AI agent.
-Use tags to control which metrics and dimensions each AI agent can access. This helps focus the AI on the most relevant data for analysis and ensures agents only work with appropriate datasets. You can add tags at the model level to give access to entire explores, or at the individual metric and dimension level for more granular control.
-
-#### Adding tags at the model level
-
-Tag entire models to give your AI agent access to all metrics and dimensions within that explore:
-
-
-
-```yaml dbt 1.10+
-models:
- - name: marketing_campaigns
- config:
- meta:
- tags: ["marketing", "ai"] # <--------- tagging the entire model
- columns:
- - name: campaign_name
- config:
- meta:
- dimension:
- type: string
- - name: impressions
- config:
- meta:
- metrics:
- total_impressions:
- type: sum
-```
-
-```yaml dbt <=1.9
-models:
- - name: marketing_campaigns
- meta:
- tags: ["marketing", "ai"] # <--------- tagging the entire model
- columns:
- - name: campaign_name
- meta:
- dimension:
- type: string
- - name: impressions
- meta:
- metrics:
- total_impressions:
- type: sum
-```
-
-
-
-#### Adding tags to individual metrics & dimensions
-
-For more granular control, tag specific metrics and dimensions:
-
-
-
-```yaml dbt 1.10+
-models:
- - name: orders
- columns:
- - name: status
- config:
- meta:
- dimension:
- tags: ["ai", "sales"] # <--------- tagging the dimension
- - name: location
- config:
- meta:
- dimension:
- tags: ["ai", "operations"] # <--------- taggint the dimension
- - name: amount
- description: Total amount of the order
- config:
- meta:
- metrics:
- total_order_amount:
- type: sum
- format: usd
- round: 2
- tags: ["ai", "finance"] # <--------- tagging the metric
-```
-
-```yaml dbt <=1.9
-- name: orders
- columns:
- - name: status
- meta:
- dimension:
- tags: ['ai', 'sales'] # <--------- tagging the dimension
- - name: location
- meta:
- dimension:
- tags: ['ai', 'operations'] # <--------- taggint the dimension
- - name: amount
- description: Total amount of the order
- meta:
- metrics:
- total_order_amount:
- type: sum
- format: usd
- round: 2
- tags: ['ai', 'finance'] # <--------- tagging the metric
-```
-
-
-
-## Data Access Control
-
-AI agents offer flexible data access control to balance insights with privacy and security. By default, agents work with metadata only, but you can optionally enable data access for deeper analysis.
-
-### Data access modes
-
-**Metadata-only mode (default):**
-
-- Agents can see your data structure, field names, and model definitions
-- They can generate appropriate queries and visualizations
-- No actual data values (except for one-row query results) are shared with the agent
-- Perfect for exploring data structure and creating initial analyses
-
-**Data access enabled:**
-
-- Agents receive actual query results in addition to metadata
-- Can provide specific insights, identify trends, and analyze patterns in your data
-- Offers detailed summaries and data-driven recommendations
-- Can search for actual field values to ensure accurate filters when building visualizations
-- Only shares data when explicitly enabled per agent
-
-
- Data access is optional and controlled per agent. When disabled, agents only
- work with your data model structure and cannot see actual data values. This
- ensures sensitive information is only shared when you explicitly choose to
- enable this capability.
-
-
-
- To enable data access, go to your agent settings and toggle the "Data Access"
- option.
-
-
-
-
-
-## User-defined evaluations
-
-Create custom evaluation suites to batch test your agent's performance and ensure consistent, high-quality responses across different scenarios.
-
-
-
-
-
-### How evaluations work
-
-1. **Define evaluation questions** - Build a set of test questions for each agent. You can either:
- - Manually create questions that represent common use cases
- - Select responses from existing agent conversations in the admin page to add to your evaluation set
-
-
-
-
-
-2. **Run batch tests** - Execute all prompts in your evaluation set against the agent to see how it responds
-
-3. **Review results** - Manually review the agent's responses to ensure they meet your quality standards and expectations
-
-### Using feedback to improve evaluations
-
-Encourage your team to actively use the thumbs-up/thumbs-down feature when interacting with AI agents. This feedback helps admins in two key ways:
-
-- **Identify improvement areas** - Thumbs-down responses highlight where the agent needs work
-- **Build better evaluation sets** - Filter and easily add thumbs-down responses to your evaluation suite to test fixes and prevent regressions
-
-This systematic testing approach helps you:
-
-- Verify agent performance before deploying changes
-- Ensure consistency across common queries
-
-## FAQs
-
-1. Does Lightdash store the query data?
-
-Lightdash only stores simple one-line answers so you can look back at your conversation history. We also save the basic query info to recreate these when needed. The actual data and detailed results stays in your warehouse and gets pulled fresh when the results are revisited (unless data access is enabled).
-
-2. Why can't I set multiple Agents for the same Slack channel?
-
-Since you have to mention the Slack App for your organization, and to avoid unexpected results, we don't allow multiple agents for the same slack channel. To align with best practices, we recommend one slack channel per project, so you prompt with confidence.
-
-## Known limitations
-
-
- These limitations reflect the current state of AI agents as we continue
- developing and improving the feature. Many of these constraints will be
- addressed in future releases, so stay tuned! Your feedback and feature
- requests help us prioritize what to build next.
-
-
-### Data analysis and calculations
-
-As mentioned in the [FAQs](#faqs), AI Agents currently work with your dbt model metadata rather than actual data values. This means they can't perform forecasting, predictive analytics or custom statistical calculations. They also can't create [table calculations](https://docs.lightdash.com/guides/table-calculations) or [custom fields](https://docs.lightdash.com/references/custom-fields) on-the-fly.
-
-### Query and visualizations constraints
+## What you'll learn
+
+This guide covers everything you need to know about AI agents in Lightdash:
+
+
+
+ Create and configure your first AI agent
+
+
+ Learn how to interact with agents in Lightdash and Slack
+
+
+ How agents learn from your corrections and feedback
+
+
+ Enable agents to improve your semantic layer automatically
+
+
+ Optimize your agents with documentation and instructions
+
+
+ Understand how agents access and use your data
+
+
+ Test and validate your agent's performance
+
+
-Results are limited by configurable query limits set at server level to ensure good performance. These limits can only be adjusted through environment variables at the moment.
+## Quick start
-Agents can create bar charts, time series charts and tables, but don't yet support Lighdash's [full range of chart types](https://docs.lightdash.com/references/chart-types) including [custom visualizations](https://docs.lightdash.com/references/custom-charts), heat maps or bubble plots.
+Ready to get started? Follow these steps:
-### Data access and context
+1. **[Create your first agent](/guides/ai-agents/getting-started)** - Set up a new AI agent in your Lightdash project
+2. **[Configure access](/guides/ai-agents/getting-started#limiting-access-to-specific-explores-and-fields)** - Use tags to control which data the agent can access
+3. **[Write instructions](/guides/ai-agents/best-practices#writing-effective-instructions)** - Provide context to help the agent understand your business
+4. **[Connect to Slack](/guides/ai-agents/using-ai-agents#using-ai-agents-in-slack)** (optional) - Enable team collaboration through Slack
-Agent access to your data is controlled thorugh tags in your dbt models. If certain fields aren't accessible, check that they have the appropiate tags assigned to your agent.
+## Key features
-Agents don't remember context between different conversation sessions. Each chat start fresh.
+- **Natural language queries** - Ask questions in plain English and get instant answers
+- **Automatic visualizations** - Get charts and tables generated based on your questions
+- **Slack integration** - Collaborate with your team directly in Slack channels
+- **Memory and learning** - Agents remember corrections and improve over time
+- **Self-improvement** - Agents can propose changes to your semantic layer (Beta)
+- **Access control** - Fine-grained control over data access and permissions
+- **Multiple agents** - Create specialized agents for different teams or use cases
From c2436b24178f1f9eb5440ea5874fe6f335e5129b Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 14:01:35 +0000
Subject: [PATCH 09/14] Update docs.json
---
docs.json | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/docs.json b/docs.json
index ed915e4b..50db0ee5 100644
--- a/docs.json
+++ b/docs.json
@@ -49,7 +49,19 @@
"group": "BI feature guides",
"icon": "person-chalkboard",
"pages": [
- "guides/ai-agents",
+ {
+ "group": "AI agents",
+ "pages": [
+ "guides/ai-agents",
+ "guides/ai-agents/getting-started",
+ "guides/ai-agents/using-ai-agents",
+ "guides/ai-agents/agent-memory",
+ "guides/ai-agents/self-improvement",
+ "guides/ai-agents/best-practices",
+ "guides/ai-agents/data-access",
+ "guides/ai-agents/evaluations"
+ ]
+ },
"guides/metrics-catalog",
"references/chart-types",
"guides/how-to-create-scheduled-deliveries",
From fdc163b82513bf5bdcef96a8a3ae1a4d7086cc3b Mon Sep 17 00:00:00 2001
From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 14:28:07 +0000
Subject: [PATCH 10/14] Update guides/ai-agents/data-access.mdx
---
guides/ai-agents/data-access.mdx | 77 ++++++++++++++++++++++++++++++--
1 file changed, 74 insertions(+), 3 deletions(-)
diff --git a/guides/ai-agents/data-access.mdx b/guides/ai-agents/data-access.mdx
index 4592045a..59246791 100644
--- a/guides/ai-agents/data-access.mdx
+++ b/guides/ai-agents/data-access.mdx
@@ -42,9 +42,80 @@ AI agents offer flexible data access control to balance insights with privacy an
## User attributes and permissions
-
-AI Agents in the Lightdash app will follow row-level, column-level, and table-level data access based on [user attributes](/references/user-attributes).
+AI agents automatically respect all data access controls configured through [user attributes](/references/user-attributes). This ensures that agents only access data that the user is authorized to see, maintaining your existing security policies.
+
+### How user attributes flow through AI queries
+
+When an AI agent generates and executes queries on behalf of a user, it inherits that user's attribute values and applies them to all data access:
+
+**Row-level security:**
+- Agents automatically apply `sql_filter` rules defined in your models
+- Only rows matching the user's attribute values are included in query results
+- Example: If a user has `sales_region: 'EMEA'`, the agent will only query data for that region
+
+**Column-level security:**
+- Agents respect `required_attributes` on dimensions
+- Columns the user cannot access are invisible to the agent
+- Metrics derived from restricted columns are also unavailable
+- Example: If `salary` requires `is_admin: 'true'`, non-admin users' agents cannot query salary data
-In Slack, the AI will have the user attributes of the user who set up the agent. We plan to respect user attributes based on Slack user email in the future, reach out if you need that feature!
+**Table-level security:**
+- Agents respect `required_attributes` on models
+- Tables the user cannot access are completely hidden from the agent
+- The agent cannot reference or join restricted tables
+- Example: If `payments` requires `is_admin: 'true'`, non-admin users' agents cannot query the payments table
+### Default behavior
+
+
+**In the Lightdash app:** AI agents automatically use the logged-in user's attributes for all queries.
+
+**In Slack:** AI agents currently use the attributes of the user who created the agent. We plan to respect user attributes based on Slack user email in the future—reach out if you need this feature!
+
+### How this works behind the scenes
+
+When an agent generates a query:
+
+1. The agent receives the user's complete attribute profile (both direct user attributes and group attributes)
+2. All `sql_filter` rules are automatically applied to the generated SQL
+3. Dimensions and tables with `required_attributes` are filtered from the available schema
+4. The agent only sees and can query data within the user's permissions
+
+This happens transparently—the agent doesn't need special configuration. Your existing user attribute rules automatically protect AI-generated queries just like they protect manual queries.
+
+### Example: Regional sales access
+
+Consider this model configuration:
+
+```yaml
+models:
+ - name: sales
+ meta:
+ sql_filter: ${TABLE}.region IN (${lightdash.attributes.sales_region})
+ columns:
+ - name: revenue
+ - name: customer_name
+ meta:
+ dimension:
+ required_attributes:
+ can_view_pii: "true"
+```
+
+For a user with `sales_region: 'EMEA'` and no `can_view_pii` attribute:
+
+- The agent can query `revenue` data, but only for EMEA region
+- The agent cannot see or query `customer_name` (PII restriction)
+- If the agent tries to analyze customer names, it will fail with a permissions error
+- All generated queries automatically include `WHERE region IN ('EMEA')`
+
+### Security considerations
+
+- **Metadata mode:** Even in metadata-only mode, agents respect user attributes when showing available fields
+- **Data access mode:** When data access is enabled, query results are filtered by user attributes
+- **Query generation:** Agents cannot generate queries that bypass user attribute restrictions
+- **Error handling:** If an agent attempts to access restricted data, the query fails with a permissions error
+
+
+Custom SQL in table calculations or SQL Runner can potentially bypass user attribute filters. AI agents use the standard query interface and cannot bypass these restrictions.
+
From 43afacc424b7bdee803f87a09ffd2908dcd90e6a Mon Sep 17 00:00:00 2001
From: Jake Peterson
Date: Fri, 31 Oct 2025 12:07:53 -0500
Subject: [PATCH 11/14] fix nav
---
docs.json | 27 ++++++++++++++-------------
guides/ai-agents.mdx | 12 +++++-------
2 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/docs.json b/docs.json
index 50db0ee5..e0088d2a 100644
--- a/docs.json
+++ b/docs.json
@@ -49,19 +49,6 @@
"group": "BI feature guides",
"icon": "person-chalkboard",
"pages": [
- {
- "group": "AI agents",
- "pages": [
- "guides/ai-agents",
- "guides/ai-agents/getting-started",
- "guides/ai-agents/using-ai-agents",
- "guides/ai-agents/agent-memory",
- "guides/ai-agents/self-improvement",
- "guides/ai-agents/best-practices",
- "guides/ai-agents/data-access",
- "guides/ai-agents/evaluations"
- ]
- },
"guides/metrics-catalog",
"references/chart-types",
"guides/how-to-create-scheduled-deliveries",
@@ -91,6 +78,20 @@
]
}
]
+ },
+ {
+ "group": "AI agents",
+ "icon": "robot",
+ "pages": [
+ "guides/ai-agents",
+ "guides/ai-agents/getting-started",
+ "guides/ai-agents/using-ai-agents",
+ "guides/ai-agents/agent-memory",
+ "guides/ai-agents/self-improvement",
+ "guides/ai-agents/best-practices",
+ "guides/ai-agents/data-access",
+ "guides/ai-agents/evaluations"
+ ]
}
]
},
diff --git a/guides/ai-agents.mdx b/guides/ai-agents.mdx
index 156f8b89..d04c845e 100644
--- a/guides/ai-agents.mdx
+++ b/guides/ai-agents.mdx
@@ -1,14 +1,12 @@
---
title: "AI agents"
+sidebarTitle: Overview
---
-
- {" "}
- {" "}
-
+
+
+AI agents are available as an add-on for all plans. [View pricing](https://www.lightdash.com/pricing)
+
AI agents transform the way you interact with your data by allowing you to ask questions in natural language and get answers back. Whether you're exploring data in Lightdash or collaborating with your team in Slack, AI agents make data analysis as simple as having a conversation.
From 981668a05d44c1ae4131fb5d9682430f1ee6a73c Mon Sep 17 00:00:00 2001
From: Jake Peterson
Date: Sun, 2 Nov 2025 21:52:18 -0600
Subject: [PATCH 12/14] adjust overview
---
guides/ai-agents.mdx | 48 ++++++++++++++++----------------------------
1 file changed, 17 insertions(+), 31 deletions(-)
diff --git a/guides/ai-agents.mdx b/guides/ai-agents.mdx
index d04c845e..b3b4f51b 100644
--- a/guides/ai-agents.mdx
+++ b/guides/ai-agents.mdx
@@ -1,14 +1,27 @@
---
title: "AI agents"
-sidebarTitle: Overview
+sidebarTitle: "Overview"
+description: "No code, no complex tools, just type what you want to know. AI Agents use your saved dashboards and the metrics you've defined in Lightdash semantic layer, so your whole team can find answers faster."
---
-
-AI agents are available as an add-on for all plans. [View pricing](https://www.lightdash.com/pricing)
+ AI agents are available as an add-on for all plans. [View pricing here](https://www.lightdash.com/pricing).
-AI agents transform the way you interact with your data by allowing you to ask questions in natural language and get answers back. Whether you're exploring data in Lightdash or collaborating with your team in Slack, AI agents make data analysis as simple as having a conversation.
+## What you'll learn
+
+This guide covers everything you need to know about AI agents in Lightdash:
+
+
+
+
+
+
+
+
+
+
+
-AI agents transform the way you interact with your data by allowing you to ask questions in natural language and get answers back. Whether you're exploring data in Lightdash or collaborating with your team in Slack, AI agents make data analysis as simple as having a conversation.
-
-
-
-
-
AI agents automatically select the most relevant data models and metrics to answer your questions, build and execute queries with appropriate dimensions, metrics, and filters, and present results in the most insightful format.
-
-AI Agents in the Lightdash app will follow row-level, column-level, and table-level data access based on [user attributes](/references/user-attributes).
-
-In Slack, the AI will have the user attributes of the user who set up the agent. We plan to respect user attributes based on Slack user email in the future, reach out if you need that feature!
-
-
-
-## Get started
-
-Getting started with AI agents is simple - you can begin using them right away on any project in your Lightdash instance.
-
-### Creating your first AI agent
-
-
-
-
-
-1. **Find the "Ask AI" button** in your project - this will be your entry point to AI agents
-2. **Create a new agent** (only admins and developers can create new AI agents)
-3. **Configure your agent:**
-
- - **Name and image** - Give your agent a memorable name and visual identity
- - **Instructions (optional)** - Provide context about your models, tables, or specific use cases to help the AI give more relevant responses. Some templates are provided to get you started.
- - **Enable Data Access (optional)** - Enable data access to allow your agent to analyze actual query results and provide insights based on the data. When disabled, agents work with metadata only
- - **Enable Self-Improvement (optional, Beta)** - Allow your agent to propose changes to your semantic layer, including updating descriptions and creating new metrics. Changes are tracked in changesets for review
- - **User and Group Access (optional)** - Control which users and groups can access your agent through the agent settings
- - **Tags (optional)** - Use dbt tags to control which metrics and dimensions the agent can access
- - **Slack Integration (optional)** - Connect your agent to Slack channels so users can interact directly from Slack
-
-Once set up, you can start asking questions immediately! Try asking "What kind of data can you access?" to get started.
-
-
-
-
-
-## What agents can do
-
-### Core capabilities
-
-AI agents in Lightdash allow you to:
-
-- **Ask questions in natural language** - Simply type what you want to know about your data, like "What's our total revenue by region?" or "Show me user growth over the last 6 months"
-- **Get instant visualizations** - Receive bar charts, time series, and tables automatically generated based on your questions
-- **Explore interactively** - Follow up with additional questions, drill down into specific data points, or request different chart types
-- **Maintain conversation context** - AI agents remember your conversation history, so you can build on previous questions and refine your analysis
-- **Provide text-only responses** - Get answers in natural language when visualizations aren't needed
-- **Guide you to the right data** - Direct you to the most relevant explores or tables for your questions
-- **Discover existing content** - Find and share relevant charts and dashboards that have already been created in your project
-- **Generate complete dashboards** - Create multiple related visualizations at once that tell a cohesive story about your data, perfect for executive summaries or thematic analyses
-
-As mentioned earlier, Lightdash agents use the **semantic layer** defined in your dbt models to understand your data structure, relationships, and business logic.
-This ensures that the AI generates accurate queries and visualizations based on your specific data context.
-So, *when an Agent generates an answer, the output is a semantic query, **not SQL!*** This means that you can easily swap between the conversational AI interface and the standard Lightdash exploration experience.
-
-### Using AI agents in Slack
-
-Connect your AI agents to Slack for collaborative data analysis and team-wide insights sharing, here's how:
-
-1. Select or create an AI agent in your Lightdash instance
-2. Add the [Slack integration](https://docs.lightdash.com/guides/using-slack-integration#using-the-slack-integration) in your organization settings
-3. Under 'Integrations', add the channel you want to use
- {" "}
-
-
-
-4. Tag your **Slack App** in the channel you want to use
-5. Start asking questions like "What kind of data can you access?" or "Show me total order amount over time"
-6. Get instant results directly in Slack
-
-You can also summon the bot on a thread to continue the conversation. In order for the bot to be able to respond, you need enable this context sharing in your Lightdash Integrations settings.
-
-
-
-
-
-#### Demo
-
-Watch this comprehensive demo to see AI agents in action:
-
-
-
-
-
-## Agent memory and learning
-
-Agent memory can be modified by admins and developers only
-
-AI agents can now learn from your corrections and feedback. When you correct an agent's response or guide it to better understand your data, the agent can automatically update its own instructions to remember these preferences for future conversations. The memory will only be saved if you approve the agent's suggested learning.
-
-### How it works
-
-- When an agent makes a mistake or you provide clarification, it can capture this feedback
-- The agent updates its instructions field with the new learning
-- All future conversations with that agent will benefit from this accumulated knowledge
-- Memories are stored directly in the agent's instructions, which you can view and edit in agent settings
-
-### What agents can learn
-
-Agents can learn various types of corrections and preferences:
-
-- **Which tables or explores to use** for specific types of queries
-- **Field selection preferences** like "always use net_revenue instead of gross_revenue when generating revenue charts"
-- **Filter logic** such as "exclude test accounts when counting customers"
-- **General preferences** about formatting, ordering, or analysis approaches
-
-## Self-Improvement
-
-
- This feature is currently in Beta. Enable it in your agent settings to start
- testing with your team.
-
-
-AI agents can now improve your semantic layer by proposing changes to your data models. When enabled, agents can update field descriptions, create new metrics, and refine your data documentation based on conversations and user feedback. All changes are tracked in changesets and can be reviewed or reverted at any time.
-
-### How it works
-
-When self-improvement is enabled, your AI agent can:
-
-1. **Propose changes** to your semantic layer during conversations
-2. **Apply changes immediately** to a changeset (batch of changes)
-3. **Track all modifications** with full history and attribution
-4. **Allow review and rejection** of changes by authorized users
-
-Changes are visible in the chat interface and can be managed through the Project Settings > Changesets page.
-
-
-
-
-
-
-
-
-
-
-### What agents can improve
-
-**Update descriptions** for better documentation:
-
-- Explore descriptions to clarify data sources and use cases
-- Metric descriptions to explain calculations and business logic
-- Dimension descriptions to provide field context
-
-**Create new metrics** based on conversations:
-
-- Custom aggregations derived from existing dimensions
-
-### Enabling self-improvement
-
-To enable self-improvement for an agent:
-
-1. Go to your agent settings
-2. Toggle the "Enable Self-Improvement" switch
-3. Save your changes
-
-
-
-
-
-
-
-Only admins and developers can enable and use self-improvement
-
-### Managing changes
-
-All proposed changes are tracked in changesets, which you can access from Project Settings:
-
-**View all changes:**
-
-- Navigate to Project Settings > Changesets
-- See a complete list of proposed changes with details about what was modified
-- View who proposed each change and when
-
-
-
-
-
-
-
-**Review changes in chat:**
-
-- Each proposed change appears as a card in the conversation
-- Click "View Changeset" to see the full details
-- Use the "Reject" button to revert changes you don't want
-
-**Revert changes:**
-
-- Individual changes can be rejected directly from the chat interface
-- Use "Revert" in the changesets page to undo specific changes
-- Use "Revert All" to undo multiple changes at once
-- If a project is re-deployed, the changeset will be applied if possible
-
-
- Once a change is reverted, the action cannot be undone. The semantic layer
- will return to its previous state for that field or metric.
-
-
-## Best practices
-
-To get the most accurate and useful answers from your AI agents, follow these best practices for preparing your data and configuring your agents.
-
-### Think specialized, not general
-
-Think of AI agents as your specialized analysts - each one can be configured to focus on specific areas of your business. For example, you might create a "Marketing Assistant" that only has access to marketing data like campaign performance, lead generation, and customer acquisition metrics. This focused approach ensures more accurate, relevant responses and prevents sensitive data from being accessible to the wrong teams. To find out more about how to configure specific access, see [Limiting access to specific explores/fields](#limiting-access-to-specific-explores/fields).
-
-### Document your data thoroughly
-
-Good documentation is crucial for AI to understand your data models and provide meaningful insights. The quality of the results depend on the quality of your metadata and documentation.
-
-- **Write clear, descriptive names** for metrics and dimensions
-- **Add detailed descriptions** to all metrics and dimensions explaining what they represent
-- **Include example questions** in descriptions that AI could answer with the metric
-- **Use AI hints** to provide additional context specifically for AI agents
-
-Remember: If your colleague wouldn't understand your documentation, neither will the AI agent. The more context you provide, the better the AI can interpret and analyze your data.
-
-#### Using AI hints
-
-AI hints are specialized metadata fields that provide additional context specifically for AI agents. These hints help the AI better understand your data models, business logic, and how to interpret your metrics and dimensions.
-
-
- AI agents are available as an add-on for all plans. [View pricing here](https://www.lightdash.com/pricing).
-
## What you'll learn