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

# 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>
