Introduction
A well-designed schema is crucial for accurate data extraction. This guide covers best practices, patterns, and anti-patterns for creating schemas that get the best results from Documind.Schema Structure Basics
Minimum Viable Schema
Start simple and iterate:Complete Schema Template
A production-ready schema with all recommended fields:Best Practices
1. Write Descriptive Field Names
- ❌ Bad
- ✅ Good
2. Always Include Descriptions
- ❌ Bad
- ✅ Good
3. Use Specific Field Descriptions
- ❌ Vague
- ✅ Specific
4. Specify Data Types Correctly
5. Mark Critical Fields as Required
Working with Arrays
Simple Arrays
For lists of primitive values:Array of Objects (Tables)
For structured lists like line items:Working with Arrays
Define arrays to extract repeating data:Working with Nested Objects
Simple Nesting
Group related fields:Deep Nesting
For complex structures:Common Patterns
Invoice Schema
Receipt Schema
Form Schema
Examples in Descriptions
Include examples to guide extraction:Common Mistakes
❌ Too Many Optional Fields
Solution: Mark at least 2-3 critical fields as required.
❌ Ambiguous Field Names
Solution: Use specific names:
invoice_date, total_amount, invoice_number.
❌ Missing Descriptions
Solution: Always include descriptions.
❌ Wrong Data Types
Solution: Use correct types.
❌ Overly Complex Schemas
Solution: Flatten or split into multiple extractions.
Schema Testing
Iterative Development
- Start simple: Extract only 2-3 fields
- Test: Run on sample documents
- Validate: Check accuracy
- Expand: Add more fields
- Repeat: Until all needed data is extracted
A/B Testing
Test different schema approaches:Next Steps
Prompt Design
Optimize extraction prompts for better results
Invoice Tutorial
Apply schema design to invoice processing
Core Concepts
Understand schemas in the context of Documind
API Reference
See the extraction API documentation