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

pali-client

v0.1.0

Published

Typed JavaScript/TypeScript client and middleware for the Pali memory API

Readme

Pali JavaScript / TypeScript Client

Typed JS/TS SDK and middleware for the Pali memory API.

Pali is very early in development and should not be treated as a complete memory solution yet. Right now the product focus is infrastructure correctness and reliability first.

Middleware is provided as an early-stage autopilot helper, not a guaranteed memory optimization system.

Why JavaScript/TypeScript next

Recent ecosystem signals point to JS/TS as the best companion package to Python:

  • Stack Overflow 2024 reports JavaScript as the most-used language in the survey and shows TypeScript adoption at 38.5% across respondents.
  • GitHub's 2025 Octoverse update reports TypeScript as the #1 language by contributors on GitHub.
  • npm describes itself as the world's largest software registry and registry for JavaScript packages.

Install

npm install pali-client

Quickstart

import { PaliClient } from "pali-client";

const client = new PaliClient("http://127.0.0.1:8080");
await client.createTenant({ id: "user:42", name: "User 42" });
await client.store("user:42", "Likes jazz", { kind: "observation", tags: ["music"] });
const results = await client.search("user:42", "music preferences", { topK: 3 });
console.log(results.items.map((m) => m.content));

Environment variables

Low-priority constructor fallbacks:

  • PALI_BASE_URL
  • PALI_TOKEN
  • PALI_TIMEOUT (milliseconds)

Constructor values always win over environment values.

Middleware (Experimental Autopilot)

import { PaliClient, PaliMiddleware } from "pali-client";

const client = new PaliClient("http://127.0.0.1:8080");
const middleware = new PaliMiddleware(client, "user:42");

const llm = async (messages: Array<{ role: string; content: string }>) => {
  return { content: "You like jazz." };
};

const wrapped = middleware.wrap(llm);
await wrapped([{ role: "user", content: "What music do I like?" }]);

Destructive memory actions are opt-in:

import { PaliMiddleware } from "pali-client";

const middleware = new PaliMiddleware(client, "user:42", {
  allowDestructiveActions: true,
  actionPlanner: (_messages, recalled, _result, responseText) => {
    if (recalled.length && responseText.toLowerCase().includes("moved to austin")) {
      return [{
        kind: "replace",
        memoryId: recalled[0].id,
        request: {
          tenantId: "user:42",
          content: "User lives in Austin.",
          kind: "observation",
          createdBy: "system"
        }
      }];
    }
    return [];
  }
});

replace currently executes as delete-plus-store because the current Pali server has no PATCH /v1/memory/:id endpoint yet.

API coverage

Implemented:

  • health()
  • createTenant()
  • tenantStats()
  • store()
  • storeBatch()
  • search()
  • deleteMemory()

Not implemented because server endpoints are not currently exposed:

  • GET /v1/memory/:id
  • PATCH /v1/memory/:id
  • DELETE /v1/tenants/:id
  • cursor pagination and streaming memory feeds