Skip to content

librarian v0.22.2

Choose a tag to compare

@github-actions github-actions released this 17 Nov 14:25
· 11 commits to main since this release

capabilities is the first thing an agent asks, and all of its answer goes into the agent's context. With a few large APIs that answer had grown to tens of thousands of tokens: agent clients warn about a tool result of that size, put it aside in a file, or refuse it. This release keeps it to a size an agent can take, however many APIs there are.

For every agent

  • The answer of capabilities has a size it stays under: capabilities_max_bytes, 16,000 bytes of JSON (over MCP up to about 28,000 characters of text, some 9,000 tokens for a Claude model). When it would be larger, the lists of operations are cut to the same length for every API, and a note in the answer says what was left out and how to see it. Every API is still there with how many operations it has.
  • capabilities takes api: that API alone, and with a query its operations that fit. This is what the note points to.
  • With a query, the API that fits it best keeps its matches; the lists of the others are cut. An agent that names the API it wants gets that one as before.
  • Past a few dozen APIs not all of them fit even without their operations: the first ones are listed and more_apis has the ids of the others.
  • An API named another way is answered with the one that exists: unknown API 'GitHub'. Did you mean 'github'?, in capabilities, execute, write and write_plan, and only among the APIs that agent may use (or, for a write, may write to).
  • The skill (skills/librarian) says what api, note and more_apis are for. A kagent Agent takes it from this release's image by digest: oci: ghcr.io/kultar/librarian@sha256:9a71c96003f280c495b9cfd15cefb459b947fedc148df67b7e5d33ecdb3c91c3, path: skills/librarian. An Agent that keeps an older digest keeps working: the answers themselves say what to do.

Measured on five large APIs (GitHub, Stripe, Jira, PagerDuty and DigitalOcean: 3,911 operations) for an agent that may ask for writes and gives no query: the answer was 120,000 characters of text over MCP (39,000 tokens) and is 26,000 (8,500), with ten reads and ten writes for each API. Claude models given only the tools followed the note to the operation they were asked for.

Upgrade

  • This changes a default. An answer of capabilities above 16,000 bytes of JSON used to be sent whole and now has its lists cut. capabilities_max_bytes: 0 gives the old behaviour (over MCP, the lists are still cut to what mcp_max_result_bytes holds). An answer under the limit is what it was.
  • No configuration changes are needed.
  • Finish the rollout before agents use api: a replica still on 0.22.1 does not know the argument.
  • A gateway in front that lists tool arguments has one more to pass on: capabilities takes api.