Abstract
Temporal Knowledge Graph Question Answering (TKGQA) requires reasoning over facts that change over time. Standard Large Language Models (LLMs) often struggle with "temporal blindness," retrieving semantically relevant but chronologically incorrect information. This paper introduces TempAgent, an autonomous agent that integrates a specialized temporal toolbox into the ReAct (Reason + Act) paradigm. By applying multi-granularity temporal filters during the retrieval phase, TempAgent achieves state-of-the-art performance, outperforming existing baselines by over 30% on complex temporal benchmarks.
Introduction: The Challenge of Temporal Knowledge
Knowledge is dynamic. Answering a question like "Who is the Prime Minister of the UK?" requires knowing the specific time of interest. Temporal Knowledge Graphs (TKGs) address this by storing facts as quadruplets: (subject, relation, object, timestamp). Despite this structured data, current LLMs and Retrieval-Augmented Generation (RAG) systems face significant hurdles in TKGQA.
First, standard retrieval tools often ignore temporal constraints, leading to "temporal noise" where multiple valid facts from different eras are retrieved simultaneously. Second, complex queries—such as those involving multi-hop reasoning or relative timing (e.g., "Who visited China after the Red Cross?")—force LLMs to manage logical steps and time filters at once, often resulting in hallucinations.
The TempAgent Framework
TempAgent addresses these issues by equipping a reasoning agent with a suite of time-aware tools. Following the ReAct paradigm, the agent operates in an iterative Thought -> Action -> Observation loop.
The Temporal Toolbox
The core innovation is a specialized toolbox containing 10 tools: one general search and nine time-aware filters. These filters are categorized by type (Before, After, or On a specific date) and granularity (Day, Month, or Year). For instance, a tool like SearchAfterMonth(query, date) isolates facts occurring strictly after a specified month, preventing the LLM from seeing irrelevant data. This "retrieval-side filtering" ensures that the information provided to the LLM is already temporally aligned with the query.
Iterative Reasoning and Prompting
TempAgent uses tailored prompting strategies to handle different question types. For multi-step questions, the agent can use one tool to identify a reference date (e.g., "When did Event A occur?") and then use that date as a parameter for a subsequent temporal search (e.g., "Search for Event B after [Date]").
Experimental Evaluation
The researchers evaluated TempAgent on two primary benchmarks: MultiTQ, a large-scale dataset with over 50,000 complex temporal pairs, and CronQuestions, a standard TKGQA benchmark.
Key Results
TempAgent demonstrated a substantial performance lead over existing methods. Using GPT-4, it achieved a 70.2% Hits@1 score on the MultiTQ dataset, representing a 41.3% improvement over the MultiQA baseline.
As shown in the performance breakdown, TempAgent excels particularly in "Equal" and "First & Last" query types. The results highlight that applying temporal constraints during retrieval is far more effective than relying on the LLM to filter a noisy set of results post-retrieval.
Insights and Limitations
Ablation studies revealed that the volume of retrieved data matters; retrieving exactly 10 tuples ($k=10$) provided the optimal balance between recall and noise. While TempAgent performs exceptionally well on "Day" and "Month" granularities, "Year" queries remain slightly more challenging due to the aggregation required for coarse-grained data.
Despite its success, TempAgent remains dependent on the underlying LLM's reasoning capacity. While GPT-4 handles the complex tool-calling logic well, smaller open-source models still struggle with the intricate multi-hop reasoning required for "Before last" or "After first" questions.
Conclusion
TempAgent represents a significant step forward in making LLMs time-aware. By shifting temporal filtering from the reasoning stage to the retrieval stage, the framework effectively bridges the gap between static knowledge retrieval and the fluid nature of real-world facts. Future work will focus on optimizing retrieval volume and improving the agent's ability to handle complex multi-hop logic in smaller models.
Summary updated