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:
- Check if
<video_path>.memory/directory exists - Memory exists → query it using the
qwen-mm-plugins-video-memorytools - Memory does not exist → build it first (see "Building Graph Memory" section), then query
- After locating a specific segment via memory tools, you MUST use
read_videowith a narrowstart_time/end_timefor 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
| Level | Contains | IDs |
|---|---|---|
| Root | Title, description, themes, key entities, emotional tone | — |
| SuperEvent | High-level narrative arc, time range, key entities | super_01, super_02, ... |
| MacroEvent | Specific event segment with time range, summary, key entities | macro_0001, macro_0002, ... |
| Subgraph | Entity 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"