Skip to main content

Store Commands

The kdx store command provides extended operations for working with document stores beyond basic CRUD operations.

Available Commands

CommandDescription
uploadUpload a file to a document store
watchMonitor document processing progress
statsShow store statistics
reindexTrigger store reindexing

Upload Documents

Upload files (PDF, images, documents) to a document store for processing.
kdx store upload <store-ref> <file-path>

Parameters

ParameterDescription
store-refStore reference in format org/store-name:version
file-pathPath to the file to upload

Examples

# Upload a PDF to a store
kdx store upload satori/my-project-processing:1.0.0 ./invoice.pdf

# Upload with full path
kdx store upload my-org/document-store:1.0.0 /path/to/financial-statement.pdf

Output

Uploading invoice.pdf to store satori/my-project-processing:1.0.0...
✓ Document family created: a700ca3e-38e7-4e63-8974-59c2e9058cf3
The command returns the document family ID which you can use with kdx store watch to monitor processing.

Watch Processing Progress

Monitor a document family as it progresses through the processing pipeline.
kdx store watch <document-family-id> [flags]

Flags

FlagDefaultDescription
--labelPROCESSEDTarget label to wait for
--timeout600Timeout in seconds
--poll-interval3Poll interval in seconds

Processing Labels

Documents typically progress through these labels:
LabelDescription
PREPAREDDocument parsed and prepared
FIRST-PASSInitial LLM extraction complete
LABELEDSecond pass extraction complete
PROCESSEDFinal transformation complete

Examples

# Watch until fully processed (default)
kdx store watch a700ca3e-38e7-4e63-8974-59c2e9058cf3

# Watch for specific label
kdx store watch a700ca3e-38e7-4e63-8974-59c2e9058cf3 --label LABELED

# Custom timeout and poll interval
kdx store watch a700ca3e-38e7-4e63-8974-59c2e9058cf3 --timeout 300 --poll-interval 5

Output

The watch command shows real-time progress:
Watching document family a700ca3e-38e7-4e63-8974-59c2e9058cf3 for label: PROCESSED
Timeout: 600s, Poll interval: 5s

[  0s] RUNNING    | Labels: none | PDF Parser
[ 42s] RUNNING    | Labels: none | AWS Textract
[ 73s] RUNNING    | Labels: none | Kodexa LLM Data Labeling
[389s] RUNNING    | Labels: FIRST-PASS | Kodexa LLM Data Labeling
[472s] RUNNING    | Labels: LABELED | Spreading Transformer
[523s] RUNNING    | Labels: PROCESSED | Note Creator

✓ Document family reached label: PROCESSED

Error Detection

The watch command immediately detects processing failures:
[ 24s] FAILED     | Labels: none | AWS Textract: Unable to build document

✗ Processing failed: AWS Textract: Unable to build document

Store Statistics

View statistics for a document store.
kdx store stats <store-name>

Example

kdx store stats my-document-store

Output

Store: my-document-store
====================
Documents: 150
Storage Size: 2.5 GB
Index Status: READY

Reindex Store

Trigger a reindexing operation for a store.
kdx store reindex <store-name> [flags]

Flags

FlagDescription
--forceForce reindex even if already in progress

Example

# Standard reindex
kdx store reindex my-document-store

# Force reindex
kdx store reindex my-document-store --force

Complete Upload and Monitor Workflow

Here’s a complete example workflow for uploading and monitoring a document:
# 1. Upload document
kdx store upload satori/project-processing:1.0.0 ./financial-report.pdf
# Output: ✓ Document family created: abc123

# 2. Monitor processing
kdx store watch abc123 --timeout 600

# 3. Once processed, get the extracted data
kdx document-family data abc123 -o extracted-data.json

Troubleshooting

File Already Exists

Error: upload failed (400): {"errors":{"*":"document.pdf already exists"}}
Solution: Use a different filename or upload to a different project.

Store Not Found

Error: upload failed (404): Store not found
Solution: Verify the store reference format is correct: org/store-name:version

Processing Timeout

Error: timeout: document family did not reach label 'PROCESSED' within 600 seconds
Solution:
  • Increase timeout with --timeout
  • Check if document is still processing with kdx store watch
  • Large documents may take longer to process