Real-time Spatial Retrieval Augmented Generation for Urban Environments

David Nazareno Campo, Javier Conde, Álvaro Alonso, Gabriel Huecas, Joaquín Salvachúa, Pedro Reviriego · 2025

Read Real-time Spatial Retrieval Augmented Generation for Urban Environments by David Nazareno Campo, Javier Conde, Álvaro Alonso, Gabriel Huecas, Joaquín Salvachúa, Pedro Reviriego (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-02271.txt.

Introduction

City chatbots built on large language models answer from stale training knowledge unless they fetch live data. David Nazareno Campo and five co-authors design a retrieval system for cities in a 2025 paper that filters by place and time, not just by topic. The design links live urban data feeds to the model so answers reflect what is happening now, with security needs in mind.

They built the system on the FIWARE smart-city platform and demonstrated it as a tourism assistant for Madrid. The case study checks that the parts fit together and can feed a model fresh, local facts. The authors present the design as a pattern for other cities.

Catalog record

CREATORDavid Nazareno Campo, Javier Conde, Álvaro Alonso, Gabriel Huecas, Joaquín Salvachúa, Pedro Reviriego
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE66 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2505-02271

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Real-time Spatial Retrieval Augmented Generation for Urban Environments David Nazareno Campo, Javier Conde, Álvaro Alonso, Gabriel Huecas, Joaquín Salvachúa, Pedro Reviriego Abstract The proliferation of Generative Artificial Ingelligence (AI), especially Large Language Models, presents transformative opportunities for urban applications through Urban Foundation Models. However, base models face limitations, as they only contain the knowledge available at the time of training, and updating them is both time-consuming and costly. Retrieval Augmented Generation (RAG) has emerged in the literature as the preferred approach for injecting contextual information into Foundation Models. It prevails over techniques such as fine-tuning, which are less effective in dynamic, real-time scenarios like those found in urban environments. However, traditional RAG architectures, based on semantic databases, knowledge graphs, structured data, or AI-powered web searches, do not fully meet the demands of urban contexts. Urban environments are complex systems characterized by large volumes of interconnected data, frequent updates, real-time processing requirements, security needs, and strong links to the physical world. This work proposes a real-time spatial RAG architecture that defines the necessary components for the effective integration of generative AI into cities, leveraging temporal and spatial filtering capabilities through linked data. The proposed architecture is implemented using FIWARE, an ecosystem of software components to develop smart city solutions and digital twins. The design and implementation are demonstrated through the use case of a tourism assistant in the city of Madrid. The use case serves to validate the correct integration of Foundation Models through the proposed RAG architecture. It also enables the analysis of current model limitations, such as their inability to handle large volumes of information, even when it fits within their context window, and the high latency of Large Language Models caused by transformer-based architectures, which generate output token by token. 1 Introduction The rise of Generative Artificial Intelligence (AI) in general, and foundation models specifically, has enabled the proliferation of new tools in which Large Language Models (LLMs) become just one component within the software architecture. LLMs are neural networks composed of billions of parameters that have been trained on massive datasets with the task of predicting the next token. The transformer-based architecture, along with Big Data capabilities, has significantly increased LLM performance in recent years Naveed et al. 2024 . A limitation of foundation models is that their knowledge is restricted to the dataset on which they were trained and the specific task for which they were designed. Additionally, training a model is extremely costly, both computationally and economically, making it unfeasible to train a new model from scratch just to expand its knowledge base. Alternatives like fine-tuning allow us to modify the behavior of the LLMs. Fine-tuning is less expensive than training a model from scratch, and it works well to adapt the behavior of the model by providing a lot of examples of the desired task, but it is less effective in injecting new knowledge Ovadia et al. 2024 . In addition, it would be necessary to retrain the LLM every time new information needs to be added, making it incompatible with dynamic systems such as cities. Another alternative is Retrieval Augmented Generation (RAG) Lewis et al. 2020 ; Lewis et al. 2020 . RAG is a technique applied to LLMs to provide and restrict the LLM to new information not contained in the training dataset Ovadia et al. 2024 . RAG is one of the most widely used techniques for integrating LLMs in specific use cases where contextual information, unknown to the base model, is required Fan et al. 2024 . Unlike fine-tuning, which modifies the model’s parameters through a light retraining, RAG allows external information to be injected without altering the base model. This makes RAG more suitable for dynamic systems with frequent information updates. One of the environments where base foundation models are not sufficient is cities. Urban environments are characterized by being complex ecosystems with multiple data sources that are updated in real time, which were not in the training dataset of the model and with many interconnected systems. The digitalization of cities through the development of smart cities has been one of the main goals of governments worldwide in recent years Kirimtat et al. 2020 , with efforts focused on the creation of urban digital twins (DTs) Weil et al. 2023 . These urban DTs collect real-time data from the physical city through Internet of Things (IoT) sensors, process them within the virtual entity, and, based on the results, modify the state of the city through IoT actuators. Traditionally, DTs have processed information mainly through physical models or machine learning models aimed at predicting the future state of city elements such as traffic congestion Talkhestani et al. 2019 . However, these systems have been limited to handling structured data, excluding natural language. The proliferation of Generative AI paves the way for the integration of components into urban environments that are capable of processing natural language. This enables the implementation of more advanced and complex actions designed to improve the lives of citizens, moving toward what is known as Urban General Intelligence Zhang et al. 2025 . Cities are complex systems that require the integration of multiple data sources, the ability to process large volumes of data in a distributed manner, ensuring information security, interconnecting the physical world through IoT devices, modeling of physical information, processing data in real-time, and the executing complex models Kirimtat et al. 2020 ; Haque et al. 2022 ; Javed et al. 2022 . The need to adapt foundation models to urban environments has led to the emergence of Urban Foundation Models (UFMs), i.e., foundation models that are pre-trained on urban data to be applied in urban applications Zhang et al. 2024 . These models are designed with capabilities to process natural language, time series, and multimodal information, as well as to perform vision tasks, management, and prediction of human and vehicle trajectories. The adoption of UFMs requires RAG capabilities in order to process real-time information from cities, with the need of designing new architectures to support all the previously mentioned requirements (connection to the physical world, scalability, security, and real-time processing). In this work, we explore current RAG system solutions for urban environments, propose an architecture that meets the specific requirements of urban environments, and extend a pre-existing digital twin architecture for cities with foundation models. Our proposal is based on interoperable, extensible, open source, and scalable components, enabling the integration of an LLM capable of processing city information. In addition, we include a use case based on the city of Madrid to evaluate the feasibility of the proposed architecture. The manuscript is structured as follows. In the next section, we discuss existing RAG solutions, their application to urban areas, and we present the FIWARE technology that we will use to implement the urban RAG architecture. In Section 3, we propose the requirements a RAG system must meet to be integrated into cities, as well as a reference architecture to develop urban RAGs. Next, we implement the proposed architecture that uses the component-based technology of FIWARE for cities. In Section 5, we validate our proposal through a use case in the city of Madrid. Finally, in Section 6, we present the conclusions and limitations of

Read the complete text