SpaRAGraph: Spatial Reasoning using Retrieval-Augmented Generation
Abstract
The advent of large language models (LLMs) has enabled powerful applications across several domains such as science, healthcare, finance, and law. However, the spatial inference capabilities of LLMs are limited. Our goal is to facilitate more accurate LLM responses to spatial queries. To this end, we leverage inference-time retrieval augmented generation (RAG) to enrich LLM context using external data. We present SpaRAGraph, a framework that (i) performs spatial-to-RDF data processing to capture spatial relations between nearby entities, (ii) indexes relation-RDFs using a graph to facilitate semantic traversal, and (iii) retrieves the relevant context to a question at inference time, contextualizing it with factual, spatial information enhancing the LLM’s accuracy. Additionally, we present a spatial reasoning benchmark that challenges LLMs on binary, multiclass and multilabel classification tasks on real-world, spatial entities. Overall, SpaRAGraph sets the ground for using spatial knowledge retrieval techniques to improve LLM effectiveness in spatial reasoning tasks.
Fields of Study & Subjects
Multimodal Machine Learning Applications
Constraint Satisfaction and Optimization
Topic Modeling
Publication details
- Journal / source
- ACM Transactions on Spatial Algorithms and Systems
- Publisher
- Association for Computing Machinery (ACM)
- Volume
- 12
- Issue
- 3
- Pages
- 1–31
- Publication date
- 26 February 2026
- Language
- EN