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-adapter-sqlite

v0.2.0-alpha.0

Published

SQLite database adapter for Recall. Store AI memories locally with zero configuration using better-sqlite3.

Readme

@youcraft/recall-adapter-sqlite

SQLite database adapter for @youcraft/recall. Provides persistent storage for memories using SQLite with better-sqlite3.

Installation

pnpm add @youcraft/recall-adapter-sqlite

Usage

import { createMemory } from '@youcraft/recall'
import { sqliteAdapter } from '@youcraft/recall-adapter-sqlite'
import { openaiEmbeddings } from '@youcraft/recall-embeddings-openai'
import { openaiExtractor } from '@youcraft/recall-extractor-openai'

const memory = createMemory({
  db: sqliteAdapter({ filename: 'memories.db' }),
  embeddings: openaiEmbeddings({ apiKey: process.env.OPENAI_API_KEY! }),
  extractor: openaiExtractor({ apiKey: process.env.OPENAI_API_KEY! }),
})

Configuration

sqliteAdapter({
  filename: 'memories.db', // Path to SQLite database file (default: 'recall.db')
})

Options

| Option | Type | Default | Description | | ---------- | -------- | ------------- | ----------------------------------------------------------------------------- | | filename | string | 'recall.db' | Path to the SQLite database file. Use ':memory:' for an in-memory database. |

Database Schema

The adapter automatically creates the following schema:

CREATE TABLE memories (
  id TEXT PRIMARY KEY,
  user_id TEXT NOT NULL,
  content TEXT NOT NULL,
  embedding TEXT NOT NULL,  -- JSON array of floats
  metadata TEXT NOT NULL DEFAULT '{}',
  created_at TEXT NOT NULL,
  updated_at TEXT NOT NULL
);

CREATE INDEX idx_memories_user_id ON memories(user_id);

Vector Search

This adapter performs vector similarity search in JavaScript using cosine similarity. For each query:

  1. All memories for the user are loaded from SQLite
  2. Cosine similarity is calculated between the query embedding and each memory
  3. Results are sorted by similarity and limited

For production workloads with large memory stores, consider using a dedicated vector database adapter (coming soon: pgvector, Pinecone).

WAL Mode

The adapter enables SQLite's Write-Ahead Logging (WAL) mode for better concurrent read/write performance:

PRAGMA journal_mode = WAL

Example: Custom Database Path

// Store in a specific directory
sqliteAdapter({ filename: '/var/data/app/memories.db' })

// In-memory database (for testing)
sqliteAdapter({ filename: ':memory:' })

// Relative path
sqliteAdapter({ filename: './data/memories.db' })

License

MIT