> ## Documentation Index
> Fetch the complete documentation index at: https://openops-ecb4f397-mintlify-helm-chart-documentation-30057.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Assistance

> How to use AI assistance in OpenOps

OpenOps can use a large language model (LLM) of your choice to help you with:

* Answering questions about OpenOps and FinOps using the AI chatbot
* Generating CLI commands for AWS, Azure, and GCP
* Writing SQL queries for AWS Athena, BigQuery, Snowflake, and Databricks
* Generating JavaScript code for custom code steps in your workflows

You can do all this right inside the workflow editor, without switching context.

## Enabling AI assistance

OpenOps doesn't lock you into a specific AI model. Instead, you **bring your own AI keys** and [connect them to OpenOps](/ai-assistance/llm-connections).

Supported LLMs include OpenAI, Anthropic, Google Generative AI, Groq, Mistral, Perplexity, xAI Grok, and more.

## Using AI assistance

AI assistance in OpenOps is available in two main forms: the AI assistant chat, where you ask free-form questions, and the **Generate with AI** command, which helps you generate commands, queries, and code snippets.

### AI assistant chat

Once enabled, the AI assistant chat becomes available in sidebars in every OpenOps view:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/j9GTSEw0xEv_mJ1h/images/access-llm-assistant.png?fit=max&auto=format&n=j9GTSEw0xEv_mJ1h&q=85&s=672a610053f780efae5dec0f8524b4d3" alt="AI assistant" width="677" height="858" data-path="images/access-llm-assistant.png" />

You can use it to ask a variety of questions about OpenOps, your cloud resources, and FinOps in general, such as:

* "What can I do in OpenOps and how do I use its [features](/introduction/features-and-benefits/)?"
* "How do I [create a workflow](/workflow-management/building-workflows/) that does what I want to achieve?"
* "What [actions](/workflow-management/actions/) and [connections](/cloud-access/access-levels-permissions/) are used in workflows in my installation?"
* "What are the recent trends in OpenOps [workflow runs](/workflow-management/investigate-workflow-run/), and are there any anomalies?"
* "Why has a specific workflow started to fail, and why hadn't it failed before?"
* "What kind of data does a specific [OpenOps table](/reporting-analytics/tables/) contain, and what workflows use it?"
* "What are the recent trends in the FinOps community?"

To provide in-depth answers about your OpenOps installation, the AI assistant takes advantage of the OpenOps MCP server, which is enabled by default.

It can also work with the Amazon Cost MCP server, enabling you to ask questions about your AWS expenses like "How much did I spend on EC2 last month?". However, you need to explicitly enable OpenOps to access the Amazon Cost MCP server. See [LLM Connections](/ai-assistance/llm-connections) for how to connect.

### Generating commands and queries

Whenever you work with an [action](/workflow-management/actions) that requires writing a CLI command or SQL query, you'll see the **Generate with AI** command next to the relevant property in the action's properties pane:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/j9GTSEw0xEv_mJ1h/images/access-llm-generate-with-ai.png?fit=max&auto=format&n=j9GTSEw0xEv_mJ1h&q=85&s=b500f303405630d72b3d84a0fd02238b" alt="Generate with AI" width="487" height="240" data-path="images/access-llm-generate-with-ai.png" />

When you click **Generate with AI**, use the AI chat window to describe the outcome you want the command or query to achieve, and your LLM will generate it for you:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/j9GTSEw0xEv_mJ1h/images/access-llm-chat.png?fit=max&auto=format&n=j9GTSEw0xEv_mJ1h&q=85&s=d7fb79aeab7689235832511b38b9d803" alt="AI chat window" width="487" height="287" data-path="images/access-llm-chat.png" />

Click **Inject command** in the AI chat window to insert the generated command into the action's **Command** field.

### Generating code steps

When existing no-code actions aren't a good fit for your workflow, you can use AI assistance to generate JavaScript code for custom code steps.

In the properties pane of your **Code** step, click **Generate with AI**. When the AI chat window opens, enter a prompt with details about the task you want to accomplish. The AI will generate a code snippet that respects the format expected by the code step. Click **Use code** to insert the generated code into the step's **Source Code** field:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/j9GTSEw0xEv_mJ1h/images/access-llm-code-step-with-ai.png?fit=max&auto=format&n=j9GTSEw0xEv_mJ1h&q=85&s=8daf37aca6a957b78a4b29b51e987869" alt="Generate code steps with AI" width="975" height="522" data-path="images/access-llm-code-step-with-ai.png" />

Test the step to ensure the generated code works as expected. If it doesn't on the first try, you can refine your prompt, explicitly provide the output of the previous step, and generate a new code snippet.
