Skip to content
latentSource

ReActReel: finding a movie scene or song from a remembered line

A Gemini agent searches for movie scenes and songs, shows its tool calls, and returns a YouTube result inside the app.

·2 min read
AI agentsReActGeminiTool calling
Share

Watch the app in action

ReActReel identifies a movie and a song from remembered lines, without being given their titles or artists. The recording shows the tool calls and plays the movie quote from 0:44.

English AI narration and original movie dialogue. Unmute to hear the match.

Open video

I built ReActReel for the kind of search that starts with half a memory. You remember a scene, a performer, or a phrase. The agent has to turn that description into something you can watch.

The application has separate movie and music modes. It shows the agent's tool calls beside the result, so I can check how it got from the query to a YouTube URL. That trace is the part I care about when evaluating an agent: which tool did it choose, what came back, and what did it do next?

Two searches worth watching

The movie query gives the line "You can't handle the truth!" The music query gives a short lyric from the chorus. Neither supplies a title, actor, or artist. The agent identifies A Few Good Men and Daft Punk's Get Lucky.

The movie search uses timestamp mode. The agent searches YouTube, calls get_timestamp_from_text, and passes the returned 44 seconds to process_video. The recording then plays the Movieclips scene from 0:44. The player advances through the requested line, with the timestamp, captions, and original dialogue captured on screen and in the audio. The narration pauses so the spoken match is audible.

The music search uses quick mode and finds Daft Punk's official audio video, without claiming an exact lyric timestamp. An animated status indicator shows when the agent is thinking or running a tool. The website player starts muted; unmute it to hear the English narration and movie dialogue. A brief pause between the two searches is removed from the recording; the searches and quote playback run at their original speed.

Both queries start from remembered lines. The selected mode gives the agent its domain; it still has to identify the work and find a video through its tools.

How the app works

The Next.js interface sends a query to a FastAPI backend. The backend runs the shared reactreel-core agent and streams events back to the browser. The interface displays each iteration, the chosen tool, its arguments, and the returned observation.

Available tools cover web search, YouTube search, timestamp lookup, and clip URL construction. The model chooses the next action from the results it has received. The browser embeds the final YouTube URL when the run finishes.

Quick mode stops at video identification and skips timestamp lookup. The longer workflow can try to locate a phrase within a video. Those are different results: finding the right video does not establish that a particular line starts at a particular second.

What I check

A plausible title is an easy answer to generate. I want to see a URL returned by the tools, a result that matches the request, and enough trace information to investigate a mistake.

YouTube availability and embedding permissions can change. A returned link and a working embedded player are separate checks. The app keeps the tool results visible so a failed embed does not erase the evidence behind the search.

The ReAct loop explainer goes deeper into the orchestration pattern behind this project.