@aliyunpolar/polarmemory-shared
v2.1.0
Published
Shared core for PolarDB-PG memory management clients: REST client, memory types, recall formatting, capture sanitisation.
Downloads
30
Maintainers
Readme
@aliyunpolar/polarmemory-shared
Shared core modules for PolarDB-PG memory management access layers.
Install
npm install @aliyunpolar/polarmemory-sharedTypically consumed as a workspace dependency by
@aliyunpolar/polarmemory(CLI) andpolarmemory_openclaw(OpenClaw plugin). Direct installation is only needed if you are building a custom access layer.
What's in here
| Module | Purpose |
|---|---|
| http.ts | Token-authenticated HTTP client for the polarmemory REST API |
| memory-api.ts | Server contract: /v1/memories, /v2/memories/search, /v2/memories/list, /v1/ping, /v1/db_info |
| recall.ts | <recalled-memories> injection block formatting with anti-injection preamble and tag-escape sanitisation |
| circuit.ts | File-based circuit breaker — 60s cooldown on connection errors, cross-agent same-baseUrl sharing |
| fingerprint.ts | SHA-256 turn fingerprinting + file-based dedup state for capture hooks |
| sanitize.ts | Capture-side sanitisation: wrapper-strip (prevents recall→memory reflux), noise filtering, generic-reply detection |
| kb.ts | Knowledge base provider interface (types only; not implemented in this release) |
What's NOT in here
- Agent-specific logic (hooks, setup, config files, SKILL)
- OpenClaw plugin SDK shapes
- CLI commands or user-facing output
- Any hardcoded server endpoints or credentials
Relationship to consumer packages
@aliyunpolar/polarmemory-shared (this package)
▲ ▲
│ │
@aliyunpolar/polarmemory polarmemory_openclaw
(CLI + hooks) (OpenClaw plugin)Both consumers import types, API functions, and sanitisation rules from this single source of truth. Neither may redefine REST paths, auth format, or payload shapes independently.
License
Apache-2.0
