# Smart Merge

The Smart Merge option allows you to intelligently merge two clauses (or selections of text) in an intelligent way, with the help of Artificial Intelligence. &#x20;

## How to invoke

Smart Merge is not a separate module that you can activate through the home page of ClauseBuddy; instead, it can be invoked before you insert a clause into your MS Word document. For example, within the Quality Library, it would be shown as follows:

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2FNB57pPvpb4nDRxU3g9Os%2Fimage.png?alt=media&#x26;token=c962c4f0-e9cf-4465-9f8b-ffc43ef8202c" alt="" width="563"><figcaption></figcaption></figure>

Similar popup-menus can be found within Samples Hunt, Truffle Hunt and AutoSuggest.&#x20;

## Selecting the texts to merge

When you invoke Smart Merge, it will show show a dialog box with two different texts:

* The text on the left side will consist of your currently selected text in MS Word, or — when no text is selected at all — the paragraph your cursor is currently positioned in.&#x20;
* The text on the right side will consist of the clause you were dealing with in ClauseBuddy (e.g., the AutoSuggest clause you selected and for which you invoked the popup-menu through the big "+" button).&#x20;

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2FHihbCAPyv3UQVtBDwolC%2Fimage.png?alt=media&#x26;token=b0adaa05-e14e-485b-ab4a-5c0cb0d4da7a" alt="" width="563"><figcaption></figcaption></figure>

However, you can change the text at either side by clicking on either the *Use selection* button  (which will pick up the text from your current selection in MS Word) or through the *Paste text* button (which will paste text from your clipboard). So even if the dialog box was initially filled with some text, you can completely change these texts however you want.

Once your left side (*Target clause)* and right side (*Merge with*) are selected, you can click on the purple *Analyse* button to start the AI-analysis of the two texts.&#x20;

## Choosing relevant legal features

The AI will analyse your clauses to extract "legal features", i.e. relevant legal elements for the context, e.g. the way the duration of a contract is expressed, or the fact that some arbitration panel is chosen, or a certain termination right. The AI will thereby focus on relevant content-related legal differences, and skip over mere grammatical differences.&#x20;

For example, the two simple clauses shown in the previous screenshot, were broken down into the following legal features:&#x20;

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2FQWeKKoBBhcKdfHQGIDo3%2Fimage.png?alt=media&#x26;token=f8e0a2d7-734e-4e12-90b1-bd60d02ef893" alt="" width="563"><figcaption></figcaption></figure>

Initially, all the legal features of the *Target clause* will be selected, while none of the *Merge with* features will be selected. It is then up to you do decide which features you want to add or remove, simply by clicking on either the green/red button or the associated text.&#x20;

You can click on the *eye* icon at the right to see the actual text associated with this legal feature:&#x20;

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2FWfmWg1o5byzikQarLwQV%2Fimage.png?alt=media&#x26;token=ce028858-cc8f-46c4-95d7-d94723ea2c69" alt="" width="563"><figcaption></figcaption></figure>

As you can see in the screenshot, it may also happen that legal features are "conflicting" with each other. For example, the clause on the left required complaints to be submitted within one month, while the clause on the right requires three months. You can hover over the orange or red *Conflicting* button to see the label(s) of the conflicting legal feature (conflicts may also exist with multiple legal features at once) :&#x20;

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2FE7Pk2XCpsesKFl8jOLAK%2Fimage.png?alt=media&#x26;token=77f2e13e-4ed6-49c5-bbd1-0f14f3011e67" alt="" width="563"><figcaption></figcaption></figure>

The orange *Conflicting* warning merely expresses that there are potential conflicts; if you simultaneously enable two conflicting legal features, the orange will turn into red:&#x20;

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2FnGaYNK9HHgwLztM5bb8z%2Fimage.png?alt=media&#x26;token=ad78f14e-eb37-4054-9568-e6c0aca53899" alt="" width="563"><figcaption></figcaption></figure>

You will then, likely, want to disable one of the two conflicting legal features. For example, in the example below, the conflicting requirement from *Merge with* was deselected again

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2FbfRxoM0bEuNIwUaPmwa9%2Fimage.png?alt=media&#x26;token=51b5a130-8a47-4478-98f1-011e89ef9656" alt="" width="563"><figcaption></figcaption></figure>

Once you have selected all the legal features you like, you can click on the purple *Merge* button to ask ClauseBuddy to merge the two clauses in the way you expressed. The AI will start from the target clause (i.e., the one that was initially at the left) and then:&#x20;

* remove undesired legal features, i.e. legal featurs that you disabled from the *Target* clause
* add new legal features, i.e. legal features that you enabled in the *Merge with* clause

The AI will thereby start from the *Target* clause's terminology, and adapt the wording of the legal featuress taken from the *Merge with* clause, so that they are more consistent with the *Target* clause. You should however be aware that this merging operation will not be perfect, although the AI will often do a pretty good job.&#x20;

{% hint style="warning" %}
In case you did not resolve conflicts and nevertheless merged, the AI will usually give precedence to the legal feature in the *Merge with* clause, to the detriment of the corresponding legal feature in the *Target* clause.
{% endhint %}

## Inspecting the merge result

The AI will show you the final result:&#x20;

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2FPuWfIJWOezo1HYVWNg41%2Fimage.png?alt=media&#x26;token=4e81c55e-fe89-4284-8bd8-e203c59024a1" alt="" width="563"><figcaption></figcaption></figure>

You may want to check the difference between this text and the initial *Target* clause by clicking on the grey *Compare* button:&#x20;

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2FKFnaolvmDFt8cKRXUc4n%2Fimage.png?alt=media&#x26;token=c4cf0c92-cfbb-4011-839e-a2374d37e956" alt="" width="563"><figcaption></figcaption></figure>

Finally,  you can insert the new text into your MS Word file by clicking on the purple *+ Insert* button. As is the case with this popup-menu elsewhere in ClauseBuddy, you can choose to either insert the new text

* **as-is**, effectively removing the currently selected text (if any) in MS Word
* **with "track changes"**:&#x20;
  * if no text is currently selected in MS Word, then the entire clause will be shown as an insertion
  * if some text is effectively selected in MS Word, then ClauseBuddy will compare the currently selected text of each paragraph with the new text that you're about to insert, so that partial insertions and deletions will typically be generated.

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2Fg84jRxX4U7Kiz7dgijBT%2Fimage.png?alt=media&#x26;token=97167482-a208-4b69-9d56-0a1386896720" alt="" width="563"><figcaption></figcaption></figure>

For example, when choosing *Insert with changes* while the initial clause was selected, the following result is generated in MS Word:&#x20;

<figure><img src="https://3973291716-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdIikmtDLHVBBEYLUJmKd%2Fuploads%2FmILZvJyUqoDjy0CHdNXP%2FScreenshot%202025-08-13%20at%2009.40.05.png?alt=media&#x26;token=7a09acdc-419f-4b63-a23f-35d3b6aafe87" alt="" width="363"><figcaption></figcaption></figure>
