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

@vlaushkin/mempalace-ts

v1.1.0

Published

Give your AI a memory — mine projects and conversations into a searchable palace. No API key required.

Readme

MemPalace.ts

TypeScript rewrite of MemPalace (Python v3.0.14).

Local AI memory system for Claude Code, ChatGPT, and any MCP-compatible tool.


What's different from Python

| | Python (v3.0.14) | TypeScript | |---|---|---| | Vector DB | ChromaDB (subprocess, ~500ms startup) | sqlite-vec (in-process, ~15ms startup) | | Embedding context | 256 tokens max | 512 tokens max (sees more context) | | Localization | English only | EN, RU, DE, FR, ES with auto-detect | | Cross-lingual search | N/A | 50+ languages via optional multilingual model | | Metadata | Schema-less dict | Fixed columns + extra JSON (nothing lost) | | LLM rerank | Haiku only (not public) | Any OpenAI-compatible API (Ollama, OpenAI, Groq...) | | Hooks | Python shell scripts | Native Node.js (same hooks protocol) | | Dependencies | Python + chromadb + sentence-transformers | Node.js only | | Migration | — | mempalace migrate (ChromaDB → sqlite-vec) | | Tests | 92 | 402 |

LongMemEval benchmark (500 questions, M2 Ultra)

| Mode | Python | TypeScript | |------|--------|------------| | Raw (zero API) | 96.6% R@5 | 96.0% R@5 | | Hybrid (keyword re-rank) | — | 98.2% R@5 | | + LLM rerank | 100% (Haiku) | TBD (any model) |

The 0.6% raw difference is due to 512 vs 256 token embedding context — TS sees more text per session, which helps in general but slightly dilutes 3/500 edge cases. Hybrid mode compensates entirely.

Quick Start

npm install @vlaushkin/mempalace-ts

mempalace init ~/projects/myapp
mempalace mine ~/projects/myapp
mempalace search "why did we switch to GraphQL"
mempalace search "auth flow" --rerank gemma4:e4b    # optional LLM rerank

MCP Server

claude mcp add mempalace -- node dist/mcp/server.js

19 tools: mempalace_search, mempalace_add_drawer, mempalace_kg_query, mempalace_diary_write, and 15 more.

Search supports optional LLM reranking:

mempalace_search({ query: "auth flow", rerank_model: "gemma4:e4b" })

LLM Reranker

Works with any OpenAI-compatible API:

# Ollama (local, free)
mempalace search "query" --rerank gemma4:e4b

# OpenAI
MEMPALACE_RERANK_URL=https://api.openai.com/v1 \
MEMPALACE_RERANK_KEY=sk-... \
mempalace search "query" --rerank gpt-4o-mini

# Env-based config
export MEMPALACE_RERANK_URL=http://localhost:11434/v1
export MEMPALACE_RERANK_MODEL=gemma4:e4b
mempalace search "query" --rerank

Without --rerank, search works exactly as before (pure semantic).

Auto-Save Hooks

{
  "hooks": {
    "Stop": [{ "hooks": [{ "type": "command", "command": "node /path/to/dist/hooks/index.js stop" }] }],
    "PreCompact": [{ "hooks": [{ "type": "command", "command": "node /path/to/dist/hooks/index.js precompact" }] }]
  }
}

Every 15 messages → auto-save. Before context compression → emergency save.

Localization

Auto-detects language per document. Built-in: EN, RU, DE, FR, ES.

AAAK compression, memory extraction, emotion/flag detection, sentiment analysis — all locale-aware. Custom locales via registerLocale().

Multilingual Search

Enable cross-lingual search across 50+ languages:

// ~/.mempalace/config.json
{ "multilingual": true }

Uses a dual-index architecture — both all-MiniLM-L6-v2 (English, 87 MB) and paraphrase-multilingual-MiniLM-L12-v2 (50+ languages, ~470 MB) run in parallel:

  • Mining writes embeddings to both indexes in one transaction
  • Search auto-detects query language and picks the right index
  • English queries use the original fast English model
  • Non-English queries (Cyrillic, umlauts, accents, CJK, etc.) use the multilingual model

Cross-lingual similarity examples (multilingual model):

EN "machine learning"  <->  RU "машинное обучение"    → 0.95
EN "git hooks setup"   <->  DE "git hooks einrichten" → 0.91
EN "hello world"       <->  FR "bonjour le monde"     → 0.81

The multilingual model is downloaded automatically on first use (~470 MB, one-time). Without "multilingual": true, everything works exactly as before.

All Commands

mempalace init <dir>                    # detect rooms, create config
mempalace mine <dir>                    # mine project files (respects .gitignore)
mempalace mine <dir> --mode convos      # mine conversation exports
mempalace search "query"                # semantic search
mempalace search "query" --rerank       # search + LLM rerank
mempalace wake-up                       # load L0 + L1 context (~170 tokens)
mempalace compress --wing myapp         # AAAK compression
mempalace split <dir>                   # split mega-files into sessions
mempalace repair                        # rebuild vector index
mempalace status                        # palace overview
mempalace migrate export/import/verify  # ChromaDB → sqlite-vec

Development

npm install
npm run build          # tsup → dist/
npm run test           # vitest (402 tests)
npm run lint           # biome check
npm run typecheck      # tsc --noEmit

# Benchmarks
npx tsx benchmarks/longmemeval.ts data/longmemeval_s_cleaned.json
npx tsx benchmarks/longmemeval.ts data/longmemeval_s_cleaned.json --mode hybrid
npx tsx benchmarks/longmemeval.ts data/longmemeval_s_cleaned.json --rerank gemma4:e4b

License

MIT — see LICENSE.