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

@morris131/opencode-memos

v0.2.0

Published

OpenCode plugin for persistent memory using Memos

Readme

OpenCode Memos Plugin

基于 Memos 的 OpenCode 持久化记忆插件,让 AI 助手具备跨会话记忆能力。

特性

  • 自动记忆召回 - 每次对话自动注入相关记忆上下文
  • 自动记忆捕获 - 每隔 N 轮对话自动保存关键信息
  • 关键词触发 - 检测"记住"、"保存"等关键词触发记忆保存
  • 记忆作用域 - 支持项目级别和用户级别两种记忆范围
  • 隐私保护 - 自动过滤敏感内容,防止私密信息存储
  • 上下文压缩 - 上下文窗口超限时自动压缩历史记忆
  • 多模型支持 - 自动获取模型上下文窗口限制

配置

通过环境变量进行配置:

| 环境变量 | 说明 | 默认值 | | :--- | :--- | :--- | | MEMOS_BASE_URL | Memos 实例地址(必填) | 无 | | MEMOS_ACCESS_TOKEN | Memos 访问令牌(必填) | 无 | | MEMOS_MAX_MEMORIES | 用户级别最大召回记忆数 | 5 | | MEMOS_MAX_PROJECT_MEMORIES | 项目级别最大召回记忆数 | 10 | | MEMOS_TAG_PREFIX | 标签前缀 | opencode | | MEMOS_CAPTURE_EVERY_N_TURNS | 每隔 N 轮自动捕获记忆 | 3 | | MEMOS_COMPACTION_THRESHOLD | 上下文压缩阈值百分比 | 80 |

使用方式

OpenCode 配置

opencode.json 中添加插件:

{
  "plugin": [
    ["@morris131/opencode-memos", {}]
  ]
}

并设置环境变量:

{
  "env": {
    "MEMOS_BASE_URL": "http://localhost:5230",
    "MEMOS_ACCESS_TOKEN": "your_access_token"
  }
}

Memos 实例部署

如果还没有 Memos 实例,可以使用 Docker 快速部署:

docker run -d \
  --name memos \
  -p 5230:5230 \
  -v ~/.memos:/var/opt/memos \
  neosmemo/memos:stable

访问 http://localhost:5230 创建账号,在设置中生成访问令牌。

可用工具

memos

管理存储在 Memos 中的记忆。

模式

| 模式 | 说明 | 参数 | | :--- | :--- | :--- | | add | 存储新记忆 | content, type?, scope? | | search | 搜索记忆 | query, scope? | | list | 列出最近记忆 | scope?, limit? | | forget | 删除记忆 | memoryId, scope? | | help | 显示帮助 | 无 |

作用域

| 作用域 | 说明 | | :--- | :--- | | project | 项目级别记忆(默认),仅当前项目可见 | | user | 用户级别记忆,跨项目可见 |

记忆类型

| 类型 | 说明 | | :--- | :--- | | project-config | 项目配置 | | architecture | 架构决策 | | error-solution | 错误解决方案 | | preference | 用户偏好 | | learned-pattern | 学习到的模式 | | conversation | 对话摘要 |

示例

添加记忆:

{
  "mode": "add",
  "content": "本项目使用 Node.js 构建,不使用 Bun",
  "type": "project-config",
  "scope": "project"
}

搜索记忆:

{
  "mode": "search",
  "query": "构建工具",
  "scope": "project"
}

开发

# 安装依赖
npm install

# 构建
npm run build

# 开发模式(监听文件变化)
npm run dev

# 类型检查
npm run typecheck

许可证

MIT