XTraceIntegration is the single entry point for all communication with the XTrace API. It handles chunk storage, encrypted Hamming distance computation, metadata search, and execution context management.
Security model
Understanding what XTrace can and cannot see is the core guarantee of this SDK. What XTrace cannot see
What XTrace can see
Execution context
TheExecutionContext bundles the Paillier key pair and the AES key under a single protected object. A key provider controls how the AES key is generated and protected.
The SDK ships two providers:
PassphraseKeyProvider— derives a 256-bit AES key from a passphrase via scrypt. Simple and self-contained — no cloud dependencies.AWSKMSKeyProvider— generates a data encryption key (DEK) via AWS KMS envelope encryption. The DEK is never stored in plaintext — only the KMS-wrapped ciphertext (EDEK) is persisted.
execution_context.save_to_remote(xtrace)), only the following is transmitted:
- The public key in plaintext (intentional — it is not secret).
- The secret key encrypted with the AES key supplied by the key provider.
- Non-sensitive configuration (key length, embedding length).
Passphrase-based context
AWS KMS-based context
Connecting
Loading data
UseDataLoader with an XTraceIntegration to encrypt and store documents:
Querying
UseRetriever to run encrypted nearest-neighbor search:
Metadata search
See Metadata filtering for the full filter syntax, operator reference, and performance guidance. Search and filter chunks by metadata without running a vector query:Chunk operations
Execution context management
Use theExecutionContext helpers rather than calling the low-level API directly:
Notes
kb_idandorg_idare available from the XTrace dashboard.- Metadata fields use the fixed schema:
tag1–tag5andfacets. See Metadata filtering for field semantics and operator reference. - The
concurrent=Trueflag onstore_dbenables parallel batch ingestion — useful for large loads.