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

remembra

v0.12.1

Published

TypeScript/JavaScript SDK for Remembra - AI Memory Layer

Readme

Remembra TypeScript SDK

TypeScript/JavaScript SDK for Remembra - the AI Memory Layer.

npm version PyPI version

What's New in v0.12.0

  • 👤 User Profiles — Profile management with avatars and preferences
  • 🧠 Smart Auto-Forgetting — Human-like memory that naturally fades
  • ⏰ Event-driven Expiryexpires_at field for precise lifecycle control
  • 🔒 Strict Mode 410 GONE — Expired memories return proper HTTP 410
  • 🌐 Browser Extension — Access memories from any webpage

Note: The TypeScript SDK is for client-side usage. For AI agent setup (Claude, Codex, Cursor), use the Python package: pip install remembra && remembra-install --all

Installation

npm install remembra
# or
yarn add remembra
# or
pnpm add remembra

Quick Start

import { Remembra } from 'remembra';

// Initialize client
const memory = new Remembra({
  url: 'http://localhost:8787',  // Self-hosted
  apiKey: 'your-api-key',        // Optional for self-hosted
  userId: 'user_123',
});

// Store a memory
const stored = await memory.store('User prefers dark mode and hates long emails');
console.log(stored.extracted_facts);
// ['User prefers dark mode', 'User hates long emails']

// Recall memories
const result = await memory.recall('What are user preferences?');
console.log(result.context);
// 'User prefers dark mode. User hates long emails.'

Conversation Ingestion

Automatically extract memories from conversations:

const result = await memory.ingestConversation([
  { role: 'user', content: 'My wife Suzan and I are planning a trip to Japan' },
  { role: 'assistant', content: 'That sounds exciting! When are you going?' },
  { role: 'user', content: 'We are thinking April next year' },
], {
  minImportance: 0.5,
});

console.log(`Extracted: ${result.stats.facts_extracted} facts`);
console.log(`Stored: ${result.stats.facts_stored} memories`);

// Facts extracted:
// - "User's wife is named Suzan"
// - "User is planning a trip to Japan in April"

API Reference

Constructor

new Remembra(config: RemembraConfig)

| Option | Type | Default | Description | |--------|------|---------|-------------| | url | string | http://localhost:8787 | Remembra server URL | | apiKey | string | - | API key for authentication | | userId | string | required | User ID for memory isolation | | project | string | default | Project namespace | | timeout | number | 30000 | Request timeout (ms) | | debug | boolean | false | Enable debug logging |

Methods

store(content, options?)

Store a new memory.

const result = await memory.store('John is the CEO of Acme Corp', {
  metadata: { source: 'meeting' },
  ttl: '30d',  // Expires in 30 days
});

recall(query, options?)

Recall relevant memories.

const result = await memory.recall('Who is John?', {
  limit: 10,
  threshold: 0.5,
  slim: false,  // Set true for 90% smaller response (context only)
});

console.log(result.context);   // Synthesized context
console.log(result.memories);  // Individual memories (omitted if slim=true)
console.log(result.entities);  // Related entities (omitted if slim=true)

Slim mode (v0.10.1+): For token-constrained environments, use slim: true to get only the context string:

const result = await memory.recall('Who is John?', { slim: true });
// Returns just: { context: "John is the CEO of Acme Corp." }

ingestConversation(messages, options?)

Ingest a conversation and extract memories.

const result = await memory.ingestConversation(messages, {
  sessionId: 'session_123',
  extractFrom: 'both',    // 'user' | 'assistant' | 'both'
  minImportance: 0.5,
  dedupe: true,
  store: true,            // false for dry-run
  infer: true,            // false to store raw messages
});

forget(options)

Delete memories (GDPR-compliant).

// Delete specific memory
await memory.forget({ memoryId: 'mem_123' });

// Delete all about an entity
await memory.forget({ entity: 'John' });

// Delete all user memories
await memory.forget();

get(memoryId)

Get a specific memory by ID.

const mem = await memory.get('mem_123');

health()

Check server health.

const health = await memory.health();

Error Handling

import { 
  RemembraError,
  AuthenticationError,
  RateLimitError,
  ValidationError,
} from 'remembra';

try {
  await memory.store(content);
} catch (error) {
  if (error instanceof AuthenticationError) {
    // Handle auth error
  } else if (error instanceof RateLimitError) {
    // Wait and retry
    console.log(`Retry after ${error.retryAfter} seconds`);
  } else if (error instanceof ValidationError) {
    // Handle validation error
  } else if (error instanceof RemembraError) {
    // Generic Remembra error
    console.log(error.status, error.message);
  }
}

License

MIT