Documentation menu

Video Memory

Build searchable, hierarchical memory of long videos to summarize content and locate events, text, and dialogue.

Token estimates

Skill instructions
About 2,085 tokens
Tool definitions
About 2,819 tokens

Estimated text size—not usage or cost.

SKILL.md
Permalink

Long-Video Memory

Check the qwen-mm-plugins-video-memory tools in your tool list for full schemas and parameters.

ROUTING RULE — Read This First

When a user asks about a video that is longer than 30 minutes, you MUST use this skill instead of read_video. read_video cannot meaningfully cover a multi-hour video — it samples too few frames once, which is ineffective and always misses important content. You MUST build memory first, then you can fast explore the whole long video with the help of your pre-built memory.

Workflow:

  1. Check if <video_path>.memory/ directory exists
  2. Memory exists → query it using the qwen-mm-plugins-video-memory tools
  3. Memory does not exist → build it first (see "Building Graph Memory" section), then query
  4. After locating a specific segment via memory tools, you MUST use read_video with a narrow start_time/end_time for frame-level visual inspection, because memory is always coarse and maybe inaccurate.

Hierarchical Graph Memory

The memory is a 4-level tree. You start broad (Root/SuperEvent) and drill down to find specifics:

Root (1 per video)
  └─ SuperEvent (10-20 story arcs)
       └─ MacroEvent (3-8 per SuperEvent, each ~3-8 min)
            └─ Subgraph (entities, events, OCR text, relations)

Level Details

LevelContainsIDs
RootTitle, description, themes, key entities, emotional tone
SuperEventHigh-level narrative arc, time range, key entitiessuper_01, super_02, ...
MacroEventSpecific event segment with time range, summary, key entitiesmacro_0001, macro_0002, ...
SubgraphEntity nodes (PERSON/OBJECT/LOCATION), Event nodes (timestamped actions), OCR text (on-screen text), and Edges (SEMANTIC/CAUSAL/TEMPORAL/HIERARCHICAL/SPATIAL/IDENTITY relations)macro_0001:ent_001, ...

Building Graph Memory

If graph_memory.json doesn't exist for a video, build it:

# Build memory for a single video (output: <video_path>.memory/)
bash script/build_memory/build_memory.sh /path/to/video.mp4

# Build with custom options
bash script/build_memory/build_memory.sh /path/to/video.mp4 \
    --output-dir /path/to/output --model qwen3.7-plus --api-key "$DASHSCOPE_API_KEY"

Expand folders to explore bundled references, scripts, and assets. Files open at this page’s source snapshot.