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

korely-memory

v0.1.1

Published

JavaScript / TypeScript SDK for Korely Agents — memory for AI agents with bi-temporal typed facts.

Readme

korely-memory

The JavaScript / TypeScript SDK for Korely Agents — memory for AI agents, with a typed bi-temporal knowledge graph behind every write. A thin, zero-dependency client over the Korely REST API (uses the native fetch). Same package name as the Python twin on PyPI.

npm install korely-memory

Quickstart

import { Korely } from "korely-memory";

const korely = new Korely({ apiKey: "kor_live_..." }); // or set KORELY_API_KEY

// Remember something your agent learned about an end user
await korely.add("Maria prefers email over Slack, and her renewal is in October.", {
  user_id: "customer-4812",
});

// Later — even in a new session — pull a prompt-ready block back
const ctx = await korely.getContext({
  query: "how does Maria like to be contacted?",
  user_id: "customer-4812",
});
console.log(ctx.context); // drop straight into your system prompt

That's the whole loop: add to remember, getContext (or search) to recall. Behind add, Korely extracts typed, bi-temporal facts and builds a graph — you just hand it text.

Methods

Every method maps to one REST endpoint.

| Method | Endpoint | | |---|---|---| | add(content, opts?) | POST /v1/memories | Write. content is a string or a list of chat messages. opts.timestamp (ISO) backfills the past — facts inherit it as valid_from. | | search(query, opts?) | POST /v1/memories/search | Hybrid search over memories. | | getAll(opts?) | GET /v1/memories | List a scope, newest first. | | get(id) | GET /v1/memories/:id | One memory, with its facts. | | update(id, { content }) | PATCH /v1/memories/:id | Re-runs extraction. | | delete(id) | DELETE /v1/memories/:id | Forget one (audited). | | deleteAll({ user_id }) | DELETE /v1/users/:user_id/memories | Forget everything for a user (GDPR). | | history(id) | GET /v1/memories/:id/history | A memory's timeline + the facts it produced. | | users(opts?) | GET /v1/users | Your end users, with counts. | | listAgents(opts?) | GET /v1/agents | Your agent namespaces, with counts + the tier cap/used. Call after agent_cap_exceeded to reuse an id. | | deleteAgent(agentId) | DELETE /v1/agents/:agent_id | Purge an agent namespace and free its cap slot. | | getFacts(opts?) | GET /v1/facts | Typed facts; as_of for point-in-time. | | addFactTriple(s, p, o, opts?) | POST /v1/facts | Write a fact directly (bi-temporal). | | getProfile({ user_id, as_of? }) | GET /v1/profile | The assembled profile of one end user. | | getContext({ query, user_id? }) | GET /v1/context | One call → a prompt-ready context block. | | batch(memories) | POST /v1/batch | Bulk import, for migrations. | | batchStatus(jobId) | GET /v1/batch/:id | Poll an import job. |

Bi-temporal facts (the moat)

Every write extracts typed (subject, predicate, object) facts with validity in time. Ask what was true on a past date:

// What did we know about this user on March 1st?
const past = await korely.getProfile({ user_id: "customer-4812", as_of: "2026-03-01" });

// Write a fact directly, dated in the past
await korely.addFactTriple("Marco", "works_at", "Acme GmbH", {
  user_id: "customer-4812",
  valid_from: "2026-06-01",
});

Errors

Every error subclasses KorelyError, so one catch covers them all:

import { Korely, QuotaExceededError, AuthenticationError } from "korely-memory";

try {
  await korely.add("...", { user_id: "u" });
} catch (e) {
  if (e instanceof QuotaExceededError) {
    console.log(`Rate limited — retry after ${e.retryAfter}s`);
  } else if (e instanceof AuthenticationError) {
    console.log("Bad or missing API key");
  } else {
    throw e;
  }
}

AuthenticationError (401) · NamespaceForbiddenError (403) · NotFoundError (404) · StaleWriteError (409) · QuotaExceededError (429, carries retryAfter) · APIError (everything else).

Configuration

new Korely({
  apiKey: "kor_live_...",  // or the KORELY_API_KEY env var
  region: "eu",             // EU only — data stored and processed in the EU
  timeoutMs: 30000,
});

Requires Node 18+ (native fetch), or any runtime with a global fetch. On older runtimes, pass one via { fetch }.

Docs

MIT © Korely