Introduction
While schemas define what to extract, prompts guide how to extract it. A well-crafted prompt can significantly improve extraction accuracy, especially for edge cases and ambiguous documents.Prompt Basics
Default Behavior
If you don’t provide a prompt, Documind uses a generic extraction instruction:Custom Prompts
Add specific instructions to improve accuracy:Prompt Structure
Effective Prompt Template
Best Practices
1. Be Specific About Formats
- ❌ Vague
- ✅ Specific
2. Handle Ambiguity
Documents often have multiple similar values. Guide the extraction:3. Define Edge Cases
Tell the AI how to handle missing or unusual data:4. Specify Units and Currency
5. Handle Multiple Values
Domain-Specific Prompts
Invoices
Receipts
Forms
Contracts
Prompt Patterns
Pattern 1: Clarify Location
Help the AI know where to look:Pattern 2: Provide Examples
Show expected values:Pattern 3: Define Fallbacks
Handle missing data gracefully:Pattern 4: Normalize Data
Ensure consistent output:Pattern 5: Handle Calculations
Guide computed fields:Advanced Techniques
Multi-Document Types
If processing various document types:Language-Specific Instructions
For multi-language documents:Quality Checks
Add validation hints:Contextual Hints
Provide business context:Combining Prompts with Schemas
Schemas and prompts work together:Testing Prompts
A/B Testing
Compare different prompts on the same document:Prompt Iteration
- Start generic: Use a simple prompt
- Review errors: Note common mistakes
- Add specifics: Address errors in prompt
- Test again: Verify improvements
- Refine: Continue until satisfied
Common Mistakes
❌ Too Verbose
Solution: Be concise and direct.
❌ Contradicting Schema
Solution: Ensure prompt and schema align.
❌ No Guidance for Edge Cases
Solution: Add edge case handling.
❌ Assuming Document Structure
Solution: Provide multiple possible locations or labels.
Prompt Templates
General-Purpose Template
Strict Validation Template
Flexible Template
Next Steps
Schema Design
Design schemas that work with your prompts
Invoice Tutorial
See prompts in action for invoice processing
Core Concepts
Understand how prompts fit into the extraction workflow
API Reference
See the extraction API with prompt parameter