> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/intelligence/ai-chat.md).

# AI Chat

Configure context-aware AI Chat, control access to agents and tools, and review stored chat history in PowerShell Universal.

AI Chat is a context-aware assistant in the PowerShell Universal admin console. It lets an authorized user select an AI agent, ask it to inspect or update the current resource, review its tool activity, and receive a streamed response. Chat is available on console pages that provide an editable resource context, such as scripts, apps, APIs, schedules, and portal components.

## How it works

The chat panel passes the current resource type, resource identifier, repository scope, and primary file to the selected AI agent. The agent receives instructions to stay within that scope and can use its configured tools to inspect, update, and reload the resource.

A chat session has a conversation ID. Clear chat starts a new conversation in the console. The session activity panel shows tool calls and file changes made during the current session.

## Configure AI Chat

1. Create an AI agent under **Build > AI > Agents**. Configure its provider, model, endpoint, credential, instructions, and any [AI Tools](/powershell-universal/intelligence/ai-tools.md) it may call.
2. Enable **Available in Chat** for the AI agent.
3. Assign roles to the AI agent when only particular users should be allowed to select it. An agent without assigned roles is available to all users who have chat permission.
4. Grant users the **Chat** `Read` or `Write` permission. Users must also satisfy the selected agent's role requirements and any role requirements of the resource they are editing.

If no eligible AI agent is enabled for chat, the chat panel remains unavailable to the user.

## Who can use chat

A user can use AI Chat only when all of the following conditions are met:

* The user has **Chat** `Read` or `Write` permission.
* At least one AI agent has **Available in Chat** enabled.
* The user has a role allowed by that AI agent, when the agent has role restrictions.
* The user is authorized to access the current resource.

Chat permissions control use of the panel. AI agent roles control which enabled agents a user can select.

## Tools available to AI Chat

The selected AI agent can call the custom AI Tools configured on that agent. These tools run with their configured script, timeout, and run-target settings.

AI Chat also provides context-aware built-in tools for users who have the **Administrator**, **Operator**, or **App Editor** role and Chat `Read` or `Write` permission. The available tools depend on the current resource and permission level.

| Capability                                                           | Read access                   | Write access                  |
| -------------------------------------------------------------------- | ----------------------------- | ----------------------------- |
| Discover resources and read repository files                         | Yes                           | Yes                           |
| List resources, notifications, files, file content, and command help | Yes                           | Yes                           |
| Reload the current resource                                          | No                            | Yes                           |
| Create, update, move, or delete repository files                     | No                            | Yes                           |
| Inspect a configured GET endpoint for an app                         | App context only              | App context only              |
| Search portal control properties                                     | Portal-component context only | Portal-component context only |

Built-in file operations are restricted to the current resource's repository scope. They cannot traverse outside that scope.

## Chat history and retention

PowerShell Universal stores chat history in its database. Each record includes the conversation and selected agent, user, resource context, messages, token usage, and each tool-call's name, arguments, result, error, status, and timestamps.

Users with **Chat History** `Read` permission can review persisted conversations from **Build > AI > Chat History**. History is retained according to the general `GroomDays` setting and is deleted when it becomes older than that retention period. Consider this retention policy when prompts or tool arguments may contain sensitive information.

## Related pages

* [AI Agents](/powershell-universal/intelligence/ai-agents.md)
* [AI Tools](/powershell-universal/intelligence/ai-tools.md)
* [Built In MCP Tools](/powershell-universal/intelligence/built-in-mcp-tools.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/intelligence/ai-chat.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
