Skip to content

Ruby SDK #55

Open
Open

Description

@zlareb1

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.

Activity

  1. rahulsjha commented on Nov 21, 2026

    @rahulsjha
    Contributor

    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?

  2. zlareb1 commented on Nov 22, 2026

    @zlareb1
    MemberAuthor

    @rahulsjha since this is a big task and requires 100% match with Python and TS SDKs lets break it down into multiple small PRs

  3. rahulsjha commented on Nov 22, 2026

    @rahulsjha
    Contributor

    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:

    1. Pagination: client.paginate / an Enumerator over the rows / results + next_cursor pages, with max_pages, the same as pagination.ts.
    2. Logging: an opt-in logger with the same redaction rules as logging.ts and _logging.py (API key and tokens never logged).
    3. Credentials and tokens: the token and credential handling from token.ts / credentials.py, beyond the static API key.
    4. Sessions and session protection: session.ts / session-protection.ts and the protected stream they use.
    5. 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.
    6. Ruby CI job: run sdk/ruby tests on Ruby 3.1 and 3.3 in ci.yml (today they only run locally).
    7. Rails example: per-user memory written from a Sidekiq job, as the issue describes.
    8. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions