SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.16032 · 2025

Agentic Keyframe Search for Video Question Answering

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 2 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2503.16032.json · badge: /api/ran/2503.16032.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
fansunqi/akeys canonical (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
FunctionStatusWhere it lives
get_video_filenames Ran
ran on a synthesized input
fansunqi/akeys/util.py
code served (permissive licence) · get_code("ad128b0e378edd25")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory with some test .mp4 files
temp_dir = tempfile.mkdtemp()
open(os.path.join(temp_dir, 'video1.mp4'), 'w').close()
open(os.path.join(temp_dir, 'video2.mp4'), 'w').close()
open(os.path.join(temp_dir, 'other_file.txt'), 'w').close()

ARGS = {
    'directory': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
identity Ran
ran, honoured the contract we drafted
fansunqi/akeys/model.py
code served (permissive licence) · get_code("036725c05a3d96f8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# The identity function simply returns its input
# So res can be any value - let's use a simple tensor
res = torch.randn(2, 4)

ARGS = {
    "res": res
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_json Ran
ran; our contract draft was wrong, not the code
fansunqi/akeys/util.py
code served (permissive licence) · get_code("658682feda4928a2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
test_file = os.path.join(temp_dir, 'test_data.json')

test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

with open(test_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    'fn': test_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_pkl Ran
ran; our contract draft was wrong, not the code
fansunqi/akeys/util.py
code served (permissive licence) · get_code("8080055de6293a6b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pickle
import tempfile
import os

# Create a temporary pickle file with some test data
test_data = {
    'key1': 'value1',
    'key2': [1, 2, 3],
    'key3': {'nested': 'dict'}
}

# Create a temporary file
temp_dir = tempfile.gettempdir()
temp_file = os.path.join(temp_dir, 'test_data.pkl')

# Write the pickle file
with open(temp_file, 'wb') as f:
    pickle.dump(test_data, f)

# Define arguments for load_pkl
ARGS = {
    'fn': temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
replace_extension_with_png Ran
ran on a synthesized input
fansunqi/akeys/analyze_results.py
code served (permissive licence) · get_code("ca69974dd31afab3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned PosixPath. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from pathlib import Path

# The function takes a file_path parameter and converts it to a Path object,
# then replaces the file extension with .png
# We need to provide a valid file path string

file_path_input = "/home/user/documents/image.jpg"

ARGS = {
    "file_path": file_path_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
summarize_one_video Ran
ran on a synthesized input
fansunqi/akeys/summarizer.py
code served (permissive licence) · get_code("f4a376f891cfd3ee")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class MockSummarizer(nn.Module):
    """Mock summarizer that implements the forward method called in the function."""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(10, 5)
    
    def forward(self, head=None, prompt=None, use_cache=False, logger=None):
        """
        Returns a tuple of (response, info) as expected by summarize_one_video.
        """
        response = "This is a summary of the video showing natural human activities in chronological order."
        info = {"status": "success", "tokens_used": 42}
        return response, info

class MockLogger:
    """Mock logger for capturing log messages."""
    def __init__(self):
        self.messages = []
    
    def log(self, msg):
        self.messages.append(msg)
    
    def info(self, msg):
        self.messages.append(msg)

# Construct the arguments
summarizer = MockSummarizer()

video_id = "video_001"

sample_caps = {
    "frame_1": "#C I am standing in a kitchen. #O My friend is preparing lunch.",
    "frame_5": "#C I walk towards the table. #O My friend is arranging plates.",
    "frame_10": "#C I sit down at the table. #O My friend brings food."
}

example_summary = """
[EXAMPLE SUMMARY]
The video shows a sequence of natural activities in a kitchen. First, I stand observing my friend preparing lunch. Then I walk towards the table while my friend arranges plates. Finally, I sit down and my friend brings the prepared food to the table.
"""

use_cache = False

logger = MockLogger()

ARGS = {
    "summarizer": summarizer,
    "video_id": video_id,
    "sample_caps": sample_caps,
    "example_summary": example_summary,
    "use_cache": use_cache,
    "logger": logger
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
postprocess_response_dict Not yet run
unverified (harvested, no recorded run)
fansunqi/akeys/summarizer.py
code served (permissive licence) · get_code("4d8d4f2f6a658e84")
How it ran

no invocation recorded.

split_and_reconnect_segments Not yet run
unverified (harvested, no recorded run)
fansunqi/akeys/video_seg.py
code served (permissive licence) · get_code("7d9027e01b5d0aeb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
identity 5 other papers
4 dated earlier, 1 same year, order not determinable
2312.17235 (2023-12)
A Simple LLM Framework for Long-Range Video Question-Answering
2024.emnlp-main.1209 (2024 (year only))
A Simple LLM Framework for Long-Range Video Question-Answering
2403.14622 (2024-03)
Language Repository for Long Video Understanding
and 2 more not named here
load_json 5 other papers
4 dated earlier, 1 same year, order not determinable
2312.17235 (2023-12)
A Simple LLM Framework for Long-Range Video Question-Answering
2024.emnlp-main.1209 (2024 (year only))
A Simple LLM Framework for Long-Range Video Question-Answering
2403.14622 (2024-03)
Language Repository for Long Video Understanding
and 2 more not named here
load_pkl 5 other papers
4 dated earlier, 1 same year, order not determinable
2312.17235 (2023-12)
A Simple LLM Framework for Long-Range Video Question-Answering
2024.emnlp-main.1209 (2024 (year only))
A Simple LLM Framework for Long-Range Video Question-Answering
2403.14622 (2024-03)
Language Repository for Long Video Understanding
and 2 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Video question answering (VideoQA) enables machines to extract and comprehend key information from videos through natural language interaction, which is a critical step towards achieving intelligence. However, the demand for a thorough understanding of videos and high computational costs still limit the widespread applications of VideoQA. To address it, we propose Agentic Keyframe Search (AKeyS), a simple yet powerful algorithm for identifying keyframes in the VideoQA task. It can effectively distinguish key information from redundant, irrelevant content by leveraging modern language agents to direct classical search algorithms. Specifically, we first segment the video and organize it as a tree structure. Then, AKeyS uses a language agent to estimate heuristics and movement costs while dynamically expanding nodes. Finally, the agent determines if sufficient keyframes have been collected based on termination conditions and provides answers. Extensive experiments on the EgoSchema and NExT-QA datasets show that AKeyS outperforms all previous methods with the highest keyframe searching efficiency, which means it can accurately identify key information and conduct effective visual reasoning with minimal computational overhead. For example, on the EgoSchema subset, it achieves 1.8% higher accuracy while processing only 43.5% of the frames compared to VideoTree. We believe that AKeyS represents a significant step towards building intelligent agents for video understanding. The code is publicly available at https://github.com/fansunqi/AKeyS.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2503.16032")
get_code_for_paper("2503.16032")
have("2503.16032")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2503.16032.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2503.16032.svg)](https://syntology.ai/paper/2503.16032)

Connect an agent — have() is free.