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

@self-evolving-harness/kivo

v0.5.5

Published

KIVO — Agent 知识迭代引擎

Readme

KIVO

让 AI Agent 拥有不会遗忘、持续进化的知识系统。


你的 Agent 是不是也这样?

每次新对话,Agent 都像失忆了一样。上周讨论过的决策、踩过的坑、定好的规则——全忘了。你反复投喂同样的信息,Agent 反复犯同样的错。知识散落在聊天记录、配置文件和临时笔记里,没人整理,没人维护,更没人主动去补盲区。

KIVO 改变这一切。

KIVO 做了什么

  • 自动沉淀:对话、文档、规则中的知识被自动提取和结构化,不需要你手动整理
  • 随用随取:Agent 执行任务时,相关知识自动注入上下文,不再从零开始
  • 冲突自愈:新旧知识矛盾时自动检测并解决,知识库始终保持一致
  • 主动补盲:Agent 发现知识缺口后自主发起调研,填补盲区
  • 规则同步:系统规则变更后按订阅关系推送给相关 Agent,不遗漏

30 秒跑起来

npm install @self-evolving-harness/kivo
npx kivo init --yes
npx kivo health

直接在命令行验证核心路径(复制粘贴即可运行):

node --input-type=module -e "
import { Kivo } from '@self-evolving-harness/kivo';

const kivo = new Kivo({ dbPath: './kivo.db', mode: 'standalone' });
await kivo.init();

// 写入一条知识
const result = await kivo.ingest('TypeScript 为 JavaScript 添加了静态类型系统。', 'quick-start');
console.log('写入条目数:', result.entries.length);

// 语义检索
const results = await kivo.query('TypeScript');
console.log('检索结果:', results.map(r => r.entry.content));

await kivo.shutdown();
"

在项目代码中使用(TypeScript):

import { Kivo } from '@self-evolving-harness/kivo';

const kivo = new Kivo({ dbPath: './kivo.db', mode: 'standalone' });
await kivo.init();

// 写入一条知识
await kivo.ingest('TypeScript 为 JavaScript 添加了静态类型系统。', 'quick-start');

// 语义检索
const results = await kivo.query('TypeScript');
console.log(results.map(r => r.entry.title));

await kivo.shutdown();

验证安装:

npx kivo health
npx kivo config-check

谁在用、怎么用

独立产品操盘者

用 Agent 推进产品研发和运营。需要 Agent 记住历史决策和经验教训,不在同一个坑上反复踩;需要 Agent 能自主调研行业动态,不依赖手动投喂。

Agent 开发者

构建和维护 Agent 系统。需要统一的知识管理接口,让不同 Agent 共享知识而不互相污染;需要规则分发机制,确保系统规则变更能及时传达到所有相关 Agent。

系统管理员

负责 Agent 集群的知识治理。需要知道知识库的健康状态——有多少盲区、多少过时条目、多少冲突待解决。

三种使用方式

standalone:最短路径

适合本地脚本、单机验证、测试环境。上面的「30 秒跑起来」就是这种模式。

环境变量配置(可选):

export KIVO_DB_PATH=./kivo.db
export KIVO_MODE=standalone
export KIVO_CONFLICT_THRESHOLD=0.85

host-embedded:嵌入宿主应用

适合把 KIVO 接进已有 Agent、编排器或聊天系统。

git clone https://github.com/yuchangxu1989-Openclaw/self-evolving-harness.git
cd self-evolving-harness/projects/kivo
npm install && npm run build
import { Kivo, OpenClawAdapter, EventBus } from '@self-evolving-harness/kivo';

const kivo = new Kivo({ dbPath: './embedded-kivo.db', mode: 'hosted' });
await kivo.init();

const adapter = new OpenClawAdapter({
  kivo,
  injector: kivo.createContextInjector(),
  eventBus: new EventBus(),
});

// 对话知识自动提取入库
await adapter.onSessionMessage(
  '状态报告应包含结论、行动项、证据和下一步计划。',
  { sessionId: 'sess-001', agentId: 'main' },
);

// 按 token 预算注入相关知识
const context = await adapter.injectContext('状态报告格式', 800);

await kivo.shutdown();

full-stack:Core + Web 驾驶舱

适合团队通过浏览器查看知识库、搜索条目、查看活动流和仪表盘指标。

# 先构建 Core(同 host-embedded)
cd self-evolving-harness/projects/kivo
npm install && npm run build

# 启动 Web
cd web
npm install
export AUTH_PASSWORD='your-password'
npm run dev

打开浏览器访问 http://localhost:3000/kivo/dashboard

核心能力一览

| 能力 | 说明 | |------|------| | 对话知识提取 | 从 Agent 对话中自动识别事实、方法论、决策、经验、意图、元认知 | | 文档知识提取 | 支持 Markdown、PDF、网页正文,保留原文溯源 | | 规则提取与分发 | 从治理文件中提取规则,按订阅关系推送给相关 Agent | | 语义检索 | 基于语义相似度检索,支持按类型、时间、来源过滤 | | 知识版本管理 | 每条知识条目可追溯历史版本,状态流转清晰 | | 冲突检测与解决 | 语义冲突和规则冲突自动检测,支持时间优先、来源优先、人工裁决 | | 知识过期清理 | 基于时间衰减和引用频率自动标记过时知识 | | 缺口检测 | 基于查询未命中和关联结构缺失识别知识盲区 | | 自主调研 | 发现缺口后自动生成调研任务,调研结果入库形成闭环 | | 网页抓取 | WebFetchAdapter 用原生 fetch 抓取 URL 提取正文,无需额外依赖 | | 上下文注入 | Agent 处理请求时自动注入相关知识,按 token 预算裁剪 | | 意图消歧 | 利用历史知识辅助消解用户意图歧义 | | Web 驾驶舱 | 仪表盘、知识浏览、冲突管理、调研队列、活动流 | | 访问控制 | 域级知识隔离,不同 Agent 访问不同知识域 |

配置参考

| 环境变量 | 说明 | 默认值 | |----------|------|--------| | KIVO_DB_PATH | 数据库路径 | ./kivo.db | | KIVO_MODE | 运行模式 | standalone | | KIVO_CONFLICT_THRESHOLD | 冲突检测阈值 | 0.85 | | KIVO_EMBEDDING_PROVIDER | 向量化提供商 | — | | KIVO_EMBEDDING_API_KEY | 向量化 API Key | — | | KIVO_EMBEDDING_MODEL | 向量化模型 | — | | AUTH_PASSWORD | Web 登录密码 | — |

不配置 embedding 也能运行,语义检索会退化为关键词检索。

运行要求

  • Node.js >= 20
  • SQLite(通过 better-sqlite3,安装时自动编译)

常用命令

npx kivo health          # 健康检查
npx kivo init --yes      # 初始化配置
npx kivo config-check    # 验证配置
npx kivo env             # 查看环境变量
npx kivo capabilities    # 查看可用能力

文档

已知依赖漏洞

Web 驾驶舱使用 [email protected](14.x 最新 patch),存在以下已知漏洞:

| 依赖 | 严重程度 | 说明 | |------|----------|------| | next ≥9.3.4 | high | DoS(Image Optimizer)、HTTP 请求走私(rewrites)、磁盘缓存无限增长、Server Components DoS | | postcss <8.5.10 | moderate | CSS Stringify 输出中的 XSS |

修复需升级到 next@16(breaking change),当前暂不升级。生产部署建议:

  • 禁用或限制 next/image 远程模式
  • 在反向代理层过滤异常请求
  • 限制磁盘缓存目录大小

许可证

MIT License。商业使用和衍生作品须保留原作者署名([email protected])。

详见 LICENSE