Goal-Oriented Reasoning for RAG-based Memory in Conversational Agentic LLM Systems

Jiazhou Liang, Armin Toroghi, Yifan Simon Liu, Faeze Moradi Kalarde, Liam Gallagher, Scott SannerarXiv 2026

TL;DR

Retrieval-Augmented Generation (RAG) helps conversational LLMs access long-term memory, but standard semantic retrieval often fails when answering complex, multi-hop questions. This paper introduces GOAL-MEM, a framework that uses backward chaining to break down user queries into verifiable subgoals and execute targeted memory retrieval. By formalizing this process using a novel hybrid logic system, GOAL-MEM significantly improves multi-hop reasoning accuracy across various memory architectures without accumulating irrelevant noise.

What Problem Does This Paper Address?

While modern LLM agents can use external RAG-based memory modules to recall past interactions, their retrieval mechanisms typically rely on simple semantic similarity to the user's raw utterance. This approach falls short for complex, multi-hop questions where the required information isn't semantically adjacent to the prompt.

For instance, if a user asks, "What drink should I try at the cafe I went to last week?", a standard RAG system might look for memories containing "drink" or "cafe." However, it lacks the explicit reasoning to realize it must first identify which cafe was visited, check what drinks that cafe serves, and cross-reference those with the user's flavor preferences. Traditional forward-reasoning alternatives (like Self-Reflection or ReAct) try to figure this out on the fly, but they are brittle; one irrelevant memory retrieval early on can propagate errors and derail the entire conversation.

Methods

The authors introduce GOAL-MEM, a structure-agnostic reasoning layer rooted in the classical principle of backward chaining. Instead of searching outward from the prompt, GOAL-MEM treats the user's request as a top-level goal and works backward.

[User Utterance] ➔ [Top-Level Goal] ➔ [Decompose into Subgoals] ➔ [Targeted Retrieval & Unification]

The framework relies on three core pillars:

  1. Natural Language Logic (NL-Logic): To make reasoning verifiable without losing the expressivity of human language, the authors created NL-Logic. It adopts the structural guarantees of First-Order Logic (FOL)—such as typed variables, explicit substitutions, and unification—but allows predicates and types to remain open-ended natural language phrases (e.g., (x:drink) served in (z:cafe)).
  2. Two-Loop Search (Breadth & Depth):
  3. Breadth Loop: Decomposes the main goal into a set of atomic subgoals. If a particular decomposition fails to resolve, the LLM generates an alternative logical path.
  4. Depth Loop: If a subgoal cannot be directly satisfied by the retrieved memory, the system recursively treats that subgoal as a new target, deriving its necessary preconditions (antecedents) to form new, highly targeted retrieval queries.
  5. Verifiable Unification: To prevent hallucinations, retrieved facts must pass a strict three-way check judged by the LLM: type consistency, consistency with existing variable bindings, and strict logical entailment.
Figure 2: Overview of GOAL-MEM. The framework starts from the user utterance and goal initial- ization (top), decomposes the goal into NL-Logic subgoals for memory retrieval from a selected backbone (middle), and checks whether the retrieved memory grounds all subgoals through unifica- tion. If not, it enters the depth loop (middle), identifying new subgoals with targeted retrieval until all variables have been substituted or the maximum depth (bottom left) is reached. The failed goal decomposition would then be provided to future decompositions to prevent a duplicate approach.

Datasets

The framework was evaluated on two long-term conversational memory benchmarks:

  • LoCoMo: A dataset focusing on long-range, multi-session interactions filled with multi-hop questions where evidence is scattered across distant parts of the dialogue history.
  • LongMemEval-Small: A benchmark designed to test core assistant memory capabilities, including information extraction, handling temporal dependencies, managing knowledge updates, and knowing when to abstain from answering due to insufficient evidence.

Key Insights and Ideas

  • Semantic Similarity $\neq$ Logical Necessity: Traditional RAG assumes that if a memory trace sounds similar to the prompt, it is useful. GOAL-MEM demonstrates that structured, goal-directed queries are required to bridge multi-hop gaps successfully.
  • Backward Chaining as an Error Filter: Unlike forward-reasoning agents that blindly accumulate facts and risk error propagation, backward chaining acts as a strict filter. It only accepts memory traces that directly satisfy a logically required precondition.
  • Theory vs. Practical Efficiency: Theoretically, the nested loops could become computationally expensive. However, empirical evaluation revealed that for most queries, SOTA LLMs are highly proficient at generating the correct decomposition on the first try, meaning the search usually terminates at Depth 0 and Breadth 1.

Key Results

The authors paired GOAL-MEM with eight distinct memory backbones (ranging from flat vector databases like Dense-RAG to tree-based structures like RAPTOR and graph-based systems like GraphRAG) using Gemma-4-26B and GPT-5.4-mini.

  • Consistent Performance Boost: GOAL-MEM systematically improved both LLM-as-judge accuracy and token-level F1 scores across the board. The largest absolute gains occurred on simple flat backbones (BM25 and Dense-RAG), proving that goal-oriented reasoning can compensate for a lack of complex underlying memory structure.
  • Multi-Hop Mastery: On the LoCoMo dataset, GOAL-MEM achieved a massive mean accuracy lift of +18.9% on multi-hop questions using the Gemma backbone, significantly outperforming popular forward-reasoning baselines like ReAct, Self-Reflection, and MemGuide.
LLM accuracy breakdown by question type on LoCoMo, highlighting the significant performance lift on multi-hop questions.

Limitations and Future Work

While GOAL-MEM is structure-agnostic, its performance is still bounded by the quality of the underlying memory backbone. For instance, abstract memory backbones (like Mem0) that compress or omit fine-grained details like temporal cues make it difficult for GOAL-MEM to resolve intermediate subgoals. Additionally, the framework relies heavily on the LLM's capacity to perform accurate goal decomposition and entailment verification; weaker frontier models may struggle with the logical rigor required by NL-Logic. Future work could explore optimizing the underlying memory representations to better preserve the fine-grained context needed for backward chaining.

Summary updated

BibTeX
@misc{liang2026goal,
  author = {Jiazhou Liang and Armin Toroghi and Yifan Simon Liu and Faeze Moradi Kalarde and Liam Gallagher and Scott Sanner},
  title = {{Goal-Oriented Reasoning for RAG-based Memory in Conversational Agentic LLM Systems}},
  year = {2026},
  eprint = {2605.12213},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.12213},
}
Figure