npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@contextdb/cloud

v0.2.0-alpha.2

Published

TypeScript SDK for persistent, action-aware memory in AI voice, support, and workflow agents

Downloads

129

Readme

ContextDB Cloud TypeScript SDK for AI agent memory

Give Node.js voice, support, and workflow agents persistent memory through the hosted ContextDB data plane.

npm install @contextdb/[email protected]
import { CloudClient } from "@contextdb/cloud";

const db = new CloudClient({
  baseUrl: "https://api.contextdb.ai",
  apiKey: process.env.CONTEXTDB_API_KEY!,
});

const corrected = await db.evolve("caller-1", "update", {
  idempotencyKey: "call-456-correction-v1",
  targetMemoryId: currentMemoryId,
  content: "My preferred visit day is Sunday.",
  source: "user_stated",
});
const retracted = await db.evolve("caller-1", "delete", {
  idempotencyKey: "call-456-retraction-v1",
  targetMemoryId: obsoleteMemoryId,
});
const duplicate = await db.evolve("caller-1", "noop", {
  idempotencyKey: "call-456-duplicate-v1",
  noopReason: "duplicate",
});

Each result exposes requested/applied operation, outcome, optional memory, previous and deleted memory IDs, NOOP reason, memory version, primary WAL position, and request ID. Memory IDs are opaque; pass them unchanged.

Project API keys are server credentials. Do not expose them to browser code. The package is marked server-only and throws if constructed in a browser runtime. Use it from Node.js servers, API routes, workers, or server actions.

Use cases

  • Remember caller preferences across Retell, LiveKit, Pipecat, or custom voice agent sessions.
  • Ground support responses in previous conversations.
  • Require an act/ask/abstain decision before consequential tools run.
  • Pass consistency tokens when a follow-up recall must observe a recent write.
  • Report execution receipts for an auditable memory-to-action timeline.
  • Correct a known memory or stable slot with UPDATE while retaining lineage.
  • Retract a target or slot with DELETE and inspect the returned deleted IDs.
  • Represent a duplicate as NOOP instead of storing another copy.

Asynchronous Formation

const submitted = await db.submitFormationJob(
  "caller-1",
  [{ speaker: "user", content: "I prefer Saturday mornings." }],
  {
    mode: "propose",
    idempotencyKey: "call-456-formation-v1",
  },
);

const job = await db.getFormationJob(submitted.job_id);

Jobs accept structured text turns and return closed, inspectable statuses. Formation remains Hosted Alpha with no audio or cancellation contract. Synchronous and asynchronous Formation responses expose operation, opaque target, server-derived candidate key, per-operation results/counts, deleted IDs, and consistency tokens. Legacy candidates without an operation are implicit ADD; the client never manufactures missing operation results.

TypeScript starter kits

Both starters install this package from npm and compile against their current framework dependencies in CI.

Links

Status and limitations

This is a server-only Hosted Alpha transport. Formation accepts structured text turns only; there is no audio upload, cancellation, job listing, retention API, or public availability SLO. On August 24, 2026, a bounded hosted proof passed direct ADD, UPDATE, NOOP, and DELETE; real-provider Formation UPDATE, NOOP, and DELETE; consistency, lineage, Memory CI, privacy, and zero-residue cleanup. That proves the functional path, not sustained load, failover, availability, or an SLO. The package contains no hosted planner, worker, tenancy, commit ledger, or recovery code.

FAQ

Which evolution operation should I use?

Use ADD for a new durable fact, UPDATE for a correction, DELETE for an explicit retraction, and NOOP for a duplicate or no durable change. UPDATE and DELETE need an opaque target ID or an entity/attribute slot.

Can I call evolve from a browser?

No. A cdb_ key is a project-wide server credential. The constructor fails closed when window exists.

Is this package production-ready?

The package is alpha and contains no ContextDB Cloud server implementation. The bounded hosted proof establishes the functional path only. It does not establish sustained-load behavior, failover, availability, or a public SLA.