Skip to content
GitHub

Agents

Library docs for agents

Holtkeeper can index the third-party libraries your repositories depend on and serve their version-exact documentation, release notes, public API, source and GitHub issues to agents over MCP and to people in the web UI. Agents then answer “how do I use this”, “what changes if we upgrade” and “has anyone hit this error” from the versions you actually use instead of searching the web.

This page is the how-to. The design and its trade-offs are in library-docs.md; the server side in apps/server/docs; the indexer in @holtkeeper/libraries.

For every npm package and Go module your repositories use, Holtkeeper keeps a small set of versions:

  • every version some repository resolves to;
  • the newest patch of each used minor and the newest minor of each used major (what a safe upgrade lands on);
  • the newest stable release, the newest release of every major between yours and it, and the first release of those majors (where migration guides live).

That is usually three to eight versions per library, at most maxVersions (8). For each version it reads:

Source What Needs
archive README, CHANGELOG, migration guides and other Markdown shipped in the package registry access
api Exported names with declarations and doc comments (.d.ts for npm, Go source for Go) registry access
repository docs/, llms.txt, examples, changelogs from the GitHub repository at the version’s tag GitHub
releases GitHub release notes GitHub
issues Closed bug issues with their fix, answered discussions GitHub (token)
source A snapshot of the source at the tag, made the first time an agent asks for it GitHub
site The docs site (llms.txt, sitemap), off by default access to that site

Libraries your own repositories publish are left out: their API already comes from the api-surface analysis. So are packages the public registry does not know, such as the ones your GitLab package registry hosts: there is nothing to index for them, and a library that disappears from the registry leaves the index on the next run.

  • A store and an artifact store. Every store (SQLite, Postgres) supports the index; the artifact store is .holtkeeper/artifacts by default or S3 (server.artifacts). Nothing else to deploy.

  • Outbound HTTPS from the server process (the scheduler leader runs the index, not the job workers): registry.npmjs.org, proxy.golang.org, api.github.com, codeload.github.com, and, for Go modules on vanity paths such as golang.org/x/…, those hosts. Bun honours HTTPS_PROXY/HTTP_PROXY, so a forward proxy works. Private Go modules (see goPrivate below) are never asked on proxy.golang.org or their own host.

  • Dependency records. The index starts from what repositories use:

    • depgraph records (npm and Go, the resolved version of every direct dependency);
    • usages records (exact versions of the npm packages and Go modules the code imports).

    Freshness keeps both current. On a fresh install, run them once instead of waiting: Ops › Runs → Run analyzer → depgraph (and usages) for your repositories. Go modules come from both, so a repository whose depgraph cannot resolve its private modules still contributes the public modules its code imports.

Without a token GitHub allows 60 requests an hour, which runs out on the first few libraries, and issues lose answers and discussions (they need GraphQL). With a token the limit is 5000 an hour.

  1. On GitHub create a token that can read public repositories and nothing else: a fine-grained token with Public repositories (read-only) access, or a classic token with no scopes.
  2. In Holtkeeper open Settings › Integrations → Credentials → Add, kind github, give it a name such as github-libraries, paste the token as the secret and save.

The token is only used to read public repositories. It never reaches agents or jobs.

More than one token. You can add several github credentials (all are used unless the setting lists some); every request goes to the token with the most of its limit left, and when one runs out the next takes over. GitHub counts the limit per account, not per token: two tokens of the same person (even made for two organizations) share one 5000 an hour, so Holtkeeper checks whose each token is on the first request and drops duplicates with a log line github: two tokens belong to …. Capacity only grows with tokens of different accounts, such as a bot account per organization that owns it.

What a run costs. Requests are conditional: Holtkeeper keeps each answer’s ETag and asks again with If-None-Match, and GitHub does not count the 304 Not Modified it answers when nothing changed, so later runs spend requests only on what is new. When every token is used up, the run pauses until GitHub resets the limit (at most an hour), then continues where it stopped; it does not fail its sources. The first run of a few hundred libraries takes roughly 30–40 requests per library.

Watching the tokens. Settings › Integrations (credentials list, global settings:read for the usage) shows, in the card of every github credential, its GitHub account, requests, how many were answered 304 from the cache and how many hit a limit, and the live core limit; Usage details opens the other limits (search, graphql for issues) and the counts per resource. A token of an account that is already in the pool is marked as a duplicate. The pool as a whole is under Settings › System (Library index, global settings:read): GitHub API usage sums how much of each limit is used across the distinct accounts and when it resets, waits for a reset, and requests per day by token over 7, 30 or 90 days. The Credentials cards keep only each token’s own line.

The index is on by default and uses every credential of kind github it finds: once the credential from step 1 is saved, a new run starts with it (a running one is restarted with the new token). Without any token it reads GitHub anonymously and does not wait for GitHub’s limit to reset; sources that hit it are retried on the next run.

The Library docs setting (Settings › System) is only needed to change the defaults. Only its entry for All repositories counts. For example, to use just some of the tokens and skip packages you do not need:

{
"github": ["github-libraries"],
"exclude": ["@types/*", "eslint-*"]
}

Everything else has defaults:

Field Default Meaning
enabled true false stops indexing; what is indexed stays readable
interval 1d How often to look for new releases and uses, <n>m, <n>h or <n>d, at least 1h
github every github credential Ids or names of the GitHub token credentials to use; [] reads GitHub anonymously
digests false Summarize issue threads agents hit with the configured LLM (see Issue digests)
exclude ["@types/*"] Globs of library names never indexed; Go: limits a glob to Go, e.g. Go:github.com/acme/**
include [] Globs indexed even when no repository uses them
goPrivate [] Go module path patterns in GOPRIVATE syntax, e.g. github.com/acme-private/*, that are private besides the forges’ hosts
maxVersions 8 Versions kept per library (1–50); the ones in use are always kept
firstOfMajor true Also index the x.0.0 release of each crossed major
sources repository, releases, issues on; site off Turn single sources off, or docs sites on
graceDays 28 Days a version (or library) stays after nothing needs it any more
concurrency 3 Libraries indexed at the same time (1–8); a run mostly waits for the network, so a few at once make it faster while the GitHub limit lasts

Private Go modules. Modules under the host of a forge (panel or config file) are private; on github.com, gitlab.com and bitbucket.org only the top-level namespaces the forge’s fleet includes and the top-level namespaces of the repositories Holtkeeper analyzes there. The goPrivate patterns are private too. They count as your own packages: the index never asks proxy.golang.org or their host about them, so their paths stay inside your network. Their API is in the catalog. Jobs get the same patterns as GOPRIVATE (in mise and container mode), so go in jobs does not ask proxy.golang.org or sum.golang.org about them either, and propagate asks for an exact version instead of looking up latest. On a public host with no specific group and no analyzed repository, list your private modules in goPrivate.

The first run starts about two minutes after the server starts; the server rereads the setting every 30 seconds, so changes need no restart. Later runs come every interval, about ten minutes after new depgraph or usages records arrive, and on Settings › System → Reindex now (needs global analyses:run).

Keeping up with the repositories. Nobody maintains the list of libraries: every run takes it from the newest depgraph and usages records, so packages added to a repository join the index, upgraded ones get their new versions, and dropped ones leave after graceDays. Freshness keeps those records current: usages reruns at most every 6 hours once the default branch moved past the commit its record describes (after the head stayed put for 30 minutes), and depgraph the same way. The index runs about ten minutes after new records arrive. Pushes reach freshness through the forge webhook at once; without one, freshness reads each default-branch head every 30 minutes.

The first run downloads every library once and takes a while: minutes for a few dozen libraries, longer for hundreds; later runs only fetch what is new. Follow it in Settings › System (global settings:read): Indexing now shows how many libraries the running run has done of all, the ones it works on (concurrency at a time), the time so far with a rough estimate of the rest and, when every GitHub token is used up, until when it waits; Coverage shows per source (package archive, API, repository docs, release notes, issues) how many versions are indexed, have nothing to index, failed (fetched again on the next run) or are not fetched yet; Last indexing run shows the counts and failures of the run before. Or read the server log:

Terminal window
kubectl -n holtkeeper logs deploy/holtkeeper-web | grep libraries:

Supply › Libraries shows every library the repositories you can read use, your team’s first, with the latest version the index found, how far behind each repository is, advisories and Renovate merge requests; a library opens in a side sheet (Overview, Upgrade, Docs) that answers from the index: what changed between your version and the latest, which uses an upgrade breaks, a Copy as prompt button that hands the plan to a coding agent, and a search over its docs. Settings › System (global settings:read) lists everything indexed with versions, document sections, issues and sources whose last fetch failed, and the GitHub API usage.

  1. Open Account › Connect agents and create a token. It acts as you, read-only, and sees only libraries your repositories use.

  2. Add the server to your agent, e.g. Claude Code:

    Terminal window
    claude mcp add --transport http holtkeeper https://holtkeeper.example.com/mcp --header "Authorization: Bearer hk_mcp_…"
  3. Ask in terms of your code; the agent picks the tools:

Tool Use it for
package_docs Finding the section about an option, an API or an error, in one library or across all; reading one document or section; with issues, known bugs and their fixes for an error message, indexed first, then a live GitHub search
package_changes Which versions are indexed and which repositories use which; between two versions the API diff, changelog, release notes and migration guide sections, and which of your call sites the upgrade breaks
package_api The public API of a version, one export or the exports matching a name
package_source Browsing and reading the library’s source at the exact version; organization packages from their own repository

The same tools answer for your organization’s own packages, so an agent does not need to know which kind a package is.

Every one of them takes an optional repo (forge:path, e.g. work:games/app). With it, the version defaults to the one that repository uses, so “how does useQuery handle retries” is answered for your version, not the newest. Without it, the newest indexed version is used. ecosystem is Go for a module path such as github.com/acme/lib and npm otherwise; a Go module path with its /v2 suffix or a package path inside the module finds the module. Go modules get their package docs (doc.go and package comments) besides the README, release notes and changelog from GitHub for github.com modules (and vanity paths that point there), and package_source reads the exact module zip.

Examples of prompts that use them well:

  • “We are on react-router 6 in work:shop/web. What do we have to change to move to 7?” → package_changes with from and to.
  • “TypeError: Cannot read properties of undefined (reading 'getState') after upgrading zustand, is this a known bug?” → package_docs with issues.
  • “How is retry backoff implemented in github.com/cenkalti/backoff v4?” → package_source.

Text coming from libraries, repositories and issues is marked in the answers as third-party content, so agents treat it as data, not instructions.

Review, port, propagate and other agent tasks get the same packages tools, with the task’s repository as the default for versions. Nothing to configure.

The library index covers third-party packages only. Asked about one of your organization’s own packages (or a deep import path into one), package_docs answers that it is an internal package without indexed docs and points to package_api and package_source instead of saying it is not indexed. Reviews also run on a checkout without node_modules, so their prompt sends dependency questions to these tools.

With "digests": true, the first time an issue thread comes up in a search it is summarized by the configured LLM into problem, symptoms, affected versions, fixed-in version and workaround, and the summary is stored, so later searches show it directly. At most three threads are summarized per search. Runs are charged to llm.budget under task kind library-digest and show up under Ops › AI spend. Over MCP they only happen when the call passes a repo you can read, since the repository decides which provider credential and budget apply.

Digests run on the fast model tier, the newest Haiku your provider lists: a summary is a short structured extraction, so a small model does it well. There is no model setting.

  • Too many libraries. Exclude noise such as @types/* (default), test-only tooling or internal mirrors: "exclude": ["@types/*", "eslint-*", "@storybook/*"].
  • A library nobody uses yet (evaluating a migration target): "include": ["@tanstack/react-query"].
  • Fewer versions. "maxVersions": 4 keeps the versions in use plus the most useful upgrade targets.
  • Docs only on a website (no docs/ in the repository, nothing in the package): "sources": { "site": true }. It reads llms.txt or the sitemap, honours robots.txt and skips sites that need JavaScript.
  • Faster pick-up of releases: "interval": "6h".
Symptom Cause and fix
Settings › System says indexing is off The libraries entry for All repositories has enabled: false, or its value does not parse (an interval under 1h, for example)
The page is empty after a run No depgraph or usages records yet: run those analyses first
libraries: no GitHub token could be read; reading GitHub anonymously in the log None of the credentials the github field lists exists or can be read: check their names or ids, or remove the field to use every github credential. A single missing one is logged as no credential "…" and left out
Runs take long and the log shows github: core rate limit exhausted; waiting … Every token is used up; the run waits for the reset and goes on. Add a token of another account to share the load
github: two tokens belong to … in the log Both tokens are of one GitHub account and share its limit; one of them is not used
api is missing for an npm package The package ships no .d.ts; types published separately as @types/… are not used for it
An agent gets “not indexed” for a library you can see The token’s owner cannot read any repository that uses it, the library is excluded, or the run has not reached it yet
repository, releases, issues are skipped The library is not hosted on GitHub; only the package archive and API are indexed
repository is missing: “larger than … bytes” The repository tarball at that tag is over 100 MB compressed, so its docs are not downloaded; the package archive and API still are