> For the complete documentation index, see [llms.txt](https://docs.courtaid.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.courtaid.ai/chat-and-documents/document-drafter.md).

# Document Drafter

The Document Drafter is an AI assistant that writes and edits legal documents with you. You describe what you need, and it drafts it — searching your matter's files and CourtAid's corpus of legislation and case law as it goes — in a two-panel workspace where the document sits on the left and the assistant on the right.

![The Document Drafter workspace — document on the left, drafting assistant on the right](/files/k60TENGa14bxZqNHMxLm)

{% hint style="info" %}
The Drafter produces a **first draft for you to review and refine**, not final legal advice. It cites the sources it relies on and never silently changes your document — every AI edit after the first draft is shown as a change you approve or reject.
{% endhint %}

## How it works

When you start a draft, the assistant:

1. **Thinks first** — it streams a short plan of what it's going to write before it starts.
2. **Searches (when useful)** — it can look through the documents in your matter and search CourtAid's legal corpus, returning clickable citations for anything it relies on.
3. **Writes the document** — the finished draft lands in the editor, formatted with proper clause headings and numbering.
4. **Asks before guessing** — if your brief is ambiguous (for example, which state's law governs), it asks a clarifying question rather than inventing details.

You then review, edit, and export the result.

## Creating a new draft

From the **Drafts** section (sidebar → your matter → **Drafts**, or the standalone **Document Drafter** page), click **New document**. A short three-step wizard opens.

![The New document wizard](/files/k9VxSVpggV9OL0fI5WZK)

### Step 1 — Details

Give the draft a **Name** and write a **Description** — this is your brief. Be specific about what you want and any key terms, for example:

> *"Draft a mutual NDA using the attached invoice for the party details, 2-year term, NSW law."*

### Step 2 — Documents

Optionally link a **Matter**, then choose what the draft starts from:

* **None** — start from a blank document
* **Upload** — add a file from your device
* **From this matter / My documents** — pin up to **three** existing documents

Pinned and uploaded files are used as **reference material** — the assistant reads them for details like parties, dates, and amounts (or reproduces one as the basis of your draft). Supported file types are `.pdf`, `.doc`, `.docx`, and `.txt`.

### Step 3 — Questions

CourtAid reads your brief and prepares **two to four clarifying questions** (for example: governing jurisdiction, the parties, the term, or mutual vs. one-way). Answer them by typing — but they're **optional**. Anything you leave blank is filled with a clear placeholder rather than a guessed detail, so you can always **Skip & create draft**.

When you continue, the draft is created and the assistant immediately starts writing.

## The drafting workspace

The workspace has two panels (they stack vertically on small screens):

* **Left — your document.** A full rich-text editor, like a page in a word processor, with a formatting toolbar (headings, bold/italic, lists, tables, colours, and more). A status bar at the bottom shows your **word count** and a live **Saving… / Saved** indicator.
* **Right — the Drafting assistant.** A chat panel where you talk to the assistant, attach more reference files, and watch its progress (**Thinking**, search results, and a *"…characters so far"* counter while it writes).

The header across the top holds the editable **title**, **Import** and **Export** buttons, and a toggle to **hide the assistant** for a full-width editor.

{% hint style="info" %}
Writing a document can take **30–90 seconds**, and a few seconds of silence is normal while the assistant works. A live "elapsed" timer confirms it's still going.
{% endhint %}

## Editing your draft

You can edit in three ways:

* **Type directly.** The document is fully editable, and changes **autosave** automatically — there's no Save button.
* **Ask the assistant.** Type an instruction in the panel (for example, *"revise clause 3 to add a carve-out"*). The assistant proposes the change **as a coloured diff inside the document** — additions in green, removals struck through in red — with **Accept** and **Reject** controls next to it. Nothing is applied until you accept.
* **Inline edit a selection.** Highlight some text and press **⌘K** (or use the **Edit** button in the pop-up menu) to change just that passage — *"make it stricter", "simplify", "add a carve-out"*. The result comes back as the same accept/reject diff.

The one exception is the **very first draft**, which is applied for you automatically — you never have to accept a document you haven't seen yet.

## Sources the assistant can use

* **Your reference documents** — files pinned or uploaded to the draft (up to three at a time), read for context or reproduced as the draft.
* **Your matter** — if the draft is linked to a matter, the assistant can search that matter's documents while drafting.
* **CourtAid's legal corpus** — it can search legislation and case law and include **clickable citations**, shown as source cards in the panel. It is instructed never to invent citations.

Clarifying questions and the assistant's search filters target the **governing jurisdiction** so the draft is written for the right law.

## Exporting and importing

* **Export** (header → Export) to **Word (.docx)**, **PDF**, or **Markdown (.md)**.
* **Import** a `.pdf`, `.doc`, `.docx`, or `.txt` file to replace the document body — useful for starting from an existing draft. Word files keep their headings, bold, lists, and tables; PDFs come in as plain text.
* Your work **autosaves** continuously (and to the linked matter, if there is one).

## Queries & billing

Drafting uses your **query allowance**, but efficiently — one query buys a **block of assistant turns**, not a single message:

* Your first draft costs **1 query**, and that same query also covers the next few follow-up messages. The panel shows a live hint, such as *"Next message uses 1 query — it covers 5 follow-ups"* or *"N more messages included in this query."*
* **Clarifying questions are free**, and so are runs that **fail or are cancelled** — you're never charged for a draft you didn't get.
* **Reading, editing, importing, and exporting are always free** — you can always get your document out, even at a zero balance.

If you're part of an organisation, drafting draws on your team's **shared query pool**. See [Plans, trials & query limits](/account-and-billing/plans-and-queries.md).

## Best practice

The Drafter gives you a fast, well-structured **first draft**. Before you rely on it or send it out:

* Read the whole document against your instructions and reference files
* Check every citation against its source
* Confirm the governing law, parties, dates, and figures are correct
* Fill in any placeholders the assistant left where details were missing

{% hint style="warning" %}
CourtAid provides research and drafting assistance, not legal advice. Every draft is a starting point for a qualified lawyer to review — always check it before relying on it or sending it to a client or court.
{% endhint %}

## Related

* [Projects](/matter-workspaces/projects.md) — link a draft to a matter so the assistant can use its documents
* [Sources & citations](/legal-research-and-search/sources-and-citations.md) — how CourtAid cites the law it relies on
* [Chat PDF](/chat-and-documents/chat-pdf.md) — talk to a single document
* [Plans, trials & query limits](/account-and-billing/plans-and-queries.md) — how queries are counted


---

# 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.courtaid.ai/chat-and-documents/document-drafter.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.
