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

@thriveventurelabs/memoryos-sdk

v0.1.0

Published

Official SDK for MemoryOS - Persistent semantic memory for AI applications

Readme

@memory-os/sdk

Official SDK for MemoryOS - Persistent semantic memory for AI applications.

Installation

npm install @memory-os/sdk

Quick Start

import { MemoryOS } from '@memory-os/sdk';

const memory = new MemoryOS({ apiKey: 'mos_live_xxx' });

// Store a memory
await memory.store({
  content: 'User mentioned they prefer morning meetings',
  tier: 'long',
  importance: 0.8
});

// Semantic search
const results = await memory.search('meeting preferences');
console.log(results.results);

// Get context for LLM prompts
const { context } = await memory.getContext('What time does the user prefer meetings?');
console.log(context);

API Reference

Constructor

const memory = new MemoryOS({
  apiKey: 'mos_live_xxx',     // Required
  baseUrl: 'https://...',     // Optional, for self-hosted
  timeout: 30000              // Optional, request timeout in ms
});

Memory Operations

store(input) - Store a new memory

const memory = await client.store({
  content: 'The user likes TypeScript',
  tier: 'long',        // 'short' | 'medium' | 'long'
  importance: 0.9,     // 0-1
  metadata: { source: 'chat' }
});

get(id) - Get a memory by ID

const memory = await client.get('memory-uuid');

update(id, input) - Update a memory

await client.update('memory-uuid', {
  importance: 1.0,
  metadata: { verified: true }
});

delete(id) - Delete a memory

await client.delete('memory-uuid');

list(options?) - List memories

const { data, meta } = await client.list({
  limit: 50,
  offset: 0,
  tier: 'long',
  sort_by: 'created_at',
  sort_order: 'desc'
});

Search Operations

search(query, options?) - Semantic search

const results = await client.search('user preferences', {
  threshold: 0.3,  // Similarity threshold (default: 0.3)
  limit: 10,       // Max results
  tier: 'long'     // Filter by tier
});

results.results.forEach(r => {
  console.log(r.content, r.similarity);
});

getContext(query, options?) - Get LLM context

const { context, memories, token_count } = await client.getContext(
  'What are the user preferences?',
  { maxTokens: 2000 }
);

// Use in your LLM prompt
const prompt = `Context:\n${context}\n\nQuestion: ${userQuestion}`;

Utility Operations

getUsage() - Get usage statistics

const stats = await client.getUsage();
console.log(stats.memories.total);

health() - Check API health

const { status, latency_ms } = await client.health();

Memory Tiers

| Tier | Duration | Use Case | |------|----------|----------| | short | Hours | Session context, temporary notes | | medium | Days | Recent interactions, short-term preferences | | long | Permanent | Core facts, important preferences |

Error Handling

import { MemoryOS, MemoryOSError } from '@memory-os/sdk';

try {
  await memory.store({ content: 'test' });
} catch (error) {
  if (error instanceof MemoryOSError) {
    console.error(error.code);      // 'UNAUTHORIZED', 'RATE_LIMITED', etc.
    console.error(error.message);   // Human-readable message
    console.error(error.requestId); // For debugging
  }
}

TypeScript

Full TypeScript support with exported types:

import type {
  Memory,
  CreateMemoryInput,
  SearchResult,
  ContextResponse,
  MemoryTier
} from '@memory-os/sdk';

License

MIT