Document templates
Document templates
Build templates with placeholders that mechanically substitute from
matter data, then have the AI fill any free-form narrative gaps. Live
at /admin/legal/templates.
Placeholder vocabulary
{{matter.title}} matter title{{matter.number}} matter number{{matter.type}} type (litigation / m_and_a / ...){{matter.court}} court{{matter.docket}} docket number{{matter.jurisdiction}} jurisdiction{{matter.description}} free-text description{{matter.opened}} ISO date matter opened{{matter.billing}} billing model (hourly / flat / contingency){{matter.flat_fee_usd}} if flat-fee{{client.name}} display name{{client.first_name}} for individuals{{client.last_name}} for individuals{{client.organization_name}} for orgs{{client.email}} email{{client.phone}} phone{{client.address}} street{{client.city}} city{{client.state}} state{{client.postal_code}} ZIP{{parties.0.name}} first party's name{{parties.0.role}} first party's role{{today}} YYYY-MM-DD{{today_long}} "May 24, 2026"Unresolved placeholders render as [[matter.field]] so the user sees
what’s missing.
Narrative blocks
For free-form sections, write:
{{narrative: describe the scope of engagement based on matter type and any specifics}}After mechanical substitution, the LLM is asked to replace every
{{narrative: ...}} block with prose that matches the surrounding
register. Original draft stays byte-identical outside those blocks.
LLM system prompt
Templates can carry a custom llm_system_prompt that overlays the
default narrative-pass system message. Useful for “always cite
California law” or “match our firm’s formal-counsel register”
templates.
Generating
From the template card, click Generate for matter → pick a matter from the dropdown → Generate. Output renders in a read-only block with a Copy button. Stats above the output show how many placeholders filled and how many narrative blocks resolved.
Example — engagement letter
Dear {{client.name}},
This letter confirms our representation in {{matter.title}}(matter no. {{matter.number}}).
{{narrative: describe scope of engagement based on matter type andany specifics}}
Our fees will be billed {{matter.billing}}.
Very truly yours,Click Generate → engagement letter pre-filled with client + matter + billing model, with a fully-written scope paragraph the AI synthesized from matter data.