Document Generation
Generate new documents from extracted data and templates.
What is Generation?
Document generation creates new documents by combining:
- Extracted data from documents
- AI-powered content generation
- Custom templates
Use cases:
- Summary reports from multiple documents
- Filled forms and contracts
- Standardized reports from varied inputs
- Executive summaries
Generating Documents
From the Dashboard
- Go to Generate in the sidebar
- Choose your source:
- Extraction results
- Documents
- Both
- Enter generation prompt or select a template
- Choose output format
- Click Generate
From Extracted Data
Generate documents using extraction results:
- Run an extraction on a document
- Click Generate Report from the extraction view
- Choose a template or write a prompt
- Generate the document
Output Formats
| Format | Description | Best For |
|---|---|---|
| Professional documents | Reports, contracts | |
| DOCX | Editable Word documents | Documents needing edits |
| Markdown | Text with formatting | Documentation |
| HTML | Web-ready content | Web publishing |
Templates
Using Templates
Templates provide reusable generation patterns:
- Go to Generate → Templates
- Select a template
- Provide source data
- Generate
Creating Templates
Create custom templates:
{
"name": "Invoice Summary",
"template_prompt": "Create a professional summary report from the invoice data. Include:\n- Vendor information\n- Line item details\n- Total amounts\n- Payment terms",
"output_format": "pdf",
"settings": {
"style": "professional",
"sections": ["summary", "details", "totals"]
}
}Template Variables
Reference extracted data in templates:
| Variable | Description |
|---|---|
{{field_name}} | Extracted field value |
{{document.name}} | Source document name |
{{date}} | Current date |
{{user.name}} | User name |
Example prompt:
Generate a summary report for {{vendor_name}}.
Invoice: {{invoice_number}}
Date: {{invoice_date}}
Total: ${{total_amount}}
Include all line items and payment terms.Generation Types
Summary Reports
Condense multiple documents into summaries:
{
"source_document_ids": ["doc1", "doc2", "doc3"],
"config": {
"outputFormat": "pdf",
"length": "medium",
"style": "executive"
}
}Structured Reports
Generate formatted reports from extractions:
{
"source_extraction_ids": ["ext1", "ext2"],
"config": {
"title": "Monthly Invoice Report",
"outputFormat": "pdf",
"sections": ["summary", "details", "charts"]
}
}Custom Documents
Generate any document with custom prompts:
{
"template_prompt": "Write a cover letter summarizing the key findings from these documents...",
"output_format": "docx",
"source_document_ids": ["doc1"]
}Settings
Style Settings
| Style | Description |
|---|---|
professional | Formal business style |
casual | Conversational tone |
technical | Detailed technical style |
executive | High-level summary |
Length Settings
| Length | Description |
|---|---|
short | 1-2 paragraphs |
medium | 3-5 paragraphs |
long | Comprehensive document |
Monitoring Generation
Job Status
Track generation progress:
| Status | Description |
|---|---|
pending | Queued for processing |
generating | Creating content |
formatting | Converting to output format |
uploading | Saving final document |
completed | Ready for download |
Viewing Results
Once complete:
- Download the generated document
- View in document viewer
- Make additional edits if needed
Workflow Integration
Add generation to workflows:
{
"type": "generate",
"config": {
"template_id": "invoice-summary",
"output_format": "pdf"
}
}This enables automated report generation when documents are processed.
Best Practices
- Clear prompts - Be specific about what you want
- Test templates - Verify with sample data first
- Review outputs - Always review generated content
- Use extractions - Structure data before generating
- Choose appropriate format - Match format to use case
API Reference
See the Generate API for programmatic access.
Last updated on