> For the complete documentation index, see [llms.txt](https://docs.sdv.dev/sdv/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sdv.dev/sdv/explore/sdv-bundles/cag.md).

# ❖ CAG

Constraint Augmented Generation (CAG) is a powerful system that allows you to input business logic into your complex schemas. Fast, easy, and flexible, these constraints allow you to create synthetic data that conforms to your logic, 100% of the time.

:star: **Automatically discover business logic & data lineage properties.** CAG can auto-detect commonly occurring business rules in your dataset and recommend constraints to address them.&#x20;

**⭐️ Apply constraints across multiple tables.** Add business logic that determines the connections between tables, or the type of data that linked tables are allowed to have.

**⭐️ Access complex, powerful algorithms with simple APIs.** CAG supports constraints that are more complex, often incorporating different algorithms to get you the data you need. The best part? There's one, simple API to denote your constraint.

<figure><img src="/files/7kNIOSriyZOBJFlaz4Wh" alt=""><figcaption><p>In this example, only Accounts with Type=PREMIUM are allowed to have associated Purchases. Achieve this with the <a href="/pages/i61srEg6fRCTzWOk7cLp">ForeignToPrimaryKeySubset</a> constraint.</p></figcaption></figure>

{% hint style="info" %}
Bundles are available to licensed users. Sign up now to get your license key. You can then complete your installation on-prem and begin using the features.

<p align="center"><a href="https://portal.datacebo.com/signup" class="button primary">Get Started</a><a href="https://datacebo.com/pricing/" class="button secondary">View Pricing</a></p>
{% endhint %}

## Included Features

**Predefined constraints**: This bundle includes an expansive suite of constraints that contain advanced, multi-table logic & algorithms: They include [CarryOverColumns](/sdv/modeling/constraint-augmented-generation-cag/predefined-constraints/carryovercolumns.md), [DenormalizedTable](/sdv/modeling/constraint-augmented-generation-cag/predefined-constraints/denormalizedtable.md), [PolymorphicRelationship](/sdv/modeling/constraint-augmented-generation-cag/predefined-constraints/polymorphic-relationship.md), and more. This bundle also includes access to some advanced single-table constraints.

:star: [**Click to browse all constraints**](/sdv/modeling/constraint-augmented-generation-cag/predefined-constraints.md) :star:

**Constraint auto-detection**: This bundle allows you to [automatically detect predefined constraints](/sdv/modeling/constraint-augmented-generation-cag/auto-detect-constraints.md), inspect them, and add them to your synthesizer.

**Support for programmable constraints**: Your database may occasionally contain additional logic that cannot be represented by any of the predefined constraints. In this case, our team provides support to meet your business rules.

## Installation

Use your SDV Enterprise credentials to install SDV Enterprise and all bundles that you have access to.

```bash
% pip install sdv-installer --upgrade
% sdv-installer install --upgrade
```

```
Username: <email>
License Key: ********************************

Installing SDV Enterprise:
sdv-enterprise (version 0.30.0) - Installed!

Installing Bundles:
bundle-cag - Installed!
bundle-xsynthesizers - Installed!

Success! All packages have been installed. You are ready to use SDV Enterprise.
```

{% hint style="info" %}
For more information about installing SDV Enterprise features and bundles, see our [**Enterprise Installation Guide**](https://docs.sdv.dev/sdv-enterprise/sdv-enterprise/installation).
{% endhint %}


---

# 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.sdv.dev/sdv/explore/sdv-bundles/cag.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.
