Skip to main content
Guide
Embedded clients execute operation-tree requests without HTTP. The process opens a writer or read-only handle against memory, disk, or S3-compatible object storage.

Install

Install the SDK and its embedded runtime.
  • Rust compiles the engine from source; use a current stable toolchain. v3.7.0 is the CLI release that defaults to image v0.0.16. Its SDK is newer than the crates.io 3.0.0 release the Rust SDK guide describes.
  • Go v0.3.1 publishes no native bindings: NewEmbeddedClient and NewEmbeddedReaderClient return ErrNativeBindingsUnavailable. Use the Go HTTP client with a local server.

Open a writer

Choose a storage source

Object storage reads credentials from the standard AWS_* variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN), and its endpoint from AWS_ENDPOINT when the source sets none. Unlike the server, it has no disk cache by default, so once a vector index outgrows memory, each graph hop that misses the cache waits on an object-store request. Give object storage with a vector index a hybrid cache.

Configure caches

Cache configuration is optional and fixed when the handle opens. Local defaults are bounded and demand-filled so a small embedded database does not reserve server-sized caches: The local profiles also use a 16 MiB L0 target and a 64 MiB unflushed-data ceiling. The flush interval is the batching delay before storage I/O; filesystem and device latency still apply. Pass an explicit cache configuration to change the vector-memory budget or enable bounded disk caches:
  • Python: pass cache=EmbeddedCacheConfig(vector_memory_bytes=..., mode=MemoryCache()) to Client.embedded or Client.embedded_reader. The other modes are HybridCache(...) and VectorMemoryOnly().
  • Rust: pass a full DbConfig to Client::open_with_config or Client::open_reader_with_config. Start from HelixDbSource::embedded_default_config() and replace its cache.
Cache byte budgets bound those caches. They are not a hard cap on total process RSS; requests and index work can allocate transient memory.

Open a read-only database

Use a read-only handle for processes that must never mutate the database. It opens an existing disk or object-storage database, executes read requests, and rejects writes.

Embedded request rules

  • Use the same QueryRequest and response contract as server mode.
  • Writer handles can execute read and write requests.
  • Per-request server options (writer-only, warm-only, durability waits) fail with InvalidRequest. API-key and database-ID settings are ignored.
  • Reopen the same disk or object-storage source to retain canonical data across process lifetimes.

Writers and readers

  • Open one writer per database at a time, across all processes. A second writer on the same source fences the first. From then on every request on the first client, read or write, fails with the error code writer_fenced_commit_outcome_unknown (see Error handling), and a write it was committing may or may not have landed. The fenced client notices within about a second, even when idle, and stops its background work. Close it, and do not reopen it as a writer while the newer writer runs: that would fence the newer writer in turn.
  • Read-only handles can open the same database alongside the writer, in any process. A reader sees a write only once it is durable and the reader has refreshed, so it can lag behind the writer.

Telemetry

Embedded databases send the same basic telemetry as the local server, at the level helix metrics saves for the user. Set HELIX_TELEMETRY_LEVEL=off in the process environment to turn it off. DO_NOT_TRACK also works in Rust builds from v3.7.0, but not in the published TypeScript and Python embedded packages (0.3.3).

Next steps

Local server

Run the production-shaped HTTP interface on your machine.

Deployment options

Compare local server, embedded, and Cloud execution.