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

@threadlessai/sdk

v0.2.0

Published

Threadless AI: memory for agents. Decorate every model call, report every reply.

Readme

@threadlessai/sdk

Threadless AI: memory for agents. Decorate every model call, report every reply.

npm install @threadlessai/sdk

Set THREADLESS_API_KEY (a tl_live_… or tl_test_… project key), or pass apiKey.

Chat Completions

import OpenAI from 'openai';
import { Threadless } from '@threadlessai/sdk';

const openai = new OpenAI();
const threadless = new Threadless();
const { id: memoryId } = await threadless.memories.create(); // one per conversation

let newMessages: any[] = [
  { role: 'system', content: 'You are a helpful assistant.' },
  { role: 'user', content: 'Hi, I am planning a kitchen install.' },
];
for (;;) {
  const request = await threadless.chat.decorate(memoryId, newMessages, {
    model: 'gpt-5',
    tools: yourTools, // decorate adds the two memory functions
  });
  const reply = await openai.chat.completions.create(request as any);
  threadless.chat.report(memoryId, reply);
  const message = reply.choices[0].message;
  if (!message.tool_calls?.length) break;
  newMessages = message.tool_calls.map((call: any) => ({
    role: 'tool',
    tool_call_id: call.id,
    // The memory functions are answered by answer(call); decorate fills in what memory holds.
    content: threadless.chat.answer(call) ?? runYourTool(call),
  }));
}

Responses works the same way through threadless.responses.

The memory functions

Decorate adds two functions to every request's tools, so the model works with its own memory:

  • assistant_memory: the model searches and walks everything said in this conversation, including what has left live context.
  • memory_note: the model writes facts down when part of the history is about to leave live context.

Your tool loop answers both with answer(call), which returns undefined for your own tools. The next decorate puts the memory's result in place of the answer, so your code never handles it. When we cannot be reached, decorate falls back to the local tail and a memory call's output says memory is unavailable.

Setup for agents: https://threadlessai.com/setup · Docs: https://threadlessai.com/docs

License

Proprietary. See LICENSE: use is limited to calling the Threadless AI service under its Terms of Service.