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

# File generation & analysis

Code Interpreter helps you turn questions and data into **computed answers** and **downloadable files -** right inside nexos.ai Chat.&#x20;

It can run Python code to analyze data, spot issues, and produce outputs you can use immediately.

***

### Capabilities

* **Analyze data** (especially spreadsheets and CSV-style data)
* **Create charts** to visualize results
* **Generate files** such as cleaned CSVs and reports, and attach them in the conversation

<figure><img src="https://4112003433-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDcOhapgXnoeDvgGQ8Jm4%2Fuploads%2FrZk2UktgHxocKVnwhS3q%2Fimage.png?alt=media&amp;token=dde7a407-1265-4a97-853a-ead87b6a71fd" alt=""><figcaption></figcaption></figure>

***

### Common use cases

* Clean and transform a CSV, then export a new version.
* Create a quick analysis and summary you can share.
* Debug data issues by finding errors and anomalies.

***

### Where it works

You can use Code Interpreter in:

* **Chat**
* **Agents** (great for repeatable workflows with saved instructions)&#x20;

***

### How to use it

{% stepper %}
{% step %}

#### Start a new chat&#x20;

You can do that in Chat or Agents.
{% endstep %}

{% step %}

#### Provide your data

* Add files to use them as source material in chats
* Or describe what you want to generate (for example: “Create a cleaned CSV and a chart”)
  {% endstep %}

{% step %}

#### Ask for the outcome

Examples:

* “Clean this dataset and export a new CSV.”
* “Summarize trends and generate a simple report.”
* “Create a chart of revenue by month.”

Your results will appear in Chat, and generated files will be attached when available.
{% endstep %}
{% endstepper %}

***

### Tips for best results

* Specify desired output: **CSV, chart, or other specific document format**.
* Name the columns or metrics you care about (e.g., “group by month,” “remove duplicates”).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nexos.ai/workspace/chat/file-generation-and-analysis.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
