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

@saluca/asphodel

v0.1.0

Published

Simple local-first memory storage — integer IDs, topic-word index, SQLite + Postgres

Readme

Asphodel

Simple local-first memory storage for AI agents. Integer IDs, topic-word index, SQLite and Postgres support.

import { Asphodel, SQLiteAdapter } from '@saluca/asphodel'

const db = new Asphodel(new SQLiteAdapter())
await db.init()

await db.remember("user prefers dark mode", { topics: ["preferences", "ui"] })
const results = await db.recall("preferences")

Install

npm install @saluca/asphodel

For Postgres support, also install the peer dependency:

npm install pg

Adapters

SQLite (default)

import { Asphodel, SQLiteAdapter } from '@saluca/asphodel'

const db = new Asphodel(new SQLiteAdapter())
// or specify a path:
const db = new Asphodel(new SQLiteAdapter('/path/to/memory.db'))
// or via env: ASPHODEL_DB

Postgres

import { Asphodel, PostgresAdapter } from '@saluca/asphodel'

const db = new Asphodel(new PostgresAdapter('postgresql://user:pass@host/db'))
// or via env: ASPHODEL_DATABASE_URL

API

remember(content, options?)

Store a memory. Topics are extracted automatically or provided explicitly.

const memory = await db.remember("the API key rotates every 90 days")
// auto-extracted topics: ["api", "key", "rotates"]

const memory = await db.remember("user prefers dark mode", {
  topics: ["preferences", "ui"]
})

recall(topic, options?)

Retrieve memories by topic word. Returns most recent first.

const memories = await db.recall("preferences")
const memories = await db.recall("preferences", { limit: 5 })

search(query, options?)

Full-text search across memory content.

const memories = await db.search("API key rotation")

forget(id)

Delete a memory by ID.

await db.forget(42)

list(limit?, offset?)

Page through all memories, most recent first.

const page = await db.list(20, 0)

close()

Release the database connection.

await db.close()

Configuration

const db = new Asphodel(adapter, {
  maxTopicsPerMemory: 10,     // max topic words per memory (default: 10)
  maxMemoriesPerTopic: 10,    // max memories per topic word (default: 10)

  // plug in your own AI topic extractor
  extractTopics: async (content) => {
    const response = await openai.chat.completions.create({ ... })
    return response.choices[0].message.content.split(',').map(t => t.trim())
  }
})

When maxMemoriesPerTopic is reached, the oldest memory for that topic is evicted automatically.

Schema

Two tables:

memories (
  id         INTEGER PRIMARY KEY AUTOINCREMENT,
  content    TEXT NOT NULL,
  topics     TEXT NOT NULL,  -- JSON array
  created_at TEXT NOT NULL
)

topic_index (
  word      TEXT NOT NULL,
  memory_id INTEGER NOT NULL,
  PRIMARY KEY (word, memory_id)
)

No hashes. No UUIDs. No proprietary formats.

Custom Adapter

Implement the Adapter interface to bring your own storage backend:

import type { Adapter, Memory } from '@saluca/asphodel'

class MyAdapter implements Adapter {
  async init(): Promise<void> { ... }
  async insert(content: string, topics: string[]): Promise<number> { ... }
  async recall(topic: string, limit: number): Promise<Memory[]> { ... }
  async search(query: string, limit: number): Promise<Memory[]> { ... }
  async forget(id: number): Promise<boolean> { ... }
  async list(limit: number, offset: number): Promise<Memory[]> { ... }
  async close(): Promise<void> { ... }
}

License

Apache 2.0 — see LICENSE.

Enterprise features (hash-chained audit trails, multi-tenant isolation, compliance controls) are available at asphodel.ai.