Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@withone/mem

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@withone/mem

Memory for AI agents. Simple, fast, works anywhere.

latest
Source
npmnpm
Version
0.2.4
Version published
Maintainers
1
Created
Source

Mem

Memory for AI agents. Simple, fast, works anywhere.

https://mem.now

Quick Start

npm install @withone/mem
mem init

The init wizard will:

  • Configure your Supabase connection
  • Apply the database schema
  • Create CLAUDE.md with instructions
  • Install skills for Claude Code

Usage

# Add memories
mem add note '{"content": "Meeting notes from today"}'
mem add decision '{"topic": "API Design", "content": "Using REST because...", "weight": 9}'
mem add preference '{"content": "Prefers TypeScript", "weight": 8}'

# Search (semantic + keyword)
mem search "API design"
mem search "meeting" -t note

# Get context at session start
mem context
mem context -n 10 -t decision,preference

# Manage relevance
mem weight <id> 9      # Set importance (1-10)
mem archive <id>       # Exclude from context
mem flush <id>         # Reset access count

# Link memories
mem link <id1> related_to <id2> --bi    # Bidirectional
mem link <new> supersedes <old>          # Directional

How It Works

Two tables:

  • mem_records - All memories (flexible JSON)
  • mem_links - Relationships between memories

Relevance scoring:

  • Weight (40%) - Explicit importance you set
  • Access (30%) - How often it's retrieved
  • Recency (30%) - When it was last accessed

High-weight items always surface. Frequently used items rise. Old unused items fade.

Hybrid search:

  • Semantic similarity (70%) - Finds conceptually related content
  • Keyword matching (30%) - Finds exact terms

Requirements

  • Node.js 18+
  • Supabase project (free tier works)
  • OpenAI API key (optional, for semantic search)

TypeScript API

import { add, search, context, link } from '@withone/mem';

// Add a memory
const record = await add('decision', {
  topic: 'Database',
  content: 'Using Supabase because...',
}, { weight: 9 });

// Search
const results = await search('database decision');

// Get startup context
const relevant = await context({ limit: 20 });

// Link memories
await link(id1, id2, 'related_to', { bidirectional: true });

License

MIT

Keywords

ai

FAQs

Package last updated on 28 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts