# ❖ 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="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2Fp2u3pw3gU0KZSrX5pJWK%2FCAG-bundle_March%2018%202025.png?alt=media&#x26;token=e6d0fecb-b3ad-4f09-8eb2-95def3ce9fda" alt=""><figcaption><p>In this example, only Accounts with Type=PREMIUM are allowed to have associated Purchases. Achieve this with the <a href="../../concepts/constraint-augmented-generation-cag/predefined-constraints/foreigntoprimarykeysubset">ForeignToPrimaryKeySubset</a> constraint.</p></figcaption></figure>

## Included Features

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

:star: [**Click to browse all constraints**](https://docs.sdv.dev/sdv/concepts/constraint-augmented-generation-cag/predefined-constraints) :star:

**Constraint auto-detection**: This bundle allows you to [automatically detect predefined constraints](https://docs.sdv.dev/sdv/concepts/constraint-augmented-generation-cag/auto-detect-constraints), 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 in using [programmable constraints](https://docs.sdv.dev/sdv/concepts/constraint-augmented-generation-cag/program-your-own-constraint) 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 %}
