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

@kex22/kex-mem

v0.4.1

Published

Local long-term memory CLI tool + Claude Code plugin

Readme

kex-mem

本地长期记忆 CLI 工具,为 AI 编程助手(Claude Code 等)提供跨会话记忆能力。

基于三层记忆架构:

| 层 | 存储 | 用途 | |---|---|---| | Durable | memory/MEMORY.md | 长期决策、约定、架构 | | User | memory/USER.md | 用户偏好和习惯 | | Ephemeral | memory/YYYY-MM-DD.md | 每日工作日志 | | Deep Search | memory/.kex-mem.db | SQLite FTS5 + sqlite-vec 混合搜索 |

Markdown 是数据源,SQLite 只是搜索索引。人类和 AI 都能直接读写。

安装

# 需要 Bun (内置 SQLite)
bun install -g @kex22/kex-mem

快速开始

# 在项目根目录初始化
kex-mem init

# 记录
kex-mem log "选择 Bun 作为运行时" --tag decision
kex-mem log "修复了路径解析的 bug" --tag bug

# 查看近期日志
kex-mem recall            # 今天 + 昨天
kex-mem recall --week     # 最近 7 天
kex-mem recall --durable  # 长期记忆
kex-mem recall --user     # 用户偏好
kex-mem recall --tag decision  # 按 tag 过滤

# 全文搜索
kex-mem search "Bun"
kex-mem search "路径" --limit 20

# TODO 管理
kex-mem todo              # 列出未完成 TODO
kex-mem todo --resolve "substring"  # 标记完成

# 精简上下文(会话启动用)
kex-mem brief             # DURABLE + RECENT + TODO

# 索引
kex-mem index             # 增量索引(默认)
kex-mem index --full      # 全量重建

# 归档旧日志
kex-mem compact           # 预览
kex-mem compact --auto    # 按月归档
kex-mem compact --smart   # 输出结构化 prompt 供 LLM 提炼

标签

| 标签 | 用途 | |---|---| | decision | 技术决策及理由 | | bug | Bug 及修复方式 | | convention | 项目约定和模式 | | todo | 待办和后续跟进 |

Claude Code 集成

kex-mem init 会自动向项目 CLAUDE.md 注入使用说明,Claude Code 加载后即知道如何调用。

同时提供 .claude-plugin/plugin.json,支持:

  • /kex-mem 斜杠命令
  • PostToolUse hook(Write/Edit 后自动单文件索引)

运行 kex-mem init --hooks 自动安装 plugin.json 和 hook 脚本,并生成 .claude/settings.json

  • SessionStart hook → 自动运行 kex-mem brief,注入上下文摘要
  • PreCompact hook → 上下文压缩前注入持久记忆(DURABLE + TODO),确保关键信息不丢失

项目结构

src/
  cli.ts                 # Commander 入口
  commands/              # init, log, search, recall, compact, index, config, todo, brief
  lib/
    paths.ts             # 路径解析
    db.ts                # SQLite FTS5 + sqlite-vec
    markdown.ts          # Markdown 读写
    parser.ts            # 日志条目解析器
    config.ts            # 模板常量
    config-store.ts      # 向量搜索配置
    embedder.ts          # Embedding 接口
tests/                   # 169 个单元测试

开发

bun install
bun run build
bun test

路线图

  • v0.1 — FTS5 全文搜索,6 个核心命令 ✅
  • v0.2 — sqlite-vec 混合搜索 + kex-mem config
  • v0.3 — 增量索引 + PostToolUse hook + USER.md + compact --smart
  • v0.4 — 按需检索(tag/limit)+ TODO 追踪 + brief 上下文摘要 ✅

License

MIT