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

clsplusplus

v7.0.0

Published

Brain-inspired, model-agnostic persistent memory for LLMs. Learn, recall, forget — like a brain. Works with OpenAI, Claude, Gemini, Llama.

Readme

CLS++ JavaScript/TypeScript SDK

Brain-inspired, model-agnostic persistent memory for Large Language Models.

Installation

npm install clsplusplus

Get an API key

Every call needs an API key — without one the first learn() returns 401.

  1. Sign up at https://www.clsplusplus.com and open your profile page.
  2. Copy your key (cls_live_…) and expose it to the SDK:
export CLS_API_KEY="cls_live_xxxxxxxxxxxx"

Or pass it explicitly — see Configuration below.

Quick Start

import { Brain } from "clsplusplus";

const brain = new Brain("alice");

// Teach it anything
await brain.learn("I work at Google as a senior engineer");
await brain.learn("I prefer Python over JavaScript");

// Ask it anything — semantic recall, not keyword matching
const facts = await brain.ask("What's my job?");
// → ["I work at Google as a senior engineer"]

// Get LLM-ready context for any prompt
const context = await brain.context("coding help");
// → "Known facts about this user:\n- I work at Google..."

// Forget (GDPR right to be forgotten)
await brain.forget("I work at Google as a senior engineer");

Configuration

const brain = new Brain("alice", {
  apiKey: "your-api-key",             // or set CLS_API_KEY env var
  url: "https://www.clsplusplus.com", // or set CLS_BASE_URL env var
});

Full API

| Method | Description | |--------|-------------| | brain.learn(fact, meta?) | Teach a fact. Returns memory ID. | | brain.ask(question, limit?) | Query for relevant facts. Returns string array. | | brain.context(topic?, limit?) | Get LLM-ready context string. | | brain.forget(factOrId) | Forget by text or ID. Returns boolean. | | brain.absorb(content, source?) | Bulk-learn from text or array. Returns count. | | brain.who() | Auto-generated user profile. | | brain.correct(wrong, right) | Update a belief (forget old, learn new). | | brain.chat(message, llmFn?, system?) | Full conversation handler with memory. | | brain.teach(data) | Learn from key-value object. | | brain.watch(messages) | Learn from chat message array. | | brain.all(limit?) | Get all memories. | | brain.count() | Count stored memories. | | brain.wrap(llmFn) | Wrap any LLM function with auto-memory. |

Module-Level Functions

For scripts and one-liners:

import { learn, ask, context, forget } from "clsplusplus";

await learn("alice", "Prefers dark mode");
const facts = await ask("alice", "What theme?");

Use with OpenAI

import OpenAI from "openai";
import { Brain } from "clsplusplus";

const openai = new OpenAI();
const brain = new Brain("alice");

const response = await brain.chat(
  "Help me pick a framework",
  async (system, message) => {
    const res = await openai.chat.completions.create({
      model: "gpt-4",
      messages: [
        { role: "system", content: system },
        { role: "user", content: message },
      ],
    });
    return res.choices[0].message.content || "";
  },
);

Use with Anthropic

import Anthropic from "@anthropic-ai/sdk";
import { Brain } from "clsplusplus";

const anthropic = new Anthropic();
const brain = new Brain("alice");

const chat = brain.wrap(async (system, message) => {
  const res = await anthropic.messages.create({
    model: "claude-sonnet-4-20250514",
    max_tokens: 1024,
    system,
    messages: [{ role: "user", content: message }],
  });
  return res.content[0].type === "text" ? res.content[0].text : "";
});

const response = await chat("You are a helpful assistant", "What editor should I use?");

Browser Usage

The SDK uses native fetch and works in all modern browsers. Environment variables are not available in browsers, so pass apiKey and url directly:

const brain = new Brain("alice", {
  apiKey: "your-key",
  url: "https://www.clsplusplus.com",
});

Requirements

  • Node.js 18 or later (uses native fetch)
  • Zero runtime dependencies

License

Apache-2.0