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

@vinhnt-sdk/knowledge

v0.1.2

Published

Memory and knowledge management for VNT Agent — bounded memory, context compression, learning engine

Downloads

677

Readme

@vinhnt-sdk/knowledge

Version: 0.1.2-beta.0 | Status: BETA

Memory and knowledge management for vinhnt-sdk — bounded memory, context compression, learning engine.

Install

# npm
npm install @vinhnt-sdk/knowledge

# pnpm (monorepo)
pnpm add @vinhnt-sdk/knowledge

Quick Start

import { BoundedMemory, ContextCompressor } from '@vinhnt-sdk/knowledge';

// Create memory store
const memory = new BoundedMemory({ maxSize: 100 });

// Store memories
memory.store("User prefers dark mode", { tags: ["preferences"] });
memory.store("User is a developer", { tags: ["user-info"] });

// Search memories
const results = memory.search("dark mode");
console.log(results); // [{ content: "User prefers dark mode", ... }]

// Get context for agent
const context = memory.getContext("user preferences");
console.log(context); // "- User prefers dark mode\n- User is a developer"

API Reference

BoundedMemory

import { BoundedMemory } from '@vinhnt-sdk/knowledge';

const memory = new BoundedMemory({ maxSize: 100 });

// Store memory
const item = memory.store("content", { metadata: { key: "value" }, tags: ["tag1"] });

// Search memories
const results = memory.search("query", { limit: 10 });

// Get all memories
const all = memory.getAll();

// Get memory by ID
const item = memory.getById("mem-123");

// Delete memory
memory.delete("mem-123");

// Get context for agent
const context = memory.getContext("query", { limit: 5 });

ContextCompressor

import { ContextCompressor } from '@vinhnt-sdk/knowledge';

const compressor = new ContextCompressor({ tokenBudget: 32000 });

// Compress conversation
const compressed = await compressor.compress({
  messages: [
    { role: "user", content: "Hello" },
    { role: "assistant", content: "Hi there!" },
    // ... more messages
  ],
});

console.log(compressed.messages); // Compressed messages
console.log(compressed.tokens);   // Token count

MemoryItem

interface MemoryItem {
  id: string;
  content: string;
  metadata?: Record<string, unknown>;
  tags?: string[];
  createdAt: Date;
  updatedAt: Date;
}

Dependencies

  • @vinhnt-sdk/schema workspace:*

Peer Dependencies

  • @vinhnt-sdk/tools workspace:* (optional)

Usage Examples

Store User Preferences

import { BoundedMemory } from '@vinhnt-sdk/knowledge';

const memory = new BoundedMemory({ maxSize: 50 });

// Store user preferences
memory.store("User prefers dark mode", { tags: ["preferences", "ui"] });
memory.store("User likes TypeScript", { tags: ["preferences", "language"] });

// Get context for agent
const context = memory.getContext("user preferences");
// Output:
// - User prefers dark mode
// - User likes TypeScript

Compress Long Conversation

import { ContextCompressor } from '@vinhnt-sdk/knowledge';

const compressor = new ContextCompressor({ tokenBudget: 4000 });

const conversation = {
  messages: [
    // ... many messages
  ],
};

const compressed = await compressor.compress(conversation);
console.log(`Reduced from ${conversation.messages.length} to ${compressed.messages.length} messages`);

Search Memories

import { BoundedMemory } from '@vinhnt-sdk/knowledge';

const memory = new BoundedMemory({ maxSize: 100 });

// Store memories
memory.store("TypeScript is awesome");
memory.store("JavaScript is also good");
memory.store("Python is great for ML");

// Search
const results = memory.search("TypeScript");
console.log(results.length); // 1

// Search with tags
const tagged = memory.search("", { tags: ["language"] });
console.log(tagged.length); // 3

License

MIT