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

@youcraft/recall

v0.2.0-alpha.0

Published

Memory layer for AI applications. LLM-powered fact extraction, smart deduplication, and vector search — all in your existing database with zero vendor lock-in.

Readme

@youcraft/recall

Core memory client for AI applications. This package provides the main createMemory function and all the TypeScript interfaces for building memory-enabled AI apps.

Installation

pnpm add @youcraft/recall

You'll also need to install providers for embeddings, extraction, and database storage:

pnpm add @youcraft/recall-embeddings-openai @youcraft/recall-extractor-openai @youcraft/recall-adapter-sqlite

Usage

import { createMemory, inMemoryAdapter } from '@youcraft/recall'
import { openaiEmbeddings } from '@youcraft/recall-embeddings-openai'
import { openaiExtractor } from '@youcraft/recall-extractor-openai'

const memory = createMemory({
  db: inMemoryAdapter(), // or sqliteAdapter() for persistence
  embeddings: openaiEmbeddings({ apiKey: process.env.OPENAI_API_KEY! }),
  extractor: openaiExtractor({ apiKey: process.env.OPENAI_API_KEY! }),
})

// Extract memories from text
const extracted = await memory.extract('User: My name is Alice and I work at Acme Corp.', {
  userId: 'user_123',
})

// Query relevant memories
const memories = await memory.query("What is the user's name?", {
  userId: 'user_123',
  limit: 5,
})

API

createMemory(config)

Creates a memory client with the provided configuration.

const memory = createMemory({
  db: DatabaseAdapter, // Required: storage adapter
  embeddings: EmbeddingsProvider, // Required: embedding provider
  extractor: ExtractorProvider, // Required: fact extractor
})

Memory Client Methods

extract(text, options)

Extract and store memories from text. Automatically consolidates with existing memories to prevent duplicates.

await memory.extract('User said they love pizza', {
  userId: 'user_123',
  source: 'chat', // Optional: source identifier
  sourceId: 'msg_456', // Optional: source record ID
})

query(context, options)

Find relevant memories using vector similarity search.

const memories = await memory.query('What food does the user like?', {
  userId: 'user_123',
  limit: 10, // Optional: max results (default: 10)
  threshold: 0.7, // Optional: minimum similarity score
})

list(userId)

List all memories for a user.

const allMemories = await memory.list('user_123')

get(id)

Get a single memory by ID.

const memory = await memory.get('memory_id')

update(id, data)

Update a memory's content or metadata.

await memory.update('memory_id', {
  content: 'Updated content',
  metadata: { updated: true },
})

delete(id)

Delete a single memory.

await memory.delete('memory_id')

clear(userId)

Delete all memories for a user.

await memory.clear('user_123')

Types

This package exports all TypeScript interfaces:

import type {
  Memory,
  MemoryMetadata,
  MemoryConfig,
  DatabaseAdapter,
  EmbeddingsProvider,
  ExtractorProvider,
  ExtractedMemory,
  ConsolidationDecision,
  ConsolidationMemory,
  QueryOptions,
  ExtractOptions,
} from '@youcraft/recall'

Built-in Adapters

inMemoryAdapter()

A simple in-memory adapter for testing and development. Data is not persisted.

import { inMemoryAdapter } from '@youcraft/recall'

const memory = createMemory({
  db: inMemoryAdapter(),
  // ...
})

Creating Custom Adapters

Implement the DatabaseAdapter interface:

interface DatabaseAdapter {
  insert(memory: Omit<Memory, 'id' | 'createdAt' | 'updatedAt'>): Promise<Memory>
  update(
    id: string,
    data: Partial<Pick<Memory, 'content' | 'embedding' | 'metadata'>>
  ): Promise<Memory>
  delete(id: string): Promise<void>
  get(id: string): Promise<Memory | null>
  list(userId: string): Promise<Memory[]>
  clear(userId: string): Promise<void>
  queryByEmbedding(embedding: number[], userId: string, limit: number): Promise<Memory[]>
}

License

MIT