You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'd like a Ruby gem for Loom, so Rails apps adding agent features can use it directly, whether they build on RubyLLM, langchainrb or plain model calls from background jobs.
Scope:
gem "clickhouse-loom", Ruby 3.1+
Methods generated from the op registry (client.memory.set(...), client.memory.search(...)), so new ops show up without being written by hand
Config via Loom.configure or LOOM_BASE_URL / LOOM_API_KEY
Org / namespace / agent bound once, with per-call overrides
The same retry and idempotency behavior as the other SDKs (Idempotency-Key, honor Retry-After), and an error class per server code (Loom::PinnedConflict, Loom::RateLimited, ...)
Minimal dependencies: Faraday or net/http only
We'll also ship a small Rails example: per-user memory written from a Sidekiq job.
Hi @zlareb1, I'd like to work on this. I'd build the clickhouse-loom Ruby gem with methods generated from the op registry, Loom.configure / env config, and org, namespace and agent binding, with specs against a local Loom. Okay if I pick it up?
Thanks @zlareb1, agreed. #1127 (now merged) is the first slice: the op table and error classes generated from the registry, Loom.configure / LOOM_BASE_URL / LOOM_API_KEY, org / namespace / agent bound once with per-call overrides, and retries with Idempotency-Key and Retry-After.
Comparing sdk/ruby with sdk/typescript/src and sdk/python/loom, this is what is still missing for a full match. I'd send it as one small PR per line, each with its own tests that mirror the TS and Python ones:
Pagination: client.paginate / an Enumerator over the rows / results + next_cursor pages, with max_pages, the same as pagination.ts.
Logging: an opt-in logger with the same redaction rules as logging.ts and _logging.py (API key and tokens never logged).
Credentials and tokens: the token and credential handling from token.ts / credentials.py, beyond the static API key.
Sessions and session protection: session.ts / session-protection.ts and the protected stream they use.
Parity check: a codegen unit test that fails when the Ruby op table or error codes drift from the registry the Python and TS SDKs use, so "100% match" stays checked rather than reviewed by eye.
Ruby CI job: run sdk/ruby tests on Ruby 3.1 and 3.3 in ci.yml (today they only run locally).
Rails example: per-user memory written from a Sidekiq job, as the issue describes.
Framework integrations: RubyLLM, then langchainrb, one PR each, after the core above is in.
I'd start with 1 (pagination), since 4 and the examples build on it. If you'd rather a different order, or want any line dropped or split further, say so and I'll follow that.
@zlareb1 the first item of the list is up: #1296 adds cursor pagination to the Ruby SDK (client.paginate { |cursor| ... }, a lazy Enumerator, as paginate in pagination.ts), with 8 tests. Could you take a look when you have time? Next I'll do the opt-in logger with the same redaction rules as logging.ts.
@zlareb1 yes, I'm still on it. Pagination (#1296) is merged, and I'm starting item 2 now: the opt-in logger, with the same redaction rules as logging.ts and _logging.py. I'll post the PR here when it's up, then continue down the list in order (credentials and tokens, then sessions).
@zlareb1 item 2 is up: #1624 adds opt-in logging to the Ruby SDK, with the same lines, levels and API-key redaction as logging.ts and _logging.py. Could you take a look when you have time? Next is item 3, credentials and tokens.
@zlareb1 the first half of item 3 is up: #1697 adds a token_provider (asked on every request, and resent once on a 401) and the ~/.loom/token fallback to the Ruby SDK. The stored loom login session, refreshed under the lock the Python and TS SDKs share, comes next as its own PR on top of it.
@zlareb1 I compared sdk/ruby with the TypeScript SDK's exports on main. The Ruby gem has the generated ops and error classes, the client-bound identity, retries with Idempotency-Key and Retry-After, pagination, logging, a token provider and ~/.loom/token. Still missing for parity, roughly in the order I'd do them:
Machine login for bots and CI (loom bot create, LOOM_CLIENT_ID) as a token provider, like MachineLogin.
Token claims: decode the JWT payload and role_on / role_satisfies for scoped tokens.
The account's own tokens (list, create, revoke), as account.ts does.
Transport
The X-Loom-Runtime header (ruby/3.3.6 x86_64-linux).
A capabilities probe over ops.capabilities, so an app can check the ops and fields it needs before calling.
Higher-level helpers
Agent / Datapack, the identity-bound entry points.
Session: resume, append turns, offload a large tool result and fetch it back.
Knowledge files: knowledge.upload with the raw bytes, then knowledge.ingest and a wait for the revision.
Assistant streaming over POST /v1/assistant/chat/completions.
Loom as model tools (remember, recall, ask, offload, fetch) in the shapes RubyLLM and langchainrb expect, plus the code pointer block for task prompts.
From the issue scope
The Rails example: per-user memory written from a Sidekiq job.
The TS SDK's framework integrations (LangChain, Mastra, ADK and so on) have no direct Ruby counterparts, so I'd cover RubyLLM and langchainrb through item 11 and not port those. Shall I go in this order, one PR each?
@zlareb1 a correction to my list above: I won't be able to pick up the remaining Ruby SDK items for now, so please treat them as open. The list should still work as a checklist for whoever takes them.
Activity
rahulsjha commentedon Nov 21, 2026
Hi @zlareb1, I'd like to work on this. I'd build the
clickhouse-loomRuby gem with methods generated from the op registry,Loom.configure/ env config, and org, namespace and agent binding, with specs against a local Loom. Okay if I pick it up?zlareb1 commentedon Nov 22, 2026
@rahulsjha since this is a big task and requires 100% match with Python and TS SDKs lets break it down into multiple small PRs
rahulsjha commentedon Nov 22, 2026
Thanks @zlareb1, agreed. #1127 (now merged) is the first slice: the op table and error classes generated from the registry,
Loom.configure/LOOM_BASE_URL/LOOM_API_KEY, org / namespace / agent bound once with per-call overrides, and retries withIdempotency-KeyandRetry-After.Comparing
sdk/rubywithsdk/typescript/srcandsdk/python/loom, this is what is still missing for a full match. I'd send it as one small PR per line, each with its own tests that mirror the TS and Python ones:client.paginate/ anEnumeratorover therows/results+next_cursorpages, withmax_pages, the same aspagination.ts.logging.tsand_logging.py(API key and tokens never logged).token.ts/credentials.py, beyond the static API key.session.ts/session-protection.tsand the protected stream they use.sdk/rubytests on Ruby 3.1 and 3.3 inci.yml(today they only run locally).I'd start with 1 (pagination), since 4 and the examples build on it. If you'd rather a different order, or want any line dropped or split further, say so and I'll follow that.
rahulsjha commentedon Nov 24, 2026
@zlareb1 the first item of the list is up: #1296 adds cursor pagination to the Ruby SDK (
client.paginate { |cursor| ... }, a lazy Enumerator, aspaginateinpagination.ts), with 8 tests. Could you take a look when you have time? Next I'll do the opt-in logger with the same redaction rules aslogging.ts.Ruby SDK: cursor pagination over the rows and results page shapes (#1296
Keep code-index contracts in sync with the registry (#1293)
zlareb1 commentedon Nov 27, 2026
@rahulsjha are you working on remaining items here?
rahulsjha commentedon Nov 27, 2026
@zlareb1 yes, I'm still on it. Pagination (#1296) is merged, and I'm starting item 2 now: the opt-in logger, with the same redaction rules as
logging.tsand_logging.py. I'll post the PR here when it's up, then continue down the list in order (credentials and tokens, then sessions).rahulsjha commentedon Nov 27, 2026
@zlareb1 item 2 is up: #1624 adds opt-in logging to the Ruby SDK, with the same lines, levels and API-key redaction as
logging.tsand_logging.py. Could you take a look when you have time? Next is item 3, credentials and tokens.Ruby SDK: opt-in logging with the same lines and redaction as the TS …
rahulsjha commentedon Nov 28, 2026
@zlareb1 the first half of item 3 is up: #1697 adds a
token_provider(asked on every request, and resent once on a 401) and the~/.loom/tokenfallback to the Ruby SDK. The storedloom loginsession, refreshed under the lock the Python and TS SDKs share, comes next as its own PR on top of it.zlareb1 commentedon Dec 3, 2026
@rahulsjha what else is pending in SDK to bring it to 100% parity with other SDKs?
rahulsjha commentedon Dec 3, 2026
@zlareb1 I compared
sdk/rubywith the TypeScript SDK's exports on main. The Ruby gem has the generated ops and error classes, the client-bound identity, retries withIdempotency-KeyandRetry-After, pagination, logging, a token provider and~/.loom/token. Still missing for parity, roughly in the order I'd do them:Credentials
loom loginsession:login,logout,whoami, and the refresh under the lock the Python and TS SDKs share (next PR, on top of Ruby SDK: a token provider resent once on a 401, and ~/.loom/token #1697).loom bot create,LOOM_CLIENT_ID) as a token provider, likeMachineLogin.role_on/role_satisfiesfor scoped tokens.account.tsdoes.Transport
X-Loom-Runtimeheader (ruby/3.3.6 x86_64-linux).ops.capabilities, so an app can check the ops and fields it needs before calling.Higher-level helpers
Agent/Datapack, the identity-bound entry points.Session: resume, append turns, offload a large tool result and fetch it back.knowledge.uploadwith the raw bytes, thenknowledge.ingestand a wait for the revision.POST /v1/assistant/chat/completions.From the issue scope
The TS SDK's framework integrations (LangChain, Mastra, ADK and so on) have no direct Ruby counterparts, so I'd cover RubyLLM and langchainrb through item 11 and not port those. Shall I go in this order, one PR each?
rahulsjha commentedon Dec 3, 2026
@zlareb1 a correction to my list above: I won't be able to pick up the remaining Ruby SDK items for now, so please treat them as open. The list should still work as a checklist for whoever takes them.