> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datalyr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI chat

> Ask questions about the data in the current workspace.

AI chat can query the current workspace's analytics, events, users, attribution, ad performance, revenue, and usage.

## Open chat

Select **New chat** near the bottom of the main sidebar. Ask one specific question and include a date range when it matters.

Good prompts include:

* `Which campaigns drove the most revenue in the last 30 days?`
* `Compare Meta and Google spend and ROAS this week.`
* `Show the journey for user_123.`
* `Which event names appeared today?`
* `How much event usage is left in this billing period?`

## How workspace access works

Chat is scoped to the active workspace. Its read tools use the workspace's agent key and cannot switch to another workspace because a prompt asks it to.

If chat cannot query data, open **Settings → API** and check that the workspace has an agent key. Agent keys begin with `dk_agent_` and are also used by supported MCP clients.

## Get a useful answer

1. Name the metric or object you want.
2. Add the date range and comparison period.
3. Specify a platform, campaign, user, or event when relevant.
4. Ask for the underlying rows when an aggregate looks surprising.
5. Verify high-impact conclusions in the corresponding Dashboard, Events, Users, or Reports view.

<Warning>
  AI answers can be wrong or incomplete. Treat chat as a faster way to explore the workspace, not as a replacement for validating financial or campaign decisions.
</Warning>

Chat is read-only. It cannot change settings, billing, sources, or conversion rules.
