Skip to main content

30-Second Quick Start


Async Client Pattern

The current Dex SDK is async-only. Prefer async with DexClient(...) when you are making multiple calls so the underlying HTTP connection can be reused:

Data Retention Policies

Configure automatic data lifecycle management for compliance and cost optimization.

Setting Retention Policies

Updating Retention Policies

Retention Policy Use Cases

Compliance (GDPR, HIPAA):
Cost Optimization:
Security (Minimize Exposure):

Optimizing Extraction Accuracy

  1. Write Clear Prompts
  2. Design Good Schemas
  3. Enable Citations and Confidence
    • Always set generate_citations=True for debugging
    • Use generate_confidence=True to filter low-confidence results
  4. Use Vector Stores for Large Documents
    • Documents > 50 pages benefit from RAG-enhanced extraction
    • Vector stores improve accuracy for cross-document queries

Getting SGP Traces for Extraction

Use start_extract_job instead of extract to get async jobs that are linked to SGP traces. Search for traces by job ID to debug extraction latency, token usage, or failures.

Common Workflows

Single Document Processing:
Multi-Document Analysis:
Iterative Refinement:
Production Pipeline:

Performance Optimization

Reduce Latency

  1. Use appropriate chunking: Smaller chunks = faster parsing
  2. Limit OCR scope: Only process pages you need
  3. Batch operations: Process multiple files in parallel
  4. Cache parse results: Reuse parsed documents for multiple extractions

Reduce Costs

  1. Set retention policies: Auto-delete old data
  2. Choose right model: Use smaller models when possible
  3. Optimize prompts: Shorter prompts = lower token costs
  4. Filter before extraction: Use vector search to find relevant chunks first

Common Errors & Quick Fixes


Access Response Data

Remember: SDK methods return wrapper objects. Use .data for full entity fields, and use convenience properties like .id when available:
Common Response Attributes:

Type Import Quick Lookup

Response Types (accessed via .data, no import needed):
  • ProjectEntity, FileEntity, ParseResultEntity, ExtractionEntity, VectorStoreEntity

Next Steps