VideoJSON: Agentic Code Search over Minute-Level JSON Memory for Ultra-Long Video
Summary:VideoJSON replaces a complex, fixed retrieval pipeline with a deliberately simple external memory: during indexing, a vision-language model converts every minute of video into a JSON record containing a dense caption and fields for events, entities, places, and speech. At query time, a coding agent writes Python or Bash programs in a sandbox to filter, link, and inspect those records across multiple steps. The paper reports gains of 7.0, 20.0, and 24.75 points over MAGIC-Video on EgoLifeQA, Ego
Core Claim
VideoJSON does not extend the context window, add another specialized retrieval model, or build an elaborate video knowledge graph. Instead, it converts ultra-long video into one JSON record per minute and lets a coding agent write its own search programs at query time. The paper's central argument is that answering questions over days or weeks of video depends less on precomputed relational structure than on giving the agent a simple, programmable, auditable external-memory interface.
The method separates indexing from querying. During indexing, a vision-language model transforms each minute into structured fields. During querying, a coding agent generates Python or Bash programs that filter, link, inspect, and iteratively refine the records. The reported ablations attribute most of the gains to the structured records and agentic code search, while hourly summaries, additional tools, and raw-video access each change the average score by less than 1.5 points.
Mechanism: Replacing a Memory Graph with Minute-Level JSON
1. Indexing: Convert Video into Queryable Data
For each one-minute segment, VideoJSON asks a vision-language model to produce a JSON record containing a dense caption and structured fields for events, entities, places, and speech transcripts. A video lasting H hours therefore produces approximately 60H records.
Rather than committing to a fixed graph of entities and relations, the method keeps a relatively stable record schema. At query time, the agent can inspect the schema and samples, then combine predicates such as whether a person, event, and location occur together or whether a transcript aligns with a visual event inside a particular time range.
Indexing cost is moved from every question to one preprocessing pass. This makes sense when the same collection is queried repeatedly, including follow-up questions or cross-video analysis. For a one-off query, however, exhaustively converting every minute into JSON may be more expensive than directly processing the relevant portion of the raw video.
2. Querying: Turn Retrieval into a Programmable Search
A conventional vector retriever usually returns a fixed Top-K list, while a memory graph depends on precomputed edges and entity alignment. VideoJSON takes a more direct route: the coding agent writes Python or Bash inside a sandbox to filter records, connect evidence across time, inspect individual entries, and revise its search after observing intermediate results.
A typical query proceeds as follows:
- Inspect the JSON fields and a small number of sample records.
- Generate filtering and linking logic for the question.
- Execute the program to narrow the candidate set.
- Read more detailed records and revise the initial hypothesis.
- Produce the answer with supporting temporal evidence.
The search program effectively acts as the query planner, retriever, and part of the analyzer. Unlike fixed Top-K retrieval, code search can express conjunctions, disjunctions, time windows, entity co-occurrence, and relationships among records. It also leaves an auditable execution trace showing what was filtered, skipped, or opened.
3. Why a Simpler Structure Can Work Better
A sophisticated memory graph requires entity disambiguation, edge typing, graph traversal, and node alignment. An upstream extraction error can propagate through those links. VideoJSON postpones relationship construction until the question is known, allowing the agent to create temporary associations for the current task. It trades some precomputation for greater task-specific flexibility.
JSON also provides a direct data interface for code. The agent is not restricted to whatever candidates a vector database returns; it can change scan ranges, read order, and field combinations. The reported results across policy models suggest that stronger reasoners exploit this programmable search space more effectively, with the gap between the strongest and weakest policy models reaching 11.58 points for VideoJSON versus at most 5.50 points for MAGIC-Video.
Engineering Trade-offs: Simplicity Does Not Mean Free
| Dimension | Potential benefit | Cost or risk | | --- | --- | --- | | Indexing | Amortizes multimodal processing across repeated queries | Every minute requires VLM inference; full indexing can be slow and expensive | | Storage | Stable fields are easy to export, inspect, and connect to code agents | JSON is usually more verbose than embeddings or short summaries; unindexed filters may scan the full table | | Querying | Supports compound predicates, temporal filters, and cross-record joins | Multiple model-planning rounds and sandbox execution usually cost more than one vector lookup | | Temporal granularity | Minute-level records suit events, people, places, and topics | Brief actions, expressions, or fast-moving objects may be lost in dense captions | | Reliability | Explicit fields support evidence tracing and temporal localization | VLM omissions, false associations, and transcription errors become structured memory errors | | Security | Raw video need not remain continuously exposed during querying | Python and Bash execution requires network, filesystem, CPU, memory, and time isolation | | Maintainability | Avoids immediate investment in a complex graph database | Schema, indexer, and prompt versions still require governance for reproducible historical answers |
Indexing scales linearly with video duration in minutes. If the agent directly scans JSONL, a query may access O(N) records, where N equals 60H. Inverted or columnar indexes can reduce common entity and time filters toward O(log N + k), but arbitrary agent-generated programs will not necessarily use those optimizations. End-to-end latency depends on planning rounds, tokens per model call, container startup, and record access rather than a single ANN lookup.
The finding that raw-video access contributes less than 1.5 points applies to the tested benchmarks. It does not show that original frames are unnecessary for fine-grained spatial reasoning, transient actions, or ambiguous visual evidence. A production system can therefore treat JSON as the primary retrieval layer while retaining raw-video pointers for fallback queries.
Benchmark Results: Strong Reported Gains, Limited Public Detail
The abstract reports the following results:
| Comparison or experiment | Reported result | | --- | --- | | MAGIC-Video on EgoLifeQA | +7.0 points | | MAGIC-Video on Ego-R1-Bench | +20.0 points | | MAGIC-Video on MM-Lifelong Week | +24.75 points | | Best prior EgoMemReason result | +12.6 points, with the corresponding benchmark not specified in the abstract | | Four policy models of different capability | The strongest-to-weakest average gap reaches 11.58 points for VideoJSON, versus at most 5.50 points for MAGIC-Video | | Fine-tuning Qwen-3.5-Flash on 64 trajectories | Up to +8.25 points on MM-Lifelong |
The 64 trajectories came from an unrelated 100-hour livestream, suggesting strong data efficiency. The sample remains small, however, and an 8.25-point maximum gain may partly reflect adaptation to answer formatting or tool-call conventions rather than fully transferable long-video retrieval.
Several evaluation details are missing. The abstract provides relative gains but not absolute accuracy, says that four benchmarks were used without giving complete results for all four, and does not disclose variance, statistical significance, indexing-model configuration, policy-model budgets, maximum tool-call rounds, token consumption, or end-to-end latency. A fair reproduction must hold the video evidence, context limit, answer budget, and post-processing pipeline constant across methods.
Code is also only promised for release after publication. External teams cannot yet inspect the JSON schema, sandbox restrictions, evaluation scripts, or baseline configurations. The figures should therefore be treated as author-reported results rather than independently reproduced findings.
Developer and Deployment Guidance
- Reproduce the minimal JSONL design first. Store a unique record ID, start and end time, dense caption, events, entities, places, transcript, and evidence provenance. Validate whether this simple representation already beats vector Top-K before introducing a graph database.
- Index the fields that agents query repeatedly. Entity, place, event type, and time-range fields suit inverted or columnar indexes. Free-text fields can use vector retrieval, while controlled raw scans remain useful for long-tail cases.
- Constrain code execution. Containers should deny network access, mount data read-only, and enforce CPU, memory, runtime, file-size, and output limits. In production, replace unrestricted Bash with audited SQL or Python APIs.
- Preserve an evidence trail. Log the question, generated program, matched and skipped records, and final cited time ranges so every answer can be traced back to the source video.
- Include indexing cost in the deployment budget. Measure indexing cost and latency per video hour, storage overhead, average query tokens, P95 latency, and query reuse rate. One-off and high-frequency workloads require different cost models.
- Keep a raw-video fallback. When structured evidence is missing, visually ambiguous, or too coarse for a fine-grained question, access the original video through its timestamp pointer.
- Fine-tune only after stabilizing the harness. The 64-trajectory result supports low-data adaptation, but evaluation should separate format adaptation, tool-use learning, and genuine retrieval improvement across unseen streams and question templates.
Bottom Line
VideoJSON's most important contribution is not a larger video model. It is evidence that an ultra-long-video agent may benefit more from a simple, programmable external memory than from an increasingly elaborate memory graph. The central engineering lesson is that fixed retrievers constrain how an agent searches, whereas a strong coding model can synthesize query logic directly over structured records.
That conclusion is still based on an abstract and author-run benchmarks. Open code, absolute scores, full cost accounting, and independent reruns under matched model and tool budgets are required before VideoJSON can be considered a general architecture rather than an efficient strategy tailored to current long-video benchmarks.
— END —Source: Hugging Face Daily Papers (2026-11-20)
Tags: #VideoJSON #Ultra-Long Video Understanding #Agentic Code Search #Structured Memory #Multimodal Agents
Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.
Community Comments