> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corti.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Build a template

> A walkthrough for building your first templates in Corti Console.

## Overview

A template is the structure of a finished clinical document. It brings together a set of sections (the individual parts of a note, such as Chief Complaint or Plan) in the order you want them to appear. To learn how templates and sections fit together, see [Intro to guided templates and sections](/textgen/console-templates/get-started).

Corti provides a set of standard templates out of the box, so the fastest way to get going is to copy one and adjust it. This guide covers both routes:

1. Edit a copy of a Corti template (recommended starting point).
2. Build a template from scratch (for more customized needs).

It also shows how to preview your output as you work, and how to add the metadata that keeps your library organized.

## Before you begin

Open **Templates** in Corti Console and go to the **template builder**. {/* TODO: link to the Console Templates page */} This is where you compose, preview, and save templates. Templates are built from sections which we will cover in the next section [Build a section](/textgen/console-templates/build-a-section).

## Edit a copy of a Corti template

<iframe className="w-full aspect-video rounded-xl" src="https://www.tella.tv/video/vid_cmqezspda00bd04jje2b3aj2p/embed?b=0&title=0&a=1&loop=0&t=0&muted=0&wt=1&o=1" title="Build a template" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

Starting from a Corti standard is the quickest way to a working template, and it means you inherit Corti's ongoing improvements.

<Steps>
  <Step title="Open a standard template">
    In the template builder, choose **Select a template** to view your library. Pick a template from the dialog, for example Corti **Brief Clinical Note**, then choose **Edit a copy**.

    <Tip>
      Use the filters in the library dialog to narrow by language, region, or
      specialty so you find the right starting point faster. See [Manage your
      templates and sections library](/textgen/console-templates/manage-library) for
      more on filtering.
    </Tip>
  </Step>

  <Step title="Make your changes">
    You now have your own copy of the template that you can shape to fit your needs. You can:

    * Add or remove sections from your section library.
    * Reorder sections to change how the document is laid out.
    * Adjust the sections themselves, such as their headings and instructions.

    <Note>
      **About inherited fields:** Some fields are highlighted in blue. These inherit their values from the Corti template you copied. Leave them as they are to automatically benefit from Corti's ongoing improvements, or override them to set your own value. You can revert an override at any time.

      Overriding a field replaces the inherited value with your own, and that field no longer follows the Corti original. Fields you leave inherited keep reflecting Corti's updates. Learn more about [inheritance](/textgen/inheritance).
    </Note>
  </Step>

  <Step title="Test your output as you go">
    The right-hand pane lets you see how your changes affect the generated document. Add your own sample data, such as a transcript, then choose **Run** to generate a document from your template. Keep editing and re-running to see the effect of each change.

    <Note>
      The preview uses the same generation engine as the documents API, so what you
      see here is what your integration produces in production. Learn how documents
      are generated through the API in [Guided Document
      Synthesis](/textgen/documents-guided-synthesis).
    </Note>
  </Step>

  <Step title="Save your template">
    When you are happy with the result, save the template to your library. Once saved, you can reference it via the API when generating documents in your own application, and, if you use the Embedded Assistant, make it available to your customers and their end users. See [Assign access to customers](/textgen/console-templates/manage-library#assign-access-to-customers).

    <Note>
      New templates are not visible to Embedded Assistant customers or users until
      you assign access. By default they are available only to API clients in your
      project.
    </Note>
  </Step>
</Steps>

## Build a template from scratch

<iframe className="w-full aspect-video rounded-xl" src="https://www.tella.tv/video/vid_cmqf0trt800tc04labwtq4d17/embed?b=0&title=0&a=1&loop=0&t=0&muted=0&wt=1&o=1" title="Build a template" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

We recommend starting from a Corti standard and adjusting it. Build from scratch when your document is so unique or customized that no Corti standard is a useful starting point.

<Steps>
  <Step title="Add sections">
    In the template builder, choose **Add sections** to begin composing your template. Pick the sections you need from your library and arrange them in the order they should appear in the document. You can include both Corti standard sections and sections you have created. To build a new section, see [Build a section](/textgen/console-templates/build-a-section).
  </Step>

  <Step title="Preview and refine">
    Use the preview pane to add sample data and **Run** the template, just as you
    would when editing a copy. Adjust the sections and ordering until the output
    matches what you need.
  </Step>

  <Step title="Save as a new template">
    Choose **Save as a new template**. You will be prompted to add a template name and any metadata before it is saved to your library.
  </Step>
</Steps>

## Add metadata to manage your templates

Metadata makes your template easy to find and organize as your library grows.

* **Name and description:** a clear, human-friendly label and summary so you and your team can identify the template at a glance.
* **Properties:** built-in properties such as Languages and Regions record where the template is intended to be used and let you filter your library by locale.
* **Custom properties:** define your own property, give it a name and one or more values (for example a property named Department with the value Cardiology), then filter on it to group related templates.

<Note>
  In the API, custom properties appear as labels, where the property name is the key and each value you enter is one of its values.

  Metadata is for organizing and filtering your library. It is not sent to the model and does not affect the content of generated documents.
</Note>

To filter your library by these properties, see [Manage your templates and sections library](/textgen/console-templates/manage-library).

## What's next

<CardGroup cols={2}>
  <Card title="Build a section" href="/textgen/console-templates/build-a-section">
    Create the building blocks your templates are made of.
  </Card>

  <Card title="Manage your library" href="/textgen/console-templates/manage-library">
    Filter your library and assign customer access.
  </Card>

  <Card title="Guided Document Synthesis" href="/textgen/documents-guided-synthesis">
    Generate documents from your templates via the API in your own application.
  </Card>
</CardGroup>

## FAQ

<AccordionGroup>
  <Accordion title="Does editing a copy change the original Corti template?">
    No. A copy is your own independent template. Corti standards are read-only
    and cannot be changed. Note that any fields you leave inherited (highlighted
    in blue) will continue to reflect Corti's updates to the original.
  </Accordion>

  <Accordion title="Who can see a template I create?">
    By default, a new template is available only to API clients in your project.
    It is not visible to Embedded Assistant customers or end users until you
    assign access. See [Assign access to
    customers](/textgen/console-templates/manage-library#assign-access-to-customers).
  </Accordion>

  <Accordion title="What is the difference between a template and a section?">
    A section is one part of a note, such as Allergies or Plan. A template is
    the full document, made by arranging sections in order. See [Intro to guided
    templates and sections](/textgen/console-templates/get-started).
  </Accordion>

  <Accordion title="Do I need to write prompts to build a template?">
    Not to assemble a template from existing sections. Writing and tuning
    prompts happens at the section level. See [Build a
    section](/textgen/console-templates/build-a-section).
  </Accordion>
</AccordionGroup>
