Save Thread

nowledge-co/community/nowledge-mem-openhands-plugin/skills/save-thread

作者 nowledge-co1f4d7eb61466dbfc93ce8d7a0a806c4d4a196dd0無授權條款收錄於 2026年10月9日更新於 2026年10月9日

Synchronize and persist the active OpenHands conversation session or multi-agent canvas run into Nowledge Mem.

AI 產生的概覽

將進行中的 OpenHands 對話工作階段或多代理畫布執行內容儲存並同步至 Nowledge Mem。

功能
此技能說明如何擷取進行中的 OpenHands 對話工作階段或多代理畫布執行內容,並將其保存到 Nowledge Mem。內容涵蓋自動停止鉤子:在磁碟上找出工作階段事件、擷取並去除重複的提示與動作,再透過 REST 匯入端點同步,並提供 CLI 備援與離線佇列。此外也涵蓋手動工作階段同步指令,以及多代理畫布執行的來源標記設定。
適用情境
適用於使用者明確要求儲存或記錄對話執行緒、需要在代理完成時由自動停止鉤子擷取工作階段,或在長時間背景工作前建立檢查點的情況。
執行需求
需要 OpenHands 及其磁碟上的對話事件、Nowledge Mem OpenHands 外掛,以及對 Nowledge Mem REST API 或 nmem CLI 的存取權。選用環境變數可控制代理識別、空間與自動擷取。此技能未隨附指令碼,僅為說明文件。

Save Thread

Synchronize the active OpenHands conversation session or multi-agent canvas run into Nowledge Mem.

When to Use

  • Explicit user request: "save this conversation", "record this thread in nowledge mem".
  • Automated Stop hook: runs automatically upon agent completion if NMEM_DISABLE_AUTO_CAPTURE is not set.
  • Checkpoint before long-running background tasks.

How Thread Capture Works in OpenHands

OpenHands persists conversation events to disk (events/event-*.json). The Nowledge Mem OpenHands plugin integrates via a Tier-2 native transcript importer:

  1. Automated Stop Hook: When a conversation ends or agent pauses, hooks/nmem-stop.py runs automatically:

    • Locates the active OpenHands session events on disk.
    • Extracts and deduplicates user prompts and assistant actions/observations.
    • Synchronizes directly to Nowledge Mem via high-speed REST API POST /threads/import (with CLI nmem t import fallback and offline queue resilience).
  2. Explicit Session Sync: To manually checkpoint the current session from terminal or canvas:

    bash
    python3 <plugin-dir>/hooks/nmem-stop.py <<<'{"session_id": "<conversation-id>"}'

    Or using the nmem CLI import:

    bash
    nmem t import --id "openhands-<conversation-id>" --title "<title>" --messages '<json>' --source openhands
  3. Multi-Agent Canvas Provenance: When running multiple agents on a canvas, configure NMEM_AGENT_ID and NMEM_SPACE so thread captures preserve individual node provenance across the shared graph.

  4. Multi-Agent Orchestrator Capture Control: When orchestrating multi-agent workflows or child processes, you can control thread capture boundaries. If child tasks or workers capture their own threads, set NMEM_DISABLE_AUTO_CAPTURE=1 in OpenHands to prevent duplicate session captures while keeping MCP memory tools active.

來源與署名

來源:nowledge-co/community位於nowledge-mem-openhands-plugin/skills/save-thread提交1f4d7eb

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架