> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.contracthero.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to write a prompt in ContractHero

ContractHero's **contract analysis** uses AI to extract key data from your contracts automatically. Here's how it works, and how to write prompts that get good results.

## Automated data extraction

The AI extracts critical contract information — **dates**, **parties involved**, **financial terms** — from uploaded documents. That saves time and removes manual data entry.

## The contract analysis process

1. **Document upload.** You upload the contract document into the system.
2. **OCR (optical character recognition).** The system converts the text in the contract into a machine-readable format, so even scanned or image-based documents can be analysed.
3. **Custom field data extraction.** The AI extracts information based on your predefined **custom fields**. These are tailored to the contract category, so only data relevant to that contract type is pulled.
4. **The AI request.** For each field, the AI receives:
* **Contract document text** — the raw text extracted from the contract
* **Field name** — the label for the data being requested (e.g. "Start date")
* **Field type** — the format of the expected data (date, number, text)
* **Field prompt** — what the AI should look for in the contract
5. **The result.** The AI scans the document and matches the information against your prompt and the field type.

## What ContractHero already provides

You do not need to include any of this in your prompt — it is passed to the AI automatically:

* **Task guidance.** Which contract category it is working with, so extraction is tailored to the document type.
* **Field formatting.** Extracted data is formatted according to the **field type** (date formats, numerical values).
* **Organizational context.** The AI knows your organization's name, which helps it identify the relevant clauses.
* **Bilingual support.** Contracts in both **English and German** can be analysed.

## Writing effective prompts

### 1. Be specific

* ❌ "What date is written in the contract?"
* ✅ "What start date is written in the contract?"

Clear, specific questions help the AI focus on the right information.

### 2. Describe the value you want

* ❌ "When does the contract start?"
* ✅ "What is the start date of the contract? Often found under 'contract term' or 'contract duration'."

Pointing at where the information usually sits helps the AI locate it.

### 3. Do not list the options of a list field

* ❌ "Select Car or Coffee machine"
* ✅ "Which item is being leased?"

The AI already knows the options stored on the field and matches by meaning — the wording does not have to be identical. What matters is that the **options themselves** are unambiguous: if "ContractHero" and "ContractHero GmbH" sit side by side, the AI has to guess which one you mean.

### 4. Keep the field name and the prompt aligned

* ❌ The field is called "Payment" but the prompt asks about "salary".
* ✅ If the field is "Payment", the prompt refers to payment.

Consistent terminology between field name and prompt gives more accurate extraction.

### 5. Point at where it usually appears

* ✅ "What is the termination date of the contract? This is often listed at the end of the agreement or in a section titled 'Termination'."

## Where to enter the prompt

Go to **Settings → Field builder → Contract field builder**, open a field via its gear icon, and write your prompt in the box under **"Optional: Tell AI to extract the key details by giving a specific description related to this field"**. Below it you'll find **Test in a contract**, **Improve prompt** and **Re-analyse field**. Save with **Update**.

## Related articles

* [Optimizing AI Prompts — Get Better Results from Contract Analysis](https://support.contracthero.com/en-us/article/optimizing-ai-prompts-get-better-results-from-contract-analysis-17apnop/)
* [How our AI reads contracts: prompt, instruction and the path to a field value](https://support.contracthero.com/en-us/article/how-our-ai-reads-contracts-prompt-instruction-and-the-path-to-a-field-value-1oswbqd/)
* [Simple prompt examples for AI contract analysis](https://support.contracthero.com/en-us/article/simple-prompt-examples-for-ai-contract-analysis-1tl8za2/)
* [Contract AI assistant: ask your contract instead of searching it](https://support.contracthero.com/en-us/article/contract-ai-assistant-ask-your-contract-instead-of-searching-it-gaxfgv/)