Files
Chris Bartholomew 5f3c4970da chore(deps): update npm dependencies in the root lockfile (#4261)
* chore(deps): update npm dependencies in the root lockfile

Raise the override floors for next, svgo, sharp, js-yaml, colord and joi,
and bump the vitest devDependency across the three workspaces that declare
it, so the root workspace tree resolves to current versions.

Resolved versions: next 16.3.4, svgo 4.1.0, sharp 0.35.4, js-yaml 4.3.2
(3.15.2 for the two v3-scoped consumers), colord 2.10.0, joi 17.13.7,
vitest and @vitest/mocker 4.1.11. Every bump stays inside the existing
major line.

The lockfile was regenerated with npm 11. npm 10.9.2 has an
overrides-plus-workspaces bug that applies an override at the hoisted root
while de-hoisting fresh copies of the old version into hindsight-all-npm
and hindsight-clients/typescript, which leaves the tree worse than before.
npm 11 resolves each package to a single hoisted copy. It also prunes a
handful of optional peerDependency entries that npm 10 records, which
accounts for most of the deletions in the lockfile diff; npm ci under
npm 10.9.2 still installs from the result cleanly.

* chore(deps): regenerate the agent-sdk standalone lockfile to match its manifest

hindsight-tools/hindsight-agent-sdk is both a root workspace and carries
its own standalone package-lock.json. The previous commit raised its
vitest devDependency to ^4.1.11 but regenerated only the root lockfile,
which left the standalone one recording ^4.1.2 / 4.1.5 and out of sync
with its own manifest.

test-hindsight-agent-sdk installs from the root lockfile, so CI would not
have caught the drift, but a standalone npm ci in that directory would
have failed. Regenerated with npm 11; vitest and @vitest/mocker now
resolve to 4.1.11 there too.
2026-09-09 10:33:56 -04:00
..

@vectorize-io/hindsight-all

Node.js equivalent of the Python hindsight-all package — programmatic lifecycle manager for a local Hindsight daemon. Use this when you want to embed Hindsight in a Node application without hand-rolling subprocess management.

This package deliberately does not ship an HTTP client. Once the daemon is running, talk to it with @vectorize-io/hindsight-client against server.getBaseUrl(). The two packages compose — one owns the daemon process, the other owns the HTTP API surface.

Requirements

  • Node.js >= 22 — uses global fetch and AbortSignal.timeout.
  • uv / uvx on PATH — used to download and run the underlying hindsight-embed daemon on first use. Install via https://docs.astral.sh/uv/.

Install

npm install @vectorize-io/hindsight-all @vectorize-io/hindsight-client

Example

import { HindsightServer, consoleLogger } from "@vectorize-io/hindsight-all";
import { HindsightClient } from "@vectorize-io/hindsight-client";

const server = new HindsightServer({
  profile: "my-app",
  port: 9077,
  env: {
    HINDSIGHT_API_LLM_PROVIDER: "anthropic",
    HINDSIGHT_API_LLM_API_KEY: process.env.ANTHROPIC_API_KEY,
    HINDSIGHT_API_LLM_MODEL: "claude-sonnet-4-20250514",
  },
  logger: consoleLogger,
});

await server.start();

const client = new HindsightClient({ baseUrl: server.getBaseUrl() });

await client.retain("user-123", "User prefers dark mode and concise answers.", {
  documentId: "pref-2026-04-01",
});

const recall = await client.recall("user-123", "what are the user preferences?");
console.log(recall.results);

await server.stop();

For a remote Hindsight API, skip HindsightServer entirely and just point HindsightClient at the remote URL.

Open config — forward-compatible with new daemon flags

HindsightServerOptions is designed so every new environment variable or CLI flag in the underlying Hindsight daemon can be used without waiting for a wrapper release:

  • env accepts an arbitrary Record<string, string>. Every entry is exported into the daemon process and written into the profile config via --env KEY=VALUE.
  • extraProfileCreateArgs / extraDaemonStartArgs append raw args to the respective commands.

Development against a local checkout

If you're hacking on the Python hindsight-embed package in the same monorepo, point the server at the local path — it'll use uv run --directory <path> instead of uvx:

new HindsightServer({
  embedPackagePath: "/path/to/hindsight-embed",
  // ...
});

API surface

  • HindsightServer — daemon lifecycle (start, stop, checkHealth, getBaseUrl, getProfile).
  • Logger interface plus silentLogger (default) and consoleLogger helpers.
  • getEmbedCommand(opts) — low-level helper that returns the [cmd, ...args] tuple used to invoke the underlying Python CLI.

For memory operations (retain, recall, reflect, bank management, stats) use @vectorize-io/hindsight-client.

License

MIT