> For the complete documentation index, see [llms.txt](https://evidano.gitbook.io/ailyze-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://evidano.gitbook.io/ailyze-docs/analyze-data/build-a-codebook.md).

# Build a Codebook

Create, refine, and validate the set of themes and codes Evidano uses to label your data, then check how reliably it was applied.

This page shows researchers how to build the [codebook](/ailyze-docs/reference/glossary.md#codebook) Evidano codes your documents with, refine it once the analysis is done, check how reliably the AI applied it, and reuse it in later projects. A codebook is the spine of qualitative rigor: [themes](/ailyze-docs/reference/glossary.md#theme), sub-themes, and codes, each with a clear definition. Evidano can draft one, but the best codebooks are curated by a person. Every control is listed in [Document Analysis Settings](/ailyze-docs/reference/settings/document-analysis.md#screen-8-the-results-page); spreadsheet differences are at the end.

## Before you start

* A document analysis: being set up for Step 1, finished for the later steps.
* A Pro plan for editing the codebook and checking accuracy on the results page.
* Optional: a codebook you already use, as a file or as text.

## Step 1: Set the starting codebook

In a document project, the draft has a themes section, **You will receive themes generated from the entire dataset**. Choose **Generate draft themes and sub-themes now** to let the AI draft a codebook, or **Add manually** to bring your own with **Type**, **Paste**, **Upload**, or **Use previous**. A codebook attached under **Supporting files** on the first step is imported word for word. [Discover Themes & Patterns](/ailyze-docs/analyze-data/discover-themes-and-patterns.md) walks through each route.

Keep the codebook focused: themes, sub-themes, and questions share one limit per project, listed on [Plans, Limits & Credits](/ailyze-docs/reference/plans-limits-and-credits.md#key-per-project-limits).

You should see your themes as a numbered list in the themes section before you start the analysis.

## Step 2: Open the codebook editor

On the results page, the **Codebook** is already open; click **Edit** in its header (Pro).

You should see the **Edit Codebook** editor with every theme, sub-theme, and code, and the quotes under each code.

<figure><img src="https://1178311500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi4GBXPMUDxszIpUVOARU%2Fuploads%2Fgit-blob-8f657c42638b5f993eb037bdf97881f8a4f8a75c%2Fsettings-document-analysis-39-codebook.png?alt=media" alt="Codebook open with Edit, the more-actions menu, Download, the search box and the link to the table of all documents"><figcaption><p>1 is Edit, 2 the ⋯ menu with Calculate AI accuracy and Edit groups to compare, 3 the downloads; the codebook tools sit here, not in the action row.</p></figcaption></figure>

## Step 3: Rename, merge, split, and move codes

Work through the editor:

* Drag a theme or sub-theme by its grip to reorder it; drag a sub-theme card onto another theme to move it.
* On a code, use **Rename code**, **Merge with other codes**, **Split into multiple codes**, or **Move to another theme, sub-theme or question**.
* Expand a code and drag a quote onto another code in the same theme.
* Give every code a one-line description, for example "Mentions of travel time, fuel, or fares to reach the clinic", so the coding stays consistent and others can apply it the same way.

Some changes apply as soon as you confirm them; the rest apply when you click **Save Changes**. **Undo** and **Reset to Original** step back before you save.

You should see the **Codebook** section show the new structure once the editor closes.

<figure><img src="https://1178311500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi4GBXPMUDxszIpUVOARU%2Fuploads%2Fgit-blob-737dcc7f493a03d056fe694310870aa06c83c843%2Fsettings-document-analysis-40-edit-codebook.png?alt=media" alt="Edit Codebook editor with a theme, a sub-theme and codes with their quotes and the rename, merge, split and move icons"><figcaption><p>The icons on each code row rename, merge, split, and move it; the grips on the left reorder.</p></figcaption></figure>

## Step 4: Start an accuracy review

In the **Codebook** header, open the ⋯ menu (**More codebook actions**) and click **Calculate AI accuracy** (Pro). In **Calculate AI accuracy**, pick how many coding decisions to review: one of the suggested sample sizes, or a number of your own in the **Custom** box.

You should see a table of decisions to review, each with the document, theme, code, and quote.

<figure><img src="https://1178311500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi4GBXPMUDxszIpUVOARU%2Fuploads%2Fgit-blob-2c1e6d612087977ea8249699949672770d7b990a%2Fsettings-document-analysis-41-ai-accuracy.png?alt=media" alt="Calculate AI accuracy dialog asking how many datapoints to review, with suggested sizes and Custom"><figcaption><p>The middle size is marked recommended; a larger sample gives steadier scores but takes longer to review.</p></figcaption></figure>

## Step 5: Review the decisions and act on the mistakes

1. For each row, click the tick if the AI coded it correctly, or the cross if not.
2. Read **Overall agreement** (Cohen's kappa), **Right when it applied a code**, and **Right when it left a code out** at the top, with a breakdown by code.
3. Click **Complete review** once every decision is checked.
4. Click **Fix AI mistakes** to fix definitions, remove wrong quotes, add missed ones, or recode.

You should see the scores update as you review, so weak themes stand out before you report.

<figure><img src="https://1178311500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi4GBXPMUDxszIpUVOARU%2Fuploads%2Fdqfm9ZwsrOtIOTIqM5Vn%2FBuild%20a%20Codebook%202.png?alt=media&amp;token=5bf92da1-3ee2-4192-b66f-f43a21e281b3" alt="Accuracy review with Overall agreement and the two accuracy cards above the coding decisions"><figcaption><p>Each score carries a confidence interval, which narrows as you review more rows.</p></figcaption></figure>

Unfinished and completed reviews are kept, so you can continue one later. The bin icon next to a review deletes it after a confirmation.

## Step 6: Reuse the codebook in a new project

In the next project's themes section, choose **Add manually** (or, once themes exist, click **Edit themes and sub-themes** and use **Replace with**), then **Use previous** and pick the earlier project. Its codes and their definitions come too. Every wave, site, or time period is then coded against the same themes, which is essential for longitudinal and comparative work.

You should see the earlier project's themes in the themes section, ready to adjust.

<details>

<summary>Optional: a checklist for a good codebook</summary>

* Codes are distinct, with little overlap.
* Each code has a description and an example quote.
* Codes are specific enough to be useful and broad enough to recur.
* Sub-themes genuinely belong to their theme.
* Names are in your project's language, not generic phrasing.

</details>

In spreadsheet projects, you can also audit at the row level on the **AI Labels as Checklist (with code justifications)** tab, and use **Find Similar Quotes** to catch responses that should share a code.

## Next steps

* [Discover Themes & Patterns](/ailyze-docs/analyze-data/discover-themes-and-patterns.md) — where your first codebook comes from.
* [Categorize Responses](/ailyze-docs/analyze-data/categorize-responses.md) — apply categories to every row of a table or a sheet.
* [Qualitative Research Best Practices](/ailyze-docs/methods-and-best-practices/qualitative-research-best-practices.md) — the methods behind good coding.
