> For the complete documentation index, see [llms.txt](https://platformdocs.lattica.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platformdocs.lattica.ai/architecture-overview/query-client.md).

# Query Client

{% hint style="info" %}
**Access Requirements**

To interact with a workload, an end-user will need a unique access key—called a Token—provided by the workload service provider using LatticaAI. This token is crucial for establishing secure connections with the computations and maintaining private communication through the Query Client.

> **Try Our** [**Demo**](https://www.lattica.ai/workloads)**!**
>
> LatticaAI offers demo models using a predefined token. No special permissions needed—just explore the Query Client’s features and experience secure, encrypted interactions firsthand.
> {% endhint %}

***

## Interaction Options

**LatticaAI** offers a **TypeScript SDK** for queries within web environments and a **Python SDK** for integrating secure query capabilities in native applications. We also maintain a [**GitHub repository**](https://github.com/Lattica-ai/lattica_fhe_core), containing the core Fully Homomorphic Encryption (FHE) logic, which covers key generation, encryption, and decryption.

***

## Query Client: Key Functions and Flow

{% hint style="info" %}
**Note on Query Semantics**\
The term *query* is used generically to describe an encrypted request sent for secure execution. Depending on the workload, a query may represent an inference request or a vectorized search operation.
{% endhint %}

The Query Client process consists of three stages:

{% stepper %}
{% step %}

### Environment Preparation&#x20;

[Set up an environment](/how-to-guides/client-installation/how-to-install-query-client.md) to support the Query Client.&#x20;
{% endstep %}

{% step %}

### One-Time Action: Cryptographic Key Generation

* Once the environment is ready, generate a pair of cryptographic keys—an **evaluation key** and a **secret key**.&#x20;
  * The secret key protects all future interactions with the computation, securing your data every step of the way.
  * The evaluation key is public and accelerates the computation of these interactions to reduce latency.
* This key generation is a one-time process and doesn't need to be repeated for each query.
  {% endstep %}

{% step %}

### Ongoing Process: Query Execution

With the environment ready and keys generated, you can start executing queries. The Query Client enables you to run multiple queries securely, using the same pair of generated keys to protect all data exchanges throughout your session.
{% endstep %}
{% endstepper %}

***

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://platformdocs.lattica.ai/architecture-overview/query-client.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
