360 Secure SkillHub
360 安全技能中心

memory-referee

Node 实现的记忆治理 CLI/库,接收结构化记忆记录数组,执行去重、命名别名冲突消解、事实/目标/推测分类、过期归档、Schema 校验与矛盾检测,并保留来源信息,输出 Markdown 裁定报告和结构化 JSON。仓库含 TypeScript 源码与单元测试。

honouralexwill
honouralexwill
热度 43.33
最近更新 2026-05-11 17:37:03
分类:知识依赖:代码执行应用场景:数据处理 / 工作流 / 笔记整理 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add memory-referee
Metadata
name
memory-referee
version
1.0.0
description
Memory hygiene and adjudication layer for OpenClaw agent workflows. Deduplicates entities, resolves naming conflicts, separates facts from goals from speculation, archives stale records, enforces consistent schemas, detects contradictions, and preserves provenance. Complements ontology and Proactive Agent.
author
Saturnday
tags
["memory","hygiene","adjudication","deduplication","provenance"]
inputs
{"raw_records":{"type":"array","description":"Array of raw memory records to adjudicate","required":true}}
outputs
{"report":{"type":"string","description":"Markdown adjudication report summarising all decisions"},"result":{"type":"object","description":"Structured JSON output with deduplicated, classified, and validated records"}}
runtime
node

memory-referee

ontology and Proactive Agent give agents the ability to remember more. memory-referee is designed to work alongside skills like ontology and Proactive Agent to give that memory a cleaner foundation to stand on — deduplicating entities, resolving naming conflicts, separating facts from goals from speculation, archiving stale records, and enforcing consistent schemas.


Built with Saturnday — AI-specific governance for AI-generated code.

While governing the build of memory-referee, Saturnday caught the kinds of mistakes AI coders routinely ship: .env patterns that could expose API keys, deduplication logic that could silently drop memory records, fake tests that passed while verifying almost nothing, and runtime validation gaps that would let malformed records corrupt downstream decisions.

That is the difference between AI-generated code and governed AI-generated code. www.saturnday.dev


When to Use

Invoke this skill whenever an agent's memory store may have accumulated:

  • Duplicate or near-duplicate records that should be collapsed into a single canonical entry
  • Naming conflicts where the same entity appears under multiple aliases
  • Mixed classification — facts, goals, and speculation interleaved without clear labelling
  • Stale records that have aged past their useful window and should be archived
  • Schema drift — records that no longer conform to the expected structure
  • Contradictions — two records that assert incompatible facts about the same entity

Use it after running ontology or Proactive Agent to clean up accumulated memory before passing it downstream.

Inputs

Each record in raw_records must be a JSON object with the following fields:

Field Type Required Description
id string yes Unique identifier for the record
kind string yes One of fact, goal, or speculation
entity string yes The entity this record is about
content string yes The record's content
timestamp string yes ISO 8601 date string
provenance object yes Single provenance object: { sourceId, sourceLabel, capturedAt }. The skill wraps this internally into an array to support merged records with multiple sources.
tags string[] no Optional tags

Outputs

Field Type Description
report string Markdown adjudication report summarising all decisions
result object Structured JSON with deduplicated, classified, validated records

Usage

CLI

echo '[{"id":"r1","kind":"fact","entity":"Alice","content":"Alice prefers dark mode","timestamp":"2026-03-27T00:00:00Z","provenance":{"sourceId":"s1","sourceLabel":"pref-log","capturedAt":"2026-03-27T00:00:00Z"}}]' | node dist/index.js

Library

import { main } from 'memory-referee';

const records = [
  {
    id: 'r1',
    kind: 'fact',
    entity: 'Alice',
    content: 'Alice prefers dark mode',
    timestamp: '2026-03-27T00:00:00Z',
    provenance: { sourceId: 's1', sourceLabel: 'pref-log', capturedAt: '2026-03-27T00:00:00Z' }
  }
];

const { markdown, json, report } = main(JSON.stringify(records));

console.log(markdown);  // human-readable adjudication report
console.log(json);      // structured JSON output