Skip to content

HTTP clients

HolographicClient and AsyncHolographicClient talk to hms-server, which stores vectors you supply and answers queries by exact cosine.

client

HolographicError

Bases: HTTPStatusError

The service rejected a request with its documented {"error": {"code", "message"}} body.

status_code, code and message come from that response. It is still an httpx.HTTPStatusError, so code that catches that, such as the importer's retries, keeps working.

message instance-attribute

message = message

code instance-attribute

code = code

status_code instance-attribute

status_code = response.status_code

__init__

__init__(message: str, code: str, response: Response) -> None

VectorMask

Keyed signed permutation of embedding coordinates.

Applied client-side so the server can rank vectors without the original coordinates. Inner products, norms and cosine similarity are preserved exactly, which also means the server learns every pairwise similarity. This is obfuscation, not encryption: known plain/masked pairs reveal the key material for the coordinates they cover.

__init__

__init__(passphrase: str, salt: bytes = _DEFAULT_MASK_SALT)

apply

apply(embedding: List[float]) -> List[float]

HolographicClient

Core sync HTTP client for communicating with a Holographic Memory backend.

url instance-attribute

url = url.rstrip('/')

client instance-attribute

client = httpx.Client(headers=headers, timeout=timeout, transport=transport)

memory property

memory: MemoryClient

Agent memory (remember, recall, forget, explain) over this client's connection.

__init__

__init__(url: str = 'http://localhost:8080', zero_trust_key: str = '', api_key: Optional[str] = None, tenant_id: Optional[str] = None, timeout: int = 30, mask_salt: Optional[bytes] = None, transport: Optional[BaseTransport] = None)

close

close() -> None

__enter__

__enter__() -> HolographicClient

__exit__

__exit__(*exc: Any) -> None

encrypt_vector

encrypt_vector(embedding: List[float]) -> List[float]

Mask an embedding when a zero_trust_key is configured. Not encryption; see VectorMask.

add_documents

add_documents(documents: List[Dict[str, Any]]) -> None

Batch upload documents to the holographic store.

delete_document

delete_document(doc_id: str) -> None

maintain_document_index

maintain_document_index() -> Dict[str, Any]

query

query(query_vector: List[float], top_k: int = 3, filter: Optional[Dict[str, Any]] = None) -> Dict[str, Any]

AsyncHolographicClient

Core async HTTP client for communicating with a Holographic Memory backend.

url instance-attribute

url = url.rstrip('/')

client instance-attribute

client = httpx.AsyncClient(headers=headers, timeout=timeout, transport=transport)

memory property

Agent memory (remember, recall, forget, explain) over this client's connection.

__init__

__init__(url: str = 'http://localhost:8080', zero_trust_key: str = '', api_key: Optional[str] = None, tenant_id: Optional[str] = None, timeout: int = 30, mask_salt: Optional[bytes] = None, transport: Optional[AsyncBaseTransport] = None)

aclose async

aclose() -> None

__aenter__ async

__aenter__() -> AsyncHolographicClient

__aexit__ async

__aexit__(*exc: Any) -> None

encrypt_vector

encrypt_vector(embedding: List[float]) -> List[float]

Mask an embedding when a zero_trust_key is configured. Not encryption; see VectorMask.

add_documents async

add_documents(documents: List[Dict[str, Any]]) -> None

delete_document async

delete_document(doc_id: str) -> None

maintain_document_index async

maintain_document_index() -> Dict[str, Any]

query async

query(query_vector: List[float], top_k: int = 3, filter: Optional[Dict[str, Any]] = None) -> Dict[str, Any]