Save Thread

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

by nowledge-co1f4d7eb61466dbfc93ce8d7a0a806c4d4a196dd0No licenseListed Oct 9, 2026Updated Oct 9, 2026

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

Instructions onlyProductivity & Workflow
AI-generated overview

Saves and syncs an active OpenHands conversation session or multi-agent canvas run into Nowledge Mem.

What it does
This skill describes how to capture an active OpenHands conversation session or multi-agent canvas run and persist it into Nowledge Mem. It covers an automated stop hook that locates session events on disk, extracts and deduplicates prompts and actions, and syncs them through a REST import endpoint with a CLI fallback and offline queue. It also covers manual session sync commands and provenance settings for multi-agent canvas runs.
When to use it
Use it when a user explicitly asks to save or record a conversation thread, when an automated stop hook should capture a session on agent completion, or when checkpointing before long-running background tasks.
Requirements
Requires OpenHands with its on-disk conversation events, the Nowledge Mem OpenHands plugin, and access to the Nowledge Mem REST API or the nmem CLI. Optional environment variables control agent identity, space, and automatic capture. No scripts ship with this skill; it is instructions only.

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.

Source and attribution

Source:nowledge-co/communityinnowledge-mem-openhands-plugin/skills/save-threadat commit1f4d7eb

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal