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

@deltamemory/ai-sdk

v0.5.1

Published

DeltaMemory integration for Vercel AI SDK

Downloads

18

Readme

@deltamemory/ai-sdk

DeltaMemory integration for Vercel AI SDK. Provides memory tools that AI agents can use to recall past context and store important information.

Installation

npm install @deltamemory/ai-sdk
# or
yarn add @deltamemory/ai-sdk
# or
pnpm add @deltamemory/ai-sdk

The deltamemory client is included as a dependency, so you don't need to install it separately.

Quick Start

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { deltaMemoryTools, DeltaMemory } from '@deltamemory/ai-sdk';

const client = new DeltaMemory({
  apiKey: process.env.DELTAMEMORY_API_KEY,  // From dashboard
  baseUrl: process.env.DELTAMEMORY_URL      // Your assigned endpoint
});

const { text } = await generateText({
  model: openai('gpt-4'),
  messages: [
    {
      role: 'system',
      content: 'You are a helpful assistant with memory. Use memory tools to recall context and store important information.'
    },
    {
      role: 'user',
      content: 'What are my preferences?'
    }
  ],
  tools: {
    ...deltaMemoryTools(client, { userId: 'user-123' })
  },
  maxToolRoundtrips: 5
});

console.log(text);

API

deltaMemoryTools(client, config)

Creates memory tools for Vercel AI SDK.

Parameters:

  • client: DeltaMemory - DeltaMemory client instance
  • config: DeltaMemoryToolsConfig - Configuration object
    • userId: string - User identifier for memory isolation (required)
    • collection?: string - Optional collection name
    • metadata?: Record<string, string> - Optional metadata for all operations

Returns: Object with recallMemory and storeMemory tools

Tools

recallMemory

Search past conversations and user context.

When to use:

  • User references past events
  • User asks about preferences or history
  • Context would improve the response

Parameters:

  • query: string - What to search for
  • limit?: number - Max results (default: 5)

Returns:

  • profiles - Structured user facts
  • events - Timeline entries
  • context - Pre-formatted context string
  • memoryCount - Number of memories found

storeMemory

Store important information for future reference.

When to use:

  • User shares preferences
  • User asks to remember something
  • Important facts emerge

Parameters:

  • content: string - Information to remember
  • importance?: 'low' | 'medium' | 'high' - Importance level

Returns:

  • memoryIds - IDs of stored memories
  • extractedFacts - Automatically extracted facts
  • extractedConcepts - Automatically extracted concepts

Examples

Basic Chat

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { deltaMemoryTools, DeltaMemory } from '@deltamemory/ai-sdk';

const client = new DeltaMemory({
  apiKey: process.env.DELTAMEMORY_API_KEY,
  baseUrl: process.env.DELTAMEMORY_URL
});

async function chat(userId: string, message: string) {
  const { text } = await generateText({
    model: openai('gpt-4'),
    messages: [{ role: 'user', content: message }],
    tools: {
      ...deltaMemoryTools(client, { userId })
    }
  });
  return text;
}

// First message - stores preference
await chat('user-123', 'I prefer TypeScript over JavaScript');

// Second message - recalls preference
await chat('user-123', 'What programming language should I use?');

Streaming

import { streamText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { deltaMemoryTools, DeltaMemory } from '@deltamemory/ai-sdk';

const client = new DeltaMemory({
  apiKey: process.env.DELTAMEMORY_API_KEY,
  baseUrl: process.env.DELTAMEMORY_URL
});

async function chatStream(userId: string, message: string) {
  const { textStream } = await streamText({
    model: openai('gpt-4'),
    messages: [{ role: 'user', content: message }],
    tools: {
      ...deltaMemoryTools(client, { userId })
    }
  });

  for await (const chunk of textStream) {
    process.stdout.write(chunk);
  }
}

Multi-User

import { deltaMemoryTools, DeltaMemory } from '@deltamemory/ai-sdk';

const client = new DeltaMemory({
  apiKey: process.env.DELTAMEMORY_API_KEY,
  baseUrl: process.env.DELTAMEMORY_URL
});

async function chat(userId: string, message: string) {
  const { text } = await generateText({
    model: openai('gpt-4'),
    messages: [{ role: 'user', content: message }],
    tools: {
      ...deltaMemoryTools(client, {
        userId,
        collectionPrefix: 'myapp',  // Collection: 'myapp-user-123'
        metadata: { source: 'chat' }
      })
    }
  });
  return text;
}

Documentation

For complete documentation, visit deltamemory.ai/docs

License

Proprietary - See LICENSE file