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 🙏

© 2025 – Pkg Stats / Ryan Hefner

memvault-sdk-jakops88

v1.1.4

Published

Official SDK for the Long Term Memory API.

Downloads

1,334

Readme

MemVault SDK

A lightweight Node.js client for the MemVault Memory API.

MemVault solves the "context window" problem for AI agents. Instead of sending the entire conversation history to the LLM (which is expensive and slow), this SDK allows you to store facts and retrieve only the most relevant context using Hybrid Search.

Why use this?

Building RAG (Retrieval-Augmented Generation) pipelines usually involves setting up a Vector Database (Pinecone/Weaviate), writing embedding logic, and managing chunking.

MemVault abstracts this into a single API call.

  • Hybrid Search 2.0: Combines Vector Similarity (pgvector) with BM25 Keyword Search and Recency Decay. This ensures the agent finds exact matches (like user IDs) as well as semantic concepts.
  • Infrastructure-less: No need to manage Docker containers or Postgres clusters if you use the managed endpoint.
  • Universal: Works with LangChain, Vercel AI SDK, and standard OpenAI/Anthropic implementations.

Installation

npm install memvault-sdk-jakops88

Quick Start

You can use this SDK with either the Managed API (RapidAPI) or a Self-Hosted instance.

1. Initialize the Client

import { MemVault } from 'memvault-sdk-jakops88';

// Option A: Managed API (Production/Easiest)
// Get your key at: [https://rapidapi.com/jakops88/api/long-term-memory-api](https://rapidapi.com/jakops88/api/long-term-memory-api)
const memory = new MemVault({
  apiKey: "YOUR_RAPID_API_KEY",
  baseUrl: "[https://long-term-memory-api.p.rapidapi.com](https://long-term-memory-api.p.rapidapi.com)"
});

// Option B: Self-Hosted (Local Development)
// If running the Docker container locally
const memory = new MemVault({
  baseUrl: "http://localhost:3000"
});

2. Store a Memory

The API automatically handles text normalization, tokenization, and embedding generation (via OpenAI or local Ollama depending on your server config).

await memory.store({
  sessionId: "user_123",
  text: "The user is a TypeScript developer and prefers dark mode.",
  importanceHint: "high" // Optional: 'low', 'medium', 'high'
});

3. Retrieve Context

This performs a Hybrid Search. It ranks memories based on:

  1. Vector Score: Semantic meaning.
  2. Keyword Score (BM25): Exact word matches.
  3. Recency: How long ago the memory was created.
const context = await memory.retrieve({
  sessionId: "user_123",
  query: "What are the user's preferences?",
  limit: 3
});

console.log(context.results);
// Returns an array of text chunks to inject into your LLM prompt.

Hosting Options

Managed API (Recommended for Production)

For production apps where uptime and maintenance matter, use the managed service via RapidAPI. It includes scaling, security, and guaranteed availability.

Self-Hosting

MemVault is open source. You can run the backend on your own infrastructure using Docker and PostgreSQL.

License

MIT