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

codex-qa-memory

v0.1.1

Published

Local-first Codex QA diary and memory toolkit: session-to-diary logger, structured memory nodes, PowerShell CLI, and Codex skills for recall and evidence lookup.

Readme

Codex QA Memory · 永不失忆的 AI 长期记忆外挂

给 Codex 一个不会随着窗口关闭而消失、随时可以回溯的本地记忆库。

换窗口、跨项目、过一周、过一年。之前定过的规则、说过的话、个人偏好和踩过的坑,不用重新解释,问一句就能以更轻量、更准确的方式找回来。

  • 🧠 永不失忆:完整 QA 日记和结构化记忆要点双层保存
  • 先快后准:先查小记忆,需要原话时再精准取证
  • 🔐 有据可查:每条记忆保留时间、来源和证据位置

它解决了什么问题

长期记忆会受到多种不确定因素影响,存在误判和错误引导风险。AI 一换窗口又很容易失忆;如果直接把整段旧对话重新塞进上下文,一旦找错内容,就容易引发幻觉和误判。不仅慢、费 Token,还可能挤爆上下文。

Codex QA Memory 不走大而全的路线。它把记忆分成两层:

  • 记忆前门:保存短小、结构化、能快速召回的记忆节点。
  • 证据室:保存完整 QA 日记。需要原话、日期或会话编号时,再根据准确位置精准取证。

平时问“你还记得吗”,先走记忆前门,尽量减少 Token 消耗;只有需要证明时,才打开证据室,以较小的上下文完成更精准的记忆召回。


为什么它真的轻

  • 不需要数据库。
  • 不需要向量库。
  • 不需要云端记忆服务。
  • 核心数据就是本地 Markdown 和 JSONL 文件,能看、能迁移、能审查。
  • 默认只把当前任务需要的少量记忆交给 Codex,不把整本日记重新塞进上下文。

它不是靠堆组件解决问题,而是用最短的路径,把真正有用的记忆找回来。


两个 Skill,各管一件事

  • codex-qa-memory:负责自然回忆、长期偏好、规则、失败经验、项目历史和候选记忆审查。
  • codex-qa-diary-recall:负责原话、日期、Session ID、Thread ID 和原始日记证据。

你可以直接这样说:

  • 你还记得我们之前怎么处理这个问题吗?
  • 查一下以前关于这个项目的决定。
  • 找出当时的日期和证据位置。
  • 我要当时的原话和 Session 编号。

它是怎么工作的

  1. 日志记录器把 Codex 会话持续整理成按日期归档的 QA 日记。
  2. 记忆维护脚本从日记索引中生成可审查的候选记忆节点。
  3. 日常回忆先查小节点,快速恢复偏好、规则、决定和失败经验。
  4. 需要原始证据时,再根据来源指针窄查对应日记或会话。

完整记录不会因为生成了小节点就被丢掉。小节点负责快,原始日记负责准。


记忆不会偷偷变成规则

所有长期记忆分成三种状态:

  • candidate(候选):自动整理出来的线索,默认不生效。
  • soft-active(软生效):低风险、来源完整、范围明确,只作参考。
  • active(长期有效):经过人工复核或用户明确确认后才能提升。

当前用户指令和当前项目文件永远优先。旧记忆不能盖过现在的事实。


三档召回预算

  • quick:最多 6 个节点,目标字符预算 1200。适合新窗口和轻量恢复。
  • project:最多 15 个节点,目标字符预算 3000。适合继续项目和恢复边界。
  • deep:最多 40 个节点,目标字符预算 8000。适合冲突审查和方案复盘。

够回答就停,不无限扩大上下文。


默认保护隐私

常见的 key、token、cookie、Authorization、密码和私密配置,会在持久化前替换成脱敏标记;记忆校验还会再做一次敏感内容扫描。

仓库和发布包不包含任何用户的真实日记、会话、记忆节点、账号文件或凭据。


最快安装方式

把这个仓库交给 Codex,让它完成下面三件事即可:

  1. codex-qa-memorycodex-qa-diary-recall 复制到 Codex Skills 目录。
  2. 首次安装时,把 qa-memory-template 初始化为本机 QA Memory 目录。
  3. 先执行一次只读试运行,确认范围后再开始写入本地日记。

需要手动安装时,只保留这几条命令:

git clone https://github.com/haoyun18881-beep/codex-qa-memory.git
cd codex-qa-memory
$env:PYTHONPATH="$PWD\qa-logger\src"
python -m qa_logger scan-sessions --dry-run
python -m qa_logger scan-sessions

默认读取 %USERPROFILE%\.codex\sessions,写入 %USERPROFILE%\.codex\qa-diary;结构化记忆默认位于 %USERPROFILE%\.codex\qa-memory


Windows 后台维护(可选)

仓库附带隐藏后台监视、周期恢复和健康检查。安装后,系统可以持续整理新增会话,并在后台任务中断时自动恢复。

powershell -ExecutionPolicy Bypass -File .\scripts\install_codex_qa_diary_watcher_task.ps1

这套后台任务只负责记录、检查和恢复,不会把候选记忆自动提升成长期规则。


开发者验证

npm run test:python
npm run memory:validate
npm pack --dry-run

包里故意不放什么

  • 真实 QA 日记和记忆节点
  • 原始会话和存档会话
  • 向量索引、数据库、监视器日志和心跳文件
  • token、cookie、API key、账户文件或私有导出

License

BUSL-1.1,详见 LICENSE


Codex QA Memory:记住你说过的,不瞎编你没说的。