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

cortico-world-memory

v0.2.7

Published

Cortico World 扩展:五层记忆(事实库/知识库/反思/人格/档案)+ 三级记忆底座 + Hybrid Recall 向量混合检索(移植自 E:/qq_bot 的记忆系统与 memory_server 向量 sidecar,qq_bot 源码零改动)。

Readme

cortico-world-memory

Cortico World 扩展:把 E:/qq_bot 的记忆系统移植成框架内的一格 World。qq_bot 源码零改动。

移植对照

| qq_bot(源) | 本扩展(目标) | 说明 | |---|---|---| | memory.py Memory | src/memory.ts MemoryBase | 三级记忆:短期(cap 环形)/摘要/话题 + JSON 防抖落盘 + overflow 取半;user:{id} 统一键改为调用方 scope(默认 main) | | vector_memory.py | src/vector-store.ts VectorStore | Hybrid Recall = BM25(CJK 2/3-gram,仅 query 建 DF)+ Cosine(预归一化点积)+ RRF(k=60);矩阵按 scope 缓存、版本号失效;存储同款 base64(fp16) JSON,可与 E:/qq_bot/vector_memory.json 互导 | | memory_server.py(sidecar) | src/embedding.ts EmbeddingClient | 「重负载外置 + 掉线降级」同一语义:sidecar 模式直接 POST qq_bot memory_server 的 /call 调 vector_memory.generate_embedding;另有 http(OpenAI 兼容 /embeddings)与 off(纯 BM25);任一失败自动降级 BM25 | | memory_context.py | src/observe.ts + src/ENV_PROMPT.md | 记忆上下文注入:走 envPrompt 插值(要点/摘要/话题常驻前缀)+ 周期 memory.context 事件。周期事件只在内容变化时推,且推新的会撤回上一条未投递的快照(等价源版「原位替换」),避免 piggyback 在总线里堆几十份重复长文 | | important_notes.py(存取部分) | MemoryBase.addNote/removeNote + mem_note 工具 | 重要信息常驻进提示词,条数上限 notesInPrompt |

工具(人格可调用)

mem_remember / mem_recall / mem_recent / mem_overflow / mem_summary / mem_topic / mem_note / mem_notes / mem_forget_note / mem_stats / mem_flush / mem_export / mem_import

导出与迁入共用 cortico-memory-export 规范(src/migrate.ts),.json 与 .sqlite 同源可互换:mem_export 支持 json/markdown/sqlite(both=json+md,all=三者),mem_import 默认 merge(按 scope/userId 合并去重),可选 replace。

部署

  1. 包放到 Cortico/extensions/node_modules/cortico-world-memory/;
  2. extensions/package.json 的 dependencies 加 "cortico-world-memory": "link:./node_modules/cortico-world-memory";
  3. 部署 config.json 加 worlds.memory.enabled = true(或控制台激活);
  4. 整机重启(POST /api/run/restart)才加载新扩展包。

数据落在部署 data/ 下:memory-data.json、vector-memory.json(均 gitignored)。

对接 qq_bot 向量 sidecar(可选)

不改 qq_bot 一行:在 E:/qq_bot 正常启动 python memory_server.py(默认 127.0.0.1:8766), 部署里设 worlds.memory.embeddingProvider = "sidecar" 即可复用它的 all-MiniLM-L6-v2 向量; sidecar 不在线时本扩展自动只用 BM25,永不停摆。