Skip to content

feat: A minimal Rust client for the memory ops: set, get, search and delete - #842

Merged
zlareb1 merged 12 commits into
ClickHouse:mainfrom
yorkhellen:feat/rust-async-sdk
Nov 18, 2026
Merged

zlareb1 merged 12 commits into
ClickHouse:mainfrom
yorkhellen:feat/rust-async-sdk

Conversation

@yorkhellen

Copy link
Copy Markdown
Contributor

Closes: #619

Changelog category

  • New Feature

Changelog entry

Adds Rust SDK for saving, reading, searching and deleting memories. The client provides typed responses, explicit or environment configuration, classified API errors and retries with write idempotency keys.

Why

Rust applications currently need to construct HTTP requests and decode Loom responses themselves. A client for four memory operations gives callers a typed API and a tested foundation for broader SDK coverage.

Scope and risk

Adds the clickhouse-loom crate under sdk/rust/, usage documentation, a runnable memory example and tests against a local fake HTTP server. The repository README links to the Rust SDK guide.

CI checks the SDK on Rust 1.84.1 and stable, including formatting, tests, Clippy, documentation, crate packaging and license verification.

The client binds org, namespace and agent once. Search reads across agents by default and accepts explicit filters, matching the Python high-level SDK. Write retries reuse one idempotency key per call; clones share connections and rate-limit state.

The main risks are request serialization, error decoding and retries after an ambiguous transport failure. Tests cover these paths, cancellation and concurrent calls. Server operations, storage, authorization, plugins and the dashboard are unchanged.

Compatibility, rollout and rollback

  • Wire: calls the existing memory.set, memory.get, memory.search and memory.delete operations. No server fields or defaults change. Public Rust types are non-exhaustive, and response decoding accepts unknown fields.
  • Operator steps: none. The SDK requires Rust 1.84 or later and a Tokio runtime. Installation from a checkout is documented.
  • Rollback: reverting removes the SDK, documentation links and its CI job. There are no migrations or backfills. Memories written through the existing operations remain stored.
  • Installation and distribution: installation currently uses a Cargo path dependency from a local checkout. Publishing clickhouse-loom to crates.io is a follow-up release step after merge. Once published, the installation guide will include cargo add clickhouse-loom.

Tests

  • Rust 1.84.1 and 1.95.0: cargo test --locked passed all 53 unit, HTTP contract, response-model and documentation tests.
  • cargo fmt --check and cargo clippy --locked --all-targets -- -D warnings passed.
  • RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps passed.
  • cargo package --locked and packaged-license verification passed.
  • Repository formatting, lint, generated-file and type checks passed.
  • Documentation links, public-copy checks and the Rust search-field contract: 256 tests passed.
  • Benchmark harness unit tests: 251 tests passed without provider calls.
  • Manual smoke: the memory example completed save, read, lexical search, delete and confirmation of absence against a local Loom instance.

The server integration suite was not run for this client-only change; server behaviour is unchanged.

AI assistance in the code

  • AI-generated using GPT 6.1 Sol. The author designed the solution and established the code structure. AI generated the implementation within that structure, and the author reviews the generated code.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed. Full unit-suite validation remains pending.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py). N/A: no generated artifacts changed; generator checks passed.
  • A new migration is additive and numbered after the latest on main; no merged migration is edited. N/A: no migrations changed.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version. N/A: no plugin files changed.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed. N/A: no frontend files changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

Typed responses preserve search provenance and retrieval decisions so Rust applications can use Loom memory with the same search and retry defaults as the Python SDK.

Signed-off-by: zhangxiaoyu.york <[email protected]>
List every request field so a missing-field error cannot mask removal of the struct's construction protection.

Signed-off-by: zhangxiaoyu.york <[email protected]>
The memory example and its guide cover scoped save, read, search and delete calls.

Signed-off-by: zhangxiaoyu.york <[email protected]>
Search responses include writer and governed-definition metadata.

Signed-off-by: zhangxiaoyu.york <[email protected]>
Package metadata, guides and API comments describe the product and supported memory operations consistently.

Signed-off-by: zhangxiaoyu.york <[email protected]>
Describe Loom consistently while using Rust-specific wording for the client and its configuration.

Signed-off-by: zhangxiaoyu.york <[email protected]>
Delegate UUID generation and error formatting to maintained crates while preserving request identity and error chains.

Signed-off-by: zhangxiaoyu.york <[email protected]>
Make the Rust client guide discoverable alongside the other SDK and HTTP documentation.

Signed-off-by: zhangxiaoyu.york <[email protected]>
@yorkhellen yorkhellen changed the title Feat/rust async sdk feat: A minimal Rust client for the memory ops: set, get, search and delete Nov 18, 2026
yorkhellen and others added 3 commits November 18, 2026 20:00
Merge main to restore request context isolation and keep the Rust job behind the shared validation gate.

Signed-off-by: zhangxiaoyu.york <[email protected]>
Bring in per-sample lane cost diagnostics so CI failures retain completion and error evidence.

Signed-off-by: zhangxiaoyu.york <[email protected]>
@zlareb1 zlareb1 self-assigned this Nov 18, 2026

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings in the four memory operations, response models, identity binding, retry/idempotency behavior, credential redaction or CI job. All 53 Rust tests, formatting, Clippy, documentation and package/license checks pass locally on Rust 1.93.1. CI must validate Rust 1.84.1 before merge.

@zlareb1 zlareb1 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged.

@zlareb1
zlareb1 merged commit 74121fa into ClickHouse:main Nov 18, 2026
47 checks passed
@zlareb1 zlareb1 mentioned this pull request Nov 18, 2026
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A minimal Rust client for the memory ops: set, get, search and delete

2 participants