Hivemind

Installation

TypeScript

The TypeScript client.

npm
npm install @get-hivemind/sdk
bun
bun add @get-hivemind/sdk
ts
import { Hivemind } from "@get-hivemind/sdk";

const hm = new Hivemind({ apiKey: process.env.HIVEMIND_API_KEY! });

await hm.remember({ content: "We cap production deploys at 3 a month" });

const { payload } = await hm.recall({ q: "how often can we deploy?" });

Create a key under Connected tools in the dashboard. Treat it like a password, it grants full access to your memory.

Options

Default
apiKeyrequiredFrom the dashboard
sourceRefnoneDefault origin for calls that do not name one, or withOrigin()
maxRetries20 disables retrying
timeoutMs30000Per attempt
baseUrlhostedPoint at a different deployment
fetchglobalInject your own, for tests or a proxy

Asking from one origin

ts
const acme = hm.withOrigin("acme");
await acme.remember({ content: "Their staging runs Postgres 16" });

Everything on the derived client names that origin. Searches still cover everything owned; results from the origin are preferred, never exclusive. The original is unchanged.

Retries

Transient failures, 408, 409, 429, and 5xx, are retried with exponential backoff and jitter. Client errors are not: retrying a 400 cannot succeed, and retrying a quota error only delays the message you need to read.