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

memosift

v1.0.0-alpha.1

Published

Persistent memory + tool-result intelligence for AI agents — TypeScript SDK. One install, all framework adapters, MCP server, CLI, and the agent skill.

Readme

memosift

Persistent memory + tool-result intelligence for AI agents — TypeScript SDK.

npm License: MIT Homepage

MemoSift is a memory layer for AI agents that combines three things competitors don't usually combine:

  1. Deterministic classification + metadata + security scanning of tool results — runs locally, no cloud dependency
  2. A queryable knowledge graph of memories, intents, entities, and artifacts — backed by Postgres + pgvector + cross-encoder reranker
  3. Optional context-budget compression — auto-stub large tool outputs and auto-compress old turns when the context window fills

Same-named SDKs in TypeScript and Python, both client-side, both MIT. The cloud is a paid service.


Install

npm install memosift

That's it. One package. Includes the entire SDK, every framework adapter (Anthropic, OpenAI, OpenAI Agents, Claude Agent SDK, LangChain, LangGraph, Vercel AI, generic), the Claude Code hook handlers, the MCP server, and the memosift CLI binary.

Requires Node.js 20+.


Pro tier — getting an API key

Anything beyond local primitives (Mode A: classify, extractMetadata, scan) requires a MemoSift cloud account. The asynchronous extraction + reconciliation pipeline that powers track, recall, compress, and explore is hosted at https://dev.memosift.com.

To enable the Pro features:

  1. Go to memosift.com and sign up.
  2. Create a project from the dashboard.
  3. Create an API key inside that project (it starts with msk_).
  4. Configure your SDK to point at the cloud at https://dev.memosift.com.
  5. Pass the key when constructing MemoSift({...}).
  6. You're live — track, recall, compress, explore all work.
import { MemoSift } from "memosift";

const ms = new MemoSift({
  apiKey: process.env.MEMOSIFT_API_KEY!,        // the msk_... key from step 3
  baseUrl: "https://dev.memosift.com",          // the cloud URL from step 4
});

If the cloud is unreachable, every track call queues locally and ships once the network returns — your agent never blocks on MemoSift.


Quick start

import { MemoSift } from "memosift";

const ms = new MemoSift({
  apiKey: process.env.MEMOSIFT_API_KEY!,
  baseUrl: "https://dev.memosift.com",
});

// After each agent turn:
await ms.track(
  [
    { role: "user", content: "find me CSV files" },
    { role: "assistant", content: "Found 3 CSVs." },
  ],
  { sessionId: "my-session" }
);

// When you want recall:
const result = await ms.recall("user's question", { sessionId: "my-session" });
for (const item of result.items) {
  console.log(item.content.slice(0, 120));
}

// When you want a structured context block:
const ctx = await ms.compress({ sessionId: "my-session" });
console.log(ctx.contextBlock);

Three integration modes

| Mode | Network | Mutates tool results | Provides recall | Provides compression | Use when | |---|---|---|---|---|---| | A — Inspector | None | No | No | No | Compliance, telemetry, routing — pure local primitives | | B — Sidecar (default) | Yes | No | Yes (cross-session) | No | Long-running agents that need persistent memory | | C — Co-pilot | Yes | Yes (≥2 KB tool results stubbed in model's view) | Yes | Yes (in-session) | Auto-everything; agents that hit context limits |

The Inspector primitives run locally with no cloud dependency. They're free under MIT.

import { classify, extractMetadata, scan, SecurityMode } from "memosift";

const ct = classify(myToolOutput);                         // ContentType enum
const md = extractMetadata(myToolOutput, ct);              // structured metadata

// Security: FLAG (annotate), REDACT (mask matches), or BLOCK (throw)
const result = scan(myToolOutput, { mode: SecurityMode.REDACT });
console.log(result.content);                               // secrets masked
console.log(result.findings);                              // SecurityFinding[]

Framework adapters

Each adapter leverages the most natural extension point of its target framework. Tool outputs flow through the MemoSift interception pipeline transparently — large results get replaced in place with artifact stubs (Mode C), or just observed and tracked (Modes A/B).

Anthropic

import Anthropic from "@anthropic-ai/sdk";
import { MemoSift, wrapAnthropic } from "memosift";

const ms = new MemoSift({ apiKey: process.env.MEMOSIFT_API_KEY!, baseUrl: "https://dev.memosift.com" });
const session = ms.session("my-session");
const client = wrapAnthropic(new Anthropic(), { memosift: ms, session });

// Use `client` exactly like the original Anthropic SDK.
const response = await client.messages.create({
  model: "claude-sonnet-4-5",
  max_tokens: 1024,
  messages: [...],
});

OpenAI (Chat Completions + Responses API)

import OpenAI from "openai";
import { MemoSift, wrapOpenAI } from "memosift";

const ms = new MemoSift({ apiKey: process.env.MEMOSIFT_API_KEY!, baseUrl: "https://dev.memosift.com" });
const session = ms.session("my-session");
const client = wrapOpenAI(new OpenAI(), { memosift: ms, session });

LangChain

import { ChatOpenAI } from "@langchain/openai";
import { MemoSift, memosiftCallback } from "memosift";

const ms = new MemoSift({ apiKey: process.env.MEMOSIFT_API_KEY!, baseUrl: "https://dev.memosift.com" });
const handler = memosiftCallback({ memosift: ms, session: ms.session("my-session") });
const llm = new ChatOpenAI({ callbacks: [handler] });

LangGraph

import { MemoSift, withLangGraphMemoSift } from "memosift";

const ms = new MemoSift({ apiKey: process.env.MEMOSIFT_API_KEY!, baseUrl: "https://dev.memosift.com" });
const wrapped = withLangGraphMemoSift(myCompiledGraph, { memosift: ms, session: ms.session("my-session") });

Vercel AI SDK

import { generateText } from "ai";
import { MemoSift, memosiftMiddleware } from "memosift";

const ms = new MemoSift({ apiKey: process.env.MEMOSIFT_API_KEY!, baseUrl: "https://dev.memosift.com" });
const middleware = memosiftMiddleware({ memosift: ms, session: ms.session("my-session") });
// Pass `middleware` via the Vercel AI SDK's middleware option.

Claude Agent SDK

import { MemoSift, installClaudeAgentMemoSift } from "memosift";

const ms = new MemoSift({ apiKey: process.env.MEMOSIFT_API_KEY!, baseUrl: "https://dev.memosift.com" });
installClaudeAgentMemoSift(myAgent, { memosift: ms, session: ms.session("my-session") });

OpenAI Agents SDK

import { MemoSift, wrapOpenAIAgentsTool } from "memosift";

const ms = new MemoSift({ apiKey: process.env.MEMOSIFT_API_KEY!, baseUrl: "https://dev.memosift.com" });
const wrappedTool = wrapOpenAIAgentsTool(myTool, { memosift: ms, session: ms.session("my-session") });

Generic adapter

For any framework not listed above. You declare which methods to intercept and supply an extractor.

import { MemoSift, wrapGenericClient } from "memosift";

const ms = new MemoSift({ apiKey: process.env.MEMOSIFT_API_KEY!, baseUrl: "https://dev.memosift.com" });
const wrapped = wrapGenericClient(myClient, {
  memosift: ms,
  session: ms.session("my-session"),
  methods: ["chat.completions.create"],
  extract: (result, ctx) => [{ toolName: "myTool", content: String(result) }],
});

Teach your AI coding agent how to use MemoSift

This package ships with an installable skill that teaches Claude Code, Cursor, Codex CLI, Copilot, or Windsurf how to wire MemoSift into your code correctly:

# After installing the SDK, run from your project root:
memosift install-skill

# Or install everywhere this project supports:
memosift install-skill --all

# Or install globally for Claude Code:
memosift install-skill --user

The CLI auto-detects which agents are configured (.claude/, .cursor/rules/, AGENTS.md) and writes the appropriate format for each. Idempotent — re-runs without --force skip files already containing the MemoSift section.


CLI

memosift login                 # save your API key locally
memosift install-skill         # install the agent skill into the current project
memosift install               # wire MemoSift hooks into Claude Code settings
memosift mcp                   # run as MCP server over stdio (for Claude Code)
memosift hook post-tool-use    # individual hook handlers
memosift config get|set|list   # manage local config
memosift doctor                # diagnostic / troubleshooting

License

MIT — see LICENSE.

The MemoSift cloud service and dashboard are proprietary; the Inspector primitives in this SDK run locally and are free to use under MIT with no API key required.


Links