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

# Chat

Chat is like collaborating with a colleague who sees your code, knows your data, and is a Python expert. Its ChatGPT integrated directly into Jupyter. It knows the current code cell you are editing and the column headers of your data, so it can generate code that runs in your analysis without copying and pasting or editing variable names.&#x20;

<figure><img src="/files/WViR2veOXF4sm6ziGVAI" alt=""><figcaption></figcaption></figure>

### How to use Chat?

1. **Open the chat taskpane** by clicking the <img src="/files/dNKQdNk1ptViGnUBUwYm" alt="" data-size="line">  icon in the toolbar on the left hand side of JupyterLab or by pressing `cmd / ctrl + E`.&#x20;
2. **Instruct the AI to write code for you.** Talk to it like you would a colleague who is looking at your computer screen. Mito provides the AI with context about your code and currently defined variables. For example, if you want the AI to filter the column `loan_amount` in datframe `loans_df`, the instruction "Filter loan amount to greater than 100k" should get the job done."
3. **Review the AI generated code.** New code created by the AI is highlighted in green. Code deleted by the AI is highlighted in red. Review the code to make sure the AI has not made any unwanted changes and that you understand the new code.&#x20;
4. **Accept or Reject the AI generated code.**&#x20;
   1. Press `cmd / ctrl + Y` to accept the AI generated code and write it to the current active code cell
   2. Press `cmd / ctrl + U` to reject the AI generated code and return the code cell to its previous state.  &#x20;

### Using Variable Mentions&#x20;

<figure><img src="/files/8xDuMTGdDF99ylkYbcJC" alt="" width="375"><figcaption></figcaption></figure>

To mention a specific variable in chat, enter the @ symbol.&#x20;

You'll then see a list of variables. If you don't see the variable you're looking for, keep tying to filter.&#x20;

### Chat History

You can select an existing chat history, or start a new chat thread by using the icons in the Mito AI sidebar. Use new chat threads to work on isolated problems, or switch to an existing conversation to pick up where you left off.&#x20;


---

# 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.trymito.io/mito-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.
