/qwen-mm-plugins-video-memory:qwen-mm-plugins-video-memoryfrom qwen-mm-plugins-video-memory
Builds hierarchical graph memory for long videos (30+ minutes) and enables semantic search. Use when analyzing multi-hour video files or directories.
Ships in qwen-mm-plugins-video-memory. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Check the qwen-mm-plugins-video-memory tools in your tool list for full schemas and parameters.
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:
<video_path>.memory/ directory existsqwen-mm-plugins-video-memory toolsread_video with a narrow start_time/end_time for frame-level visual inspection, because memory is always coarse and maybe inaccurate.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 | 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, ... |
If graph_memory.json is missing, run the builder below. It installs missing Python dependencies,
including pydantic>=2.11,<3:
# 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"
Most questions follow a 2-step pattern:
Choose ONE entry point based on the question type:
| Question Type | Entry Tool | Example |
|---|---|---|
| References a specific time | search_by_time(start_sec, end_sec) | "What happens at 45:30?" |
| Asks about a person/action/event | search_nodes(query) | "What did the chef cook?" |
| Asks about on-screen text/scores | search_ocr_text(query) | "What was the final score?" |
| References a known story segment | get_macro_events(super_id) | "In the first quarter..." |
| Asks about event causality | search_nodes(query) → get_subgraph | "What caused the explosion?" |
Call get_subgraph(macro_id) on the 1-2 most relevant macro_ids from Step 1. This returns ALL detail: entities, events, OCR text, and relations. Answer from this data.
Question arrives
├─ Does the SuperEvent list already narrow it? → get_macro_events(super_id) → get_subgraph
├─ Time reference? → search_by_time → get_subgraph
├─ On-screen text/score? → search_ocr_text → get_subgraph (if needed)
├─ Person/action/event? → search_nodes → get_subgraph
└─ Causal/relational? → search_nodes → get_subgraph (relations are in the subgraph)
get_summary — Video-level root summary.
video_path (optional)get_super_events — List all SuperEvents (high-level narrative arcs).
video_path (optional)get_macro_events — List MacroEvents under a SuperEvent.
super_id (optional), macro_ids (optional list)get_subgraph — Full detail for one MacroEvent. Most information-rich tool.
macro_id (required)search_nodes — Semantic search over Entity and Event nodes (excludes OCR).
query (required), top_k, node_types (["event"], ["entity"], or both)search_ocr_text — Semantic search over on-screen text only.
query (required), top_ksearch_asr_text — Semantic search over ASR transcript text (speech, dialogue, narration).
query (required), top_ksearch_by_time — Find MacroEvents by time range.
start_sec/end_sec (seconds), or start_time/end_time (HH:MM:SS for ordinary videos;
DAY{N} HH:MM:SS for EgoLife). Valid strings override the corresponding seconds.enumerate_events — Enumerate ALL matching event instances in time order — built for COUNTING / "how many times / list every occurrence" questions.
query (required; a descriptive statement of the target event), min_cosine, max_results, node_types (default ["event"]; use ["entity"] for objects/people)min_cosine and alternative phrasingsread_video — Extract frames from the original video after narrowing the time range via memory tools. video_path is in the initial context.
Graph memory is stored next to the video, in <video_path>.memory/ (e.g.
/data/clip.mp4 → /data/clip.mp4.memory/). The server auto-loads it from there
when you pass video_path, or set GRAPH_MEMORY_PATH to point at one explicitly.
Contents: graph_memory.json, embeddings.npz, 01_macros.json, subgraphs/
script/build_memory/build_graph.py (opens in a new tab)script/build_memory/build_memory.sh (opens in a new tab)script/build_memory/embeddings.py (opens in a new tab)script/build_memory/env_config.py (opens in a new tab)script/build_memory/llm_client.py (opens in a new tab)script/build_memory/merge_memories.py (opens in a new tab)script/build_memory/pipeline_worker.py (opens in a new tab)script/build_memory/prompts.py (opens in a new tab)script/build_memory/schema.py (opens in a new tab)script/build_memory/time_utils.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub qwenlm/qwen-mm-plugins --plugin qwen-mm-plugins-video-memoryOther plugins' skills for the same job