@areev/areev

中文文档
1.14.1发布于 2026/11/07MIT OR Apache-2.0TypeScriptCommonJS零依赖构建来源已验证近 30 天下载 2109

Node.js bindings for Areev, the embedded memory engine for AI agents.

原始使用文档

areev-js

Node.js (napi-rs) bindings for Areev, the embedded memory engine for AI agents.

areev-js is the napi-rs native addon that exposes Areev to Node.js, published as @areev/areev — the unscoped areev name is pending an npm similarity-filter exception (npm's spam filter reads it as too close to argv); the scoped package is not a fork, just the current install name. It mirrors the Python binding with the same thin, version-stable FFI convention: scalar arguments in, JSON strings out for anything structured, and errors thrown as JavaScript Errors. Because the underlying engine is native, this is a compiled Node addon rather than WASM. One memory is one file, opened with a namespace, giving JavaScript agents durable add / recall / supersede / forget over content-addressed memory.

const { Areev } = require('@areev/areev')

const mem = new Areev('caller.db', 'caller') // 3rd arg: passphrase for AES-256 at rest
const h = await mem.addFact('john', 'prefers', 'tea', 0.95)
console.log(await mem.recall('john')) // JSON string, newest-first

await mem.setEmbedderCommand('python3 embed.py')   // vector recall via a host command
await mem.migrate('mem0', exportJson, historyJson) // import an existing corpus (docs/migrate.md)
await mem.memoryTool('{"command": "view", "path": "/memories"}') // Anthropic memory-tool backend

Agent packs

Validate and install an agent pack (docs/pack.md) without shipping the areev binary. Both resolve to the pack report as a JSON string; a refusal rejects with an Error whose code is the typed cause (PCK-E001..PCK-E005, or the AUT-*/STO-* code passed through).

const { Areev, packValidate } = require('@areev/areev')

const report = JSON.parse(await packValidate('packs/invoice-to-accounting')) // no memory needed
const tenant = new Areev('tenant.db', 'shared', undefined, undefined, undefined, 'svc:installer')
try {
  const installed = JSON.parse(await tenant.packInstall('packs/invoice-to-accounting', {
    expectedHash: planHash,                 // refuse unless the plan builds to this
    executorPins: { screen: pinnedAddr },   // checked, never written (PCK-E005)
  }))
} catch (e) {
  console.log(e.code) // 'PCK-E002', 'PCK-E005', 'AUT-E001', …
} finally {
  tenant.close()
}

Every method returns a promise

Store calls run on libuv's thread pool, not on the thread running your application. They used to run inline: a single migrate or importBundle held the event loop for its whole duration, so timers, sockets and any HTTP server in the same process stopped until it finished. Measured on a 400-record migrate, a 5 ms timer now fires 263 times during the call; before, it could not fire at all.

Two things follow, and the second is the one that bites:

  • The constructor stays synchronous. Opening a file should fail loudly, at the line that opened it.

  • Await your writes. Promises settle in completion order, not call order, and concurrent calls contend for one lock inside the store. This is a race:

    mem.addFact('john', 'prefers', 'tea')  // not awaited
    const rows = await mem.recall('john')  // may or may not see it
    

    Awaiting the write fixes it. If you want several independent writes to overlap, Promise.all them and await the group.

Errors arrive as rejections, so try/catch around await, or .catch(). An un-awaited call that fails becomes an unhandled rejection, which recent Node versions treat as fatal.

Part of Areev — an embedded memory engine for AI agents. See the architecture overview.

Licensed under MIT OR Apache-2.0.

版本与发布记录

@areev/areev 共发布 47 个版本,首次发布于 2026/08/16;过去 12 个月发布了 47 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.14.1latest2026/11/07今天
1.14.02026/11/052 天前
1.13.22026/10/2315 天前
1.13.12026/10/2316 天前
1.13.02026/10/2018 天前
1.12.22026/10/061 个月前

关于 @areev/areev 的常见问题

@areev/areev 是什么?

Node.js bindings for Areev, the embedded memory engine for AI agents.

如何安装 @areev/areev?

在项目目录运行 npm install @areev/areev,或使用 pnpm add / yarn add / bun add。

@areev/areev 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@areev/areev 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@areev/areev 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >= 18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@areev/areev 可以商用吗?

@areev/areev 使用 MIT OR Apache-2.0 许可。可在 MIT、Apache-2.0 中任选其一遵守。选择 MIT 时,宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@areev/areev 的下载量有多少?

根据 npm 官方下载统计,@areev/areev 在 2026/10/07 – 2026/11/05 这 30 天内被下载 2,109 次,日均约 70 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@areev/areev 还在维护吗?

最新版本 1.14.1 发布于 2026/11/07(今天);至今共发布 47 个版本,其中过去 12 个月发布了 47 个;首次发布于 2026/08/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。