Skip to main content
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

The ExecutionContext 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.
When stored remotely on XTrace (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).
Neither your passphrase nor your KMS plaintext DEK are ever transmitted. Without the corresponding key provider, the stored blob cannot be decrypted — XTrace cannot recover the secret key and cannot decrypt your chunk content or vectors. See Configuration for the full key provider reference.

Passphrase-based context

AWS KMS-based context

Connecting

Use it as an async context manager to manage the HTTP session automatically:

Loading data

Use DataLoader with an XTraceIntegration to encrypt and store documents:

Querying

Use Retriever to run encrypted nearest-neighbor 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 the ExecutionContext helpers rather than calling the low-level API directly:

Notes

  • kb_id and org_id are available from the XTrace dashboard.
  • Metadata fields use the fixed schema: tag1tag5 and facets. See Metadata filtering for field semantics and operator reference.
  • The concurrent=True flag on store_db enables parallel batch ingestion — useful for large loads.