Skip to main content

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.

← Back to Guided Synthesis overview Use this when you don’t have a template that matches your need, but you do have the sections. List the sections you want, in the order they should appear, and supply template-level instructions. The response includes the new auto-generated template aggregate — keep its templateId to reuse the same composition on subsequent calls. The aggregate is retained for 30 days only (see Auto-generated template aggregates — 30-day retention); convert it into a permanent project-owned template if you want long-lived reuse.
// Replace these with your values
const ALLERGIES_SECTION_ID = "<your-section-id>";
const ASSESSMENT_SECTION_ID = "<your-section-id>";
const HPI_SECTION_ID = "<your-section-id>";
const INTERACTION_ID = "<your-interaction-id>";
const PLAN_SECTION_ID = "<your-section-id>";
const PLAN_VERSION_ID = "<your-version-id>";

const result = await client.documents.generate({
  outputLanguage: "en-US",
  interactionId: INTERACTION_ID,
  assemblyTemplate: {
    name: "Allergy follow-up note",
    instructions: {
      prompt: "Produce a focused follow-up note for an allergy consultation.",
    },
    sectionRefs: [
      { sectionId: HPI_SECTION_ID },
      { sectionId: ALLERGIES_SECTION_ID },
      {
        sectionId: ASSESSMENT_SECTION_ID,
        overrides: {
          heading: "Impression",
          instructions: { writingStylePrompt: "Telegraphic; no narrative." },
        },
      },
      { sectionId: PLAN_SECTION_ID, sectionVersionId: PLAN_VERSION_ID },
    ],
  },
});

Behavior notes

  • sectionRefs is order-significant — sections appear in the rendered document in declaration order.
  • Each sectionRef resolves to the section’s published version unless you pin sectionVersionId.
  • overrides on a sectionRef follow the same partial/wholesale rules as Path 2.

When to use this path

ScenarioWhy Path 3
EHR-field-driven note where the section set varies per encounterCompose the right sections per call without authoring a template per combination.
One document built from a few Corti Standard sectionsSkip the template authoring step entirely. The auto-generated aggregate is your “receipt.”
Customer-specific composition that you may eventually promote to a permanent templateRun Path 3 first; if the same composition recurs, convert the aggregate into a project-owned template via the retention workaround.

Guided Synthesis overview

Shared concepts: input context, response shape, errors, 30-day retention.

Create a Template

When you’re ready to promote a recurring assembly into a stable, versioned template.