MovieAgent's LangGraph orchestration and multi-route reranking
A code-grounded article describes MovieAgent's five-node LangGraph pipeline: intent parsing, planning, execution, reflection and generation. The author says only the first and last nodes call an LLM, while the middle stages use deterministic logic. Six retrieval routes produce candidates that are merged, deduplicated and ranked with Reciprocal Rank Fusion before Maximal Marginal Relevance reranking adds diversity. The article also describes optional LLM reranking, feedback-based reweighting and a position prior designed to preserve diversity. An author-run internal offline evaluation averaged five queries and reported NDCG@10 of 0.9969 and MRR of 0.60 for RRF, versus 0.8904 and 0.23 for the previous score fusion. The author notes that preference requests can trigger unnecessary retrieval and reranking, and that a planned guardrail to reserve a cold-start slot was not implemented.
The article provides a concrete implementation pattern for combining deterministic agent orchestration, multi-route retrieval and diversity-aware reranking in a movie recommendation system. Its performance comparison is limited to an author-run internal evaluation averaged over five queries, so the reported gains should be treated cautiously.
第 3 篇 · 核心引擎:LangGraph 编排与多路召回重排
《从零造一个影片推荐智能体》系列 · 第 3 篇 / 共 10 篇 上篇收尾说「第 3–8 篇各自认领其中一层,不会回来重画这张图」。这篇先挑最上面那颗心脏开刀——它怎么听懂人话、怎么派活、怎么把一堆参差不齐的候选排成一份像样的片单。
前言
上一篇我们把地图摊开了,六层、agent/、快慢车道。有朋友看完问了个特别实在的问题:「架构我都懂,可你说半天 Agent,它到底干了啥?」
这个问题问得我挺高兴,因为它戳到了我最想聊的部分。
想象一下你瘫在沙发上打开对话框,敲了一句「推荐一部太空科幻片,要那种孤独感的」。回车下去,屏幕上先是跳一个「正在识别意图」的小步骤,接着是「正在检索影片」,然后答案一个字一个字往外蹦,最后给你三到五部片子,每部还附一段「为什么推它」。
#MovieAgent#LangGraph#Reciprocal Rank Fusion#Maximal Marginal Relevance