MAGIC-Video: Structured Memory for Ultra-Long Agentic Video Reasoning

Jiazheng Li, Chi-Hao Wu, Yunze Liu, Kaize Ding, Jundong Li, Chuxu ZhangNeurIPS 2026

TL;DR

Even million-token AI models choke on weeks-long videos because fitting days of footage into a context window requires throwing away almost all the frames. MAGIC-Video solves this without any model training by building a unified, searchable memory out of the video offline—weaving visual clips, captions, and multi-day storylines into one connected web. When you ask a question, an AI agent navigates this web to pull both the exact visual moment and the overarching multi-day plot in a single swoop, beating existing video agents by up to 10 percentage points.

What Problem Does This Paper Address?

Imagine asking a smart assistant, "How did our cake-baking project unfold over the last week, and who handed me the black marker?" Answering this requires sifting through days or weeks of continuous footage—like life-logs, surveillance, or livestreams.

Current multimodal LLMs (MLLMs), even with massive million-token context windows, only have the token budget for tens of minutes of densely sampled video. To process a week of footage, they have to aggressively subsample frames, almost guaranteeing the crucial 5-second clip gets dropped on the cutting room floor.

To get around this, researchers build external "memories" offline and use AI agents to search them. However, existing memory systems stumble in two ways:

  1. Siloed Modalities: They store visual clips, text captions, and entity facts in separate buckets. A query needing both a visual moment and background facts about a person can't activate both in one search step.
  2. Blurry Summaries: They summarize video from the bottom up—chunking 30 seconds into 3 minutes, then into an hour. As the summaries get coarser, specific details evaporate into generic blurbs, losing the thread of multi-day habits or projects.

Methods

MAGIC-Video is a training-free framework split into an offline memory-building phase and an online agentic search loop.

Figure 2: MAGIC-Video pipeline. Offline (left): preprocessing produces multi-granularity captions, named entities, semantic triples, and visual embeddings, from which we build the Multimodal Memory Graph (four node types connected by six typed edges) and the Narrative Memory Chain (topic chains + event chains). Online (right): for each question, an agentic loop seeds cross-modal Personalized PageRank over the graph, injects matching chains, and feeds the merged context to the reasoning backbone, which either refines its search or commits to an answer.

Offline, raw video is processed via speech recognition, visual captioning, and an LLM into two complementary structures:

  • Multimodal Memory Graph (MMG): While standard Graph-RAG systems like HippoRAG only link text, MMG puts visual clips, multi-scale episode captions (30s to 1h), named entities, and semantic triples (subject-verb-object facts) into one heterogeneous graph. Six typed edges connect them—meaning a text mention of "Jake" is directly wired to the visual clip he appears in and the facts associated with him.
  • Narrative Memory Chain (NMC): Instead of just summarizing bottom-up, an LLM scans the whole video top-down to extract two kinds of chronological timelines: Topic chains (biographies of specific entities/objects across days) and Event chains (linked steps of recurring routines or multi-day projects, like baking a cake from shopping on Day 1 to frosting on Day 3).

Online, an LLM controller plays detective for up to 5 search rounds. When it issues a search query, MAGIC-Video runs cross-modal Personalized PageRank (PPR)—an algorithm originally used by Google to rank web pages—seeded simultaneously by caption similarity, keyword matching (BM25), and visual-text similarity. Relevance flows across text and video nodes in one pass. Simultaneously, matching multi-day timelines from the NMC are injected into the results. Once the agent has enough time-ordered evidence, a reasoning backbone generates the final answer.

Datasets

Because MAGIC-Video is training-free, datasets are used strictly for evaluation (no new benchmarks are introduced):

  • EgoLifeQA & Ego-R1 Bench: Both evaluate on 51.9 hours of continuous, 7-day first-person footage from a single subject (A1_JAKE). EgoLifeQA tests 500 multiple-choice questions across entity tracking, habits, and relationships; Ego-R1 tests 50 human- and AI-authored questions.
  • MM-Lifelong (Month split): 105.6 hours of livestream video spanning 51 days, paired with 623 open-ended questions across 11 reasoning categories, graded by an LLM judge.

Key Insights and Ideas

  • Redundancy makes the graph resilient: Removing any single edge type from the graph barely dents accuracy ($\pm 1.8$ points). Because the graph is densely interconnected, Personalized PageRank simply takes a two-hop detour around missing links. It is the unified multimodal topology as a whole—not one magic edge—that drives performance.
  • Garbage captions in, garbage graph out: While tweaking graph edges barely mattered, deleting 25% of the fine-grained 30-second captions dropped accuracy by 4.4 points. The system's ceiling is bounded much more tightly by initial caption quality than by graph engineering.
  • Better memory means fewer, richer searches: Compared to searching modalities separately, MAGIC-Video actually takes slightly fewer agentic search rounds (3.33 vs. 3.49 on EgoLifeQA) while surfacing nearly $4\times$ as many visual frames (51.0 vs. 13.6), because cross-modal PPR naturally pulls visual evidence alongside text on 98% of queries.

Key Results

MAGIC-Video achieves state-of-the-art accuracy across all three ultra-long benchmarks:

  • EgoLifeQA: Reaches 67.6%, beating the strongest prior agentic system (EGAgent with Gemini 2.5 Pro) by +10.1 points and single-shot Gemini 2.5 Pro (fed 3,000 frames) by +20.8 points.
  • Ego-R1: Hits 64.7%, outperforming the WorldMM agent baseline by +7.4 points.
  • MM-Lifelong: Scores 24.5% (under a GPT-5 judge), beating the prior best agent (ReMA-GPT-5) by +5.9 points, while more than doubling long-video MLLMs on Causal Reasoning and Event Recognition.
Cumulative ablation showing how adding the Multimodal Memory Graph (MMG) and Narrative Memory Chain (NMC) steadily boosts performance—and prevents out-of-memory crashes on month-long video.

As the ablation above shows, MMG and NMC are genuinely complementary, adding steady gains on top of each other—and on the 51-day MM-Lifelong split, MMG keeps memory usage in check where separate per-granularity indices crash host RAM (OOM).

Limitations and Future Work

  • Weak on global frame-sweeps: MAGIC-Video trails single-pass models on Counting (7.4 vs. 12.6) and Hallucination Detection (15.9 vs. 25.0) in MM-Lifelong. Multi-round targeted retrieval is great for finding needles in haystacks, but bad at tasks requiring exhaustive, every-frame verification (like counting every time an action occurs over a month or proving something never happened).
  • Context dilution: On open-ended MM-Lifelong questions where both topic and event chains trigger simultaneously, performance slightly dips (-3.4 points), as doubling the injected narrative text can dilute the core query signal.
  • Caption bottleneck: Because downstream nodes rely heavily on the 30-second captions, missed visual nuances during offline preprocessing cannot easily be recovered later. Future directions are not explicitly discussed in the main text.

Summary updated

Abstract

Understanding ultra-long videos such as egocentric recordings, live streams, or surveillance footage spanning days to weeks, remains a challenge. For current multimodal LLMs: even with million-token context windows, frame budgets cover only tens of minutes of densely sampled video, and most evidence is discarded before inference begins. Memory-augmented and agentic approaches help with scale, but their retrieval remains fragmented across modalities and lacks long-range narrative summaries that span days or weeks. We propose MAGIC-Video, a training-free framework built around a multimodal memory graph with interleaved narrative chain: the graph unifies episodic, semantic, and visual content through six typed edges and supports cross-modal retrieval, while the chain distils long-horizon entity biographies and recurring activity events. At inference time, an agentic loop interleaves graph retrieval with narrative fact injection, covering both the modality and time dimensions of ultra-long video in a single retrieval pipeline. On EgoLifeQA, Ego-R1 and MM-Lifelong, MAGIC-Video consistently outperforms strong general-purpose, long-video, and agentic baselines, with gains of 10.1, 7.4, and 5.9 points over the prior best agentic system on each benchmark.
BibTeX
@inproceedings{li2026magic,
  author = {Jiazheng Li and Chi-Hao Wu and Yunze Liu and Kaize Ding and Jundong Li and Chuxu Zhang},
  title = {{MAGIC-Video: Structured Memory for Ultra-Long Agentic Video Reasoning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=0evT0zV3xO},
}
Figure