> For the complete documentation index, see [llms.txt](https://docs.allganize.ai/alli-llm-app-market/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.allganize.ai/alli-llm-app-market/manual/for_admin/default-apps/legal-contracts/contract-comparison.md).

# 契約書条項の抽出と比較

契約書条項の抽出と比較アプリでは、同じような契約書のそれぞれの条項を抽出し、比較ができる業務自動化アプリです。

## フロー全体図 <a href="#overall" id="overall"></a>

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

## 概要 <a href="#outline" id="outline"></a>

契約書条項の抽出と比較アプリは2つの契約書をアップロードし、それぞれの契約書から条項を抽出して変数に保存します。プロンプトで変数(それぞれ抽出した条項)を指定し比較した結果を表示します。

### ２つの契約書をアップロードする(LLMインプットノード) <a href="#llm-input-node" id="llm-input-node"></a>

LLMインプットノードでユーザーがアップロードした契約書の内容を下記の変数に保存しています。

フロー上では2つのファイルをアップロードできるように、ドキュメントインプットノードは2つ存在します。

2つのLLMインプットノードはそれぞれのファイルを保存する変数が違うのみでその他の設定は同一です。

* 選択タブ：アップロード
* 変数：＠DOC1、@DOC2
  * 変数種別：会話変数
  * タイプ：ドキュメント

<div><figure><img src="/files/1rmoy5k2D8xTAcWqu0hi" alt=""><figcaption></figcaption></figure> <figure><img src="/files/KfSE0cdHBZoZf0MHgJV8" alt=""><figcaption></figcaption></figure></div>

### アップロードされた契約書の主要条件を抽出する(LLM実行ノード) <a href="#llm-node1" id="llm-node1"></a>

ファイルをアップロードした直後のLLM実行ノードでは、アップロードされた契約書の情報を保存した変数(＠DOC1、@DOC2)をプロンプトで指定し実行しています。

フロー上では2つのファイルをアップロードできるように設計されているので、契約書の主要条件を抽出するためのLLM実行ノードも2つ存在します。

2つのLLM実行ノードはプロンプトで使う変数と応答内容を保存する変数が違うのみです。

* ベースモデル：ANTHROPIC CLAUDE 3.7 SONNET
* プロンプト：契約主要条件抽出、契約主要条件抽出2
* 応答内容を以下の変数に保存する：@TERM1、＠TERM2

<div><figure><img src="/files/zIEmcXVLwl4RBhuDUpeg" alt=""><figcaption></figcaption></figure> <figure><img src="/files/f3B4fogqLHITlZLIKjFo" alt=""><figcaption></figcaption></figure></div>

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

### 契約書の主要条件を比較する(LLM実行ノード) <a href="#llm-node2" id="llm-node2"></a>

前段のLLM実行ノードで生成された応答内容が保存された変数(@TERM1、＠TERM2)をプロンプトで指定し、主要条件の比較を実行しています。

* ベースモデル：ANTHROPIC CLAUDE 3.7
* プロンプト：契約主要項目比較

<div><figure><img src="/files/lwlwzUNL8SxpF5GyYFr2" alt=""><figcaption></figcaption></figure> <figure><img src="/files/pekP5PsDYtnZXGEnWD8s" alt=""><figcaption></figcaption></figure></div>

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


---

# 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.allganize.ai/alli-llm-app-market/manual/for_admin/default-apps/legal-contracts/contract-comparison.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.
