GeoRAG: A Geographic Retrieval Augmented Generation Framework Based on Urban Spatio-Temporal Knowledge Graph
摘要
This paper focuses on addressing the challenges of enabling Large Language Models (LLMs) to perform urban spatial reasoning. Existing methods have a main limitation: Retrieval Augmented Frameworks (RAG) lack effective spatial knowledge injection and fail to adequately address spatial semantics, it leads to insufficient knowledge perception of urban spatial scenarios in LLMs. To overcome this issue, we propose a novel geographic retrieval-augmented generation framework (GeoRAG). The approach avoids significant computational overhead and prevents sacrificing generalizability. GeoRAG uses OpenStreetMap data to automatically build a spatio-temporal knowledge graph (STKG). STKG organizes and stores urban spatio-temporal knowledge. GeoRAG incorporates both hierarchical and proximity based spatial features, it introduces a dual retrieval mechanism, the mechanism combines placename matching and coordinate based querying. The retrieved results need to serve as supplementary knowledge for LLMs. To inject contextual spatial knowledge into large models, a spatial prompt template was designed. Our template enabled seamless integration of the knowledge retrieved with LLMs. The experimental results on the CityGPT benchmark show that GeoRAG significantly improves the spatial reasoning performance of Qwen2.5-32B. It achieves relative accuracy gains of 11.89%, 13.25%, and 7.49% on Beijing, London, and New York datasets respectively. This demonstrates the effectiveness of plug-and-play geographic augmentation for LLMs.