返回顶部
m

memory-harness

Runtime-enforced memory harness for OpenClaw. Implements 3-stage recall (session preflight, triggered recall, pre-execution gate) with intent classification, entity detection, memory compression, and status tracking. This harness runs automatically at the right times - NOT relying on SKILL.md text alone.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
205
下载量
0
收藏
概述
安装方式
版本历史

memory-harness

# Memory Harness A reliable memory harness that makes byterover recall happen at the right times without running heavy recall on every turn. ## Architecture ``` user_input -> intent classification -> session preflight (if new session) -> conditional targeted recall -> planning -> pre-execution recall gate (if execution-like) -> execution or response -> optional writeback ``` ## 3-Stage Harness ### Stage 1: Session Preflight Runs ONLY at the start of a new session. Fetches: - active project - pinned facts - unresolved items - recent important entities - recent session summary Does NOT fetch: - full raw history - large raw memory dumps - low-signal old notes Output: compact `session_digest` (hard capped) ### Stage 2: Triggered Recall Runs targeted byterover recall only when needed. **Trigger conditions:** - Continuation words: 続き, 前回, 再開, 引き継ぎ, continue, resume, previous work - Known entity/project name: ClawHub, OpenClaw, Agent-OS, BOSS-memory-loop, etc. - Task requires user-specific/project-specific context - Implementation / modification / design / planning request - Ambiguous task likely depending on prior context **Skip conditions:** - Generic factual Q&A - Small self-contained questions - Casual short exchange - Clearly answerable without prior context **Recall modes:** - `preflight_query`: start-of-session only - `entity_query`: when named entities detected - `continuation_query`: for previous-session continuation - `constraint_query`: when advice depends on prior rules - `pre_execution_query`: immediately before execution ### Stage 3: Pre-Execution Recall Gate MANDATORY before: - file edits - code generation - architecture proposals - configuration changes - planning depending on prior project state - any meaningful change suggestion Checks for: - prior constraints - unresolved issues - conflicting past decisions - project-specific conventions - safety-sensitive context ## Memory Shaping Never inject raw byterover results directly. Pipeline: 1. retrieve 2. rank 3. dedupe 4. compress 5. inject bounded digest **Hard limits:** - max_memory_items: 5 - max_digest_lines: 8 - prefer recent + high-signal + tagged items ## Status Tracking Every recall records one of: - `not_needed` - `queried_no_hits` - `queried_low_confidence` - `queried_success` - `query_failed` ## Scripts ### intent-classifier.js Classifies turn intent as one of: - `generic_qa` - `casual` - `continuation` - `entity_reference` - `user_specific_context` - `implementation_request` - `design_request` - `execution_request` ### entity-detector.js Detects known entities in user input: - Scans for known entity/project names - Maps aliases to canonical names - Returns matched entities for recall routing ### session-preflight.sh Runs lightweight recall at session start: - Fetches pinned facts, active project, unresolved items - Creates compact session_digest - Hard capped length ### targeted-recall.sh Runs targeted recall based on intent: - Takes intent, entities, session state - Chooses appropriate recall mode - Returns compressed digest ### pre-execution-gate.sh Runs before execution-like actions: - Checks for constraints, conflicts, safety issues - Returns go/no-go with relevant context ### memory-compress.js Compresses and dedupes raw memory: - Ranks by relevance and recency - Dedupes repeated items - Hard caps output size ### writeback.sh Writes high-signal info back to memory: - Only for important decisions/outcomes - Skips trivial chat and low-value text ## Configuration ```json { "memory_policy": { "preflight_on_session_start": true, "preflight_depth": "light", "pre_execution_recall": true, "max_memory_items": 5, "max_digest_lines": 8, "trigger_query_if": [ "mentions_known_project", "asks_to_continue_previous_work", "requires_user_specific_context", "requests_code_design_or_change", "contains_known_entity" ], "skip_query_if": [ "generic_qa", "casual_chat", "self_contained_question" ] } } ``` ## Logging Structured logs for observability: - `turn_id` - `session_id` - `intent` - `recall_trigger` - `recall_mode` - `recall_status` - `recall_item_count` - `injected_item_count` - `pre_execution_gate` - `elapsed_ms` ## Known Entities Default entity list (expandable): - ClawHub - OpenClaw - Agent-OS - BOSS-memory-loop - ByteRover - MISO - Obsidian - Telegram ## Continuation Triggers Japanese: 続き, 前回, 再開, 引き継ぎ, 前の, さっきの English: continue, resume, previous, earlier, last time, back to ## Success Criteria - Reliable recall when turn depends on context - Generic turns stay lightweight - Execution actions always get constraint check - Behavior inspectable in logs - No reliance on SKILL.md text alone

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 memory-harness-1776380822 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 memory-harness-1776380822 技能

通过命令行安装

skillhub install memory-harness-1776380822

下载 Zip 包

⬇ 下载 memory-harness v1.0.0

文件大小: 12.04 KB | 发布时间: 2026-4-17 15:22

v1.0.0 最新 2026-4-17 15:22
Initial release of memory-harness: a runtime-enforced, staged recall system for OpenClaw.

- Implements 3-stage recall: session preflight, triggered recall, and pre-execution recall gate.
- Includes intent classification, entity detection, memory compression, and status tracking.
- Recall is automatically triggered based on user intent and entity references, keeping chat lightweight unless contextual memory is needed.
- Enforces recall before all execution-like actions to ensure constraints and context are respected.
- Outputs are always compressed, ranked, and deduplicated, with hard caps on memory injected.
- Provides structured logs for monitoring recall behavior and outcomes.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部