# Rein AI Copilot

Rein (ReOrc Intelligence) is an AI-powered copilot designed specifically for data transformations. It assists you in writing, fixing, and optimizing data transformation code. The copilot integrates directly into the platform's code editor, providing you with real-time assistance.

In ReOrc model editor, you can invoke Rein by simply highlighting a snippet and let it help you reign over complex data workflows.

<figure><img src="/files/hwtAUAxuiAxYiv6dGd9d" alt="" width="563"><figcaption></figcaption></figure>

We recommend highlighting the entire transformation to provide Rein with better context for code fixing and optimization. For each suggestion, Rein displays a diff view comparing the current version and the improved version. You can then accept or regenerate suggestions that best fit your use case.

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

## Code fixing

Rein can automatically identify and fix issues in transformation code. This feature helps you by:

* Detecting syntax errors and providing corrections
* Suggesting fixes for common query anti-patterns
* Ensuring proper column references and table dependencies

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

## Code optimization

The optimization feature helps improve the performance and efficiency of transformation code:

* Analyzes query patterns and suggests performance improvements
* Recommends better join strategies
* Identifies opportunities for query simplification
* Optimizes complex operations for better performance

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


---

# Agent Instructions: 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:

```
GET https://docs.reorc.com/ai-powered/rein-ai-copilot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
