一键导入
memory-extraction-pipeline
Automated pipeline that processes chat messages to extract memories, facts, and vocabulary
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Automated pipeline that processes chat messages to extract memories, facts, and vocabulary
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Communicate with peer agents and spawn subagents in the NOVA agent ecosystem. Use when you need to delegate work to another agent, message a peer (Graybeard, Newhart), spawn a subagent (Coder, Scribe, Gidget, etc.), or determine how to reach a specific agent. Covers agent identification, peer messaging via agent_chat, subagent spawning with correct model/thinking config, and domain-based routing.
Review recent activity and extract institutional knowledge back into system artifacts. Captures missing workflow steps, implementation details into SKILL.md files, tool notes into TOOLS.md, and process lessons into memory. Trigger on: "introspect", "review what we did", "capture learnings", "update workflows from recent work", "what did we miss", "refine our processes", or after completing a significant multi-step task.
Communicate with peer agents and spawn subagents in the NOVA agent ecosystem. Use when you need to delegate work to another agent, message a peer (Graybeard, Newhart), spawn a subagent (Coder, Scribe, Gidget, etc.), or determine how to reach a specific agent. Covers agent identification, peer messaging via agent_chat, subagent spawning with correct model/thinking config, and domain-based routing.
Implement semantic search over agent memory using vector embeddings. Use when building AI memory systems, enabling meaning-based recall, or setting up proactive context retrieval. Covers PostgreSQL pgvector, OpenAI embeddings, and memory search patterns.
Manage a private Certificate Authority for mTLS authentication. Use when creating CA infrastructure, signing client certificates, configuring nginx for mutual TLS, or managing certificate lifecycle. Covers OpenSSL CA operations, CSR signing, and certificate verification.
| name | memory-extraction-pipeline |
| description | Automated pipeline that processes chat messages to extract memories, facts, and vocabulary |
Updated (nova-mind#485 documentation audit): This file described the pre-#174 shell pipeline (
process-input.sh→extract-memories.sh→store-memories.sh, orchestrated bymemory-catchup.shon everymessage.receivedevent). That pipeline was consolidated into a single Python script,memory/scripts/extract_memories.py, as part of the #174 grammar-parser removal. None ofextract-memories.sh,store-memories.sh, orprocess-input.shexist inmemory/scripts/anymore, andmemory-catchup.shis a separate cron-driven session-transcript ingestion path, not the real-time extraction trigger. This revision documents the current pipeline. Seememory/docs/memory-extraction-pipeline.mdfor the full guide (setup, troubleshooting, failure-handling/dead-letter path added in #485).
Runs via the memory-extract OpenClaw hook, which fires on message.received events —
not via memory-catchup.sh and not via cron. memory-catchup.sh is a separate,
cron-driven path that ingests session JSONL transcripts into channel_sessions/
channel_transcripts; it does not perform real-time per-message extraction (its
attempt to also invoke a legacy process-input.sh for message-level re-extraction is a
known-broken code path — see memory/docs/memory-extraction-pipeline.md's top-of-file
note).
memory/hooks/memory-extract/handler.ts — hook entry point; spawns the extraction
process per message, resolves channel_transcripts/channel_sessions FK pointers,
captures stderr/stdout tails, enforces a timeout, and writes to extraction_failures
on failure (#485)memory/scripts/extract_memories.py — single Python script that calls the Claude API
to parse a message into structured JSON (facts, entities, events, vocabulary) in one
pass; replaces the old three-script shell chainmemory/scripts/dedup_helper.py — deduplication / reinforcement logicmemory/scripts/extraction-replay.sh — replays dead-lettered failures from
extraction_failures (#485)psql — database operationsReal-time extraction context resolution happens per-message via the hook's own context
passing — there is no separate cache file for this path. (memory-catchup.sh
separately maintains its own rolling cache at ~/.openclaw/memory-message-cache.json
for its transcript-ingestion path; that cache is unrelated to real-time extraction.)
Both user and assistant messages are processed:
This captures both what the user said/decided/prefers and what the agent did/updated/created.
Instead of deduplication, matching data reinforces existing knowledge:
Schema (entity_facts):
extraction_count INTEGER — incremented on each re-extraction/reinforcementlast_confirmed_at TIMESTAMPTZ — tracks recency of confirmationdurability VARCHAR(20) — permanent, long_term, short_term, ephemeralcategory TEXT — free-form (e.g., identity, preference, observation)visibility VARCHAR(20) — public, trusted, privateSource attribution lives in entity_fact_sources (one row per fact-source pair), not a
single column on entity_facts.
dedup_helper.py performs fuzzy matching on entity+key+value to find an existing fact
and reinforce it (increment extraction_count, update last_confirmed_at) rather than
inserting a duplicate.
memory-extract hook fires on message.receivedchannel_sessions + channel_transcripts FK pointers if not
already present in the event contextextract_memories.py via stdin (never as a shell argument), passing
sender/session metadata as environment variables (SENDER_NAME, SENDER_ID,
IS_GROUP, SOURCE_SESSION_ID, SOURCE_TIMESTAMP, SOURCE_CHANNEL_TRANSCRIPT_ID,
SOURCE_CHANNEL_SESSION_ID)extract_memories.py calls the Claude API once to extract facts, entities, events,
and vocabulary, and writes directly to PostgreSQL (via dedup_helper.py for
reinforcement logic)extraction_failures instead of losing the
message (#485) — see memory/docs/memory-extraction-pipeline.md for the full
failure-handling section and the extraction-replay.sh recovery pathextract_memories.py's current output
contract before relying on this)Per extract_memories.py's current extraction template (see the script for the
authoritative/up-to-date list):
subject, key, value,
category, durability, confidence, visibility (covers what used to be split
across separate facts/opinions/preferences categories, disambiguated via category)entity_fact_sources, not a single source_person columnvisibility field (public/trusted/private) on entity_factsmemory/ARCHITECTURE.md's Entity Facts Access Control section
for the current (as of this writing) enforcement gap