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

fawn-memory

v0.0.10

Published

TypeScript toolkit for extracting structured knowledge from text and querying it with natural language. Built on TypeChat, with an in-memory semantic index and a simple REPL for exploration.

Downloads

714

Readme

fawn-memory

TypeScript toolkit for extracting structured knowledge from text and querying it with natural language. Built on TypeChat, with an in-memory semantic index and a simple REPL for exploration.

Features

  • Extract entities, actions, and topics from messages
  • Build an in-memory semantic reference index
  • Query with natural language or explicit term sets
  • Load pre-extracted knowledge from a file
  • Export index data for visualization

Install

npm install fawn-memory

Quickstart (library)

import {
  createConversation,
  createMessage,
  createInMemoryStorageProvider
} from "fawn-memory";

const storage = createInMemoryStorageProvider();
const messages = storage.createMessageCollection();

const conversation = await createConversation(messages, "demo", storage);

await conversation.addMessageAsync(
  createMessage("I bought apples and bananas today.", [])
);

const answer = await conversation.query("What did I buy?");
console.log(answer);

REPL mode

Run the entrypoint directly to use the interactive shell:

pnpm dev

Commands inside the REPL:

  • @load <path>: load a knowledge file into the index
  • @loadindex <path>: load a pre-built index JSON file
  • @export [path]: export index data to JSON (default: fawn-index-export.json)
  • @lemmatize: add lemmatized forms to the index
  • @related [weight] [maxTerms]: expand index with LLM-generated related terms
  • @wordnet [weight] [maxTerms]: expand index with WordNet synonyms
  • @entity <term>: print entities matching a term
  • @action <term>: print actions matching a term
  • @topic [term]: print topics matching a term (omit term to print all topics)
  • @term <term1> <term2> ...: query by explicit terms
  • exit or quit: leave the REPL

There is a sample knowledge file at data/1984ParagraphOutput.txt.

Examples

Memory Service

A web-based memory service with REST API and chat UI.

cd examples/memory
pnpm install
pnpm run dev

Open http://localhost:3000/chat for the interactive UI.

Index Visualizer

Interactive tool for exploring semantic indexes with a relationship graph.

cd tools/index-visualizer
pnpm install
pnpm run dev

Open http://localhost:3001 to load and visualize index data.

Environment

Configure your LLM provider via environment variables:

# Provider selection (default: 'openai')
LLM_PROVIDER=openai   # or 'claude'

# API keys (set the one for your chosen provider)
OPENAI_API_KEY=sk-...        # For OpenAI (also supports legacy OPENAI_SDK_KEY)
ANTHROPIC_API_KEY=sk-ant-... # For Claude

# Optional: Override default model
LLM_MODEL=gpt-4-turbo

dotenv is enabled, so a local .env file works too.

Scripts

  • pnpm dev: run the REPL entrypoint with tsx
  • pnpm lint: run ESLint
  • pnpm build: emit ESM + type declarations to dist/
  • pnpm clean: remove the dist/ directory

Development notes

prepublishOnly runs a clean rebuild (pnpm run clean && pnpm run build).