category: literaturenote citekey: zhangstudyindividualspatiotemporalactivity2025 title: A Study on Individual Spatiotemporal Activity Generation Method Using MCP-Enhanced Chain-of-Thought Large Language Models authors: "Zhang, Yu; Hu, Yang; Wang, De" year: 2025 date: 2025-00-00 2025 url: "https://arxiv.org/abs/2506.10853v1" zotero_key: M97NF9VQ zotero_storage: 9KKQGATF collections: transpordi_planeerimine folder: 001_artiklid firstAuthor: "Zhang, Yu"
College of Architecture and Urban Planning Tongji University Shanghai 200092, China 2330332@tongji.edu.cn
College of Architecture and Urban Planning Tongji University Shanghai 200092, China huyang@tongji.edu.cn
College of Architecture and Urban Planning, Tongji University Digital Planning Technology Research Center, Shanghai Tongji Urban Planning & Design Institute Co., Ltd. Shanghai 200092, China dewang@tongji.edu.cn
Human spatiotemporal behavior simulation is important for research in urban planning and related fields, yet traditional rule-based and statistical approaches face significant limitations including high computational costs, limited generalizability, and poor scalability. While large language models (LLMs) show promise as "world simulators," they face important challenges in spatiotemporal reasoning including limited spatial cognition, lack of physical constraint understanding, and group homogenization tendencies. This paper introduces a framework that integrates chain-of-thought (CoT) reasoning with Model Context Protocol (MCP) to enhance LLMs' capability in simulating and generating spatiotemporal behaviors that correspond with validation data patterns. The methodology combines human-like progressive reasoning through a five-stage cognitive framework with comprehensive data processing capabilities via six specialized MCP tool categories: temporal management, spatial navigation, environmental perception, personal memory, social collaboration, and experience evaluation. Experiments in Shanghai's Lujiazui district validate the framework's effectiveness across 1,000 generated samples. Results indicate correspondence with real mobile signaling data, achieving generation quality scores ranging from 7.86 to 8.36 across different base models in controlled experimental conditions. Parallel processing experiments demonstrate efficiency improvements under tested configurations, with generation times decreasing from 1.30 to 0.17 minutes per sample when scaling from 2 to 12 processes on dedicated hardware, thereby demonstrating the framework's potential for large-scale deployment.
This work contributes to the integration of CoT reasoning with MCP for urban behavior modeling, advancing LLMs applications in urban computing and providing a practical approach for synthetic mobility data generation in data-constrained environments. The framework offers a basis for exploring potential applications in smart city planning, transportation forecasting, participatory urban design, and related domains.1\*
Keywords Large Language Models, Chain-of-Thought Reasoning, Model Context Protocol, Spatiotemporal Behavior, Urban Computing, Human Mobility
1*For detailed code and additional information, please visit the code repository: https://github.com/ZYY799/ spatiotemporal-activity-generation-mcp-cot. The trial system web platform is currently in the development and debugging phase.
Human spatiotemporal behavior2\* constitutes the foundational data for urban research, proving important for multiple domains including urban planning, transportation management, commercial site selection, and epidemic control. Accurately understanding and predicting individual spatiotemporal behavior patterns in cities enables optimization of urban functional layouts, improvement of resource utilization efficiency, and enhancement of public service quality1,2 . However, high-quality spatiotemporal behavioral data acquisition remains challenging3 as conventional survey methods are constrained by cost and sample limitations, whereas LBS-based and mobile signaling approaches present privacy vulnerabilities and insufficient semantic granularity. Although rule-based behavioral simulation and statistical modeldriven spatiotemporal behavior generation methods have partially mitigated data scarcity issues 4 , these approaches generally rely on substantial prior knowledge and produce overly simplified behavioral patterns that fail to capture the complexity and diversity inherent of human activities 5
In recent years, Large Language Models (LLMs) have demonstrated significant advances in knowledge integration and logical reasoning. Through pre-training on massive text corpora, these models have accumulated extensive world knowledge, including understanding of human behavioral patterns and social activities. Consequently, LLMs possess the potential to serve as "world simulators," capable of simulating complex real-world systems and human behaviors. However, LLMs face several important challenges when applied to urban spatiotemporal behavior simulation: First, limited spatial cognitive abilities make it difficult to accurately understand and express geographic coordinates and spatial relationships 6 . Second, insufficient understanding of real-world physical constraints may lead to generation of behavior sequences that violate spatiotemporal continuity7 . Third, closed training environments restrict the model's ability to acquire and update external dynamic information. Fourth, models exhibit pronounced group homogenization tendencies, with generated content often reflecting "average" and standard behavioral patterns while struggling to capture population heterogeneity and individual unique behavioral patterns 8 .Fifth, LLMs generate different outputs each time due to random sampling, preventing reproducible results and creating challenges for interpretability of generated behavioral patterns 9 . Additionally, generating behavior data for entire city populations presents significant computational resource challenges for large-scale applications.
To address these challenges, this paper develops an individual spatiotemporal behavior generation method that integrates MCP-enhanced chain-of-thought reasoning with LLMs. This method integrates two technical paradigms: Chain-of-Thought Reasoning and Model-Context Protocol (MCP), enabling LLMs to progressively reason through activity decision-making processes through structured reasoning while acquiring and processing precise spatiotemporal information through a unified protocol framework. MCP, as a more flexible and powerful context interaction mechanism compared to traditional function calling, can effectively integrate multi-source heterogeneous data, support complex conditional reasoning, and facilitate dynamic interaction between individual memory and group knowledge, thereby providing a novel technical approach for large-scale individual spatiotemporal behavior generation. Furthermore, the Lujiazui area of Shanghai is selected as an empirical case study to evaluate the effectiveness of the proposed method through comparative experiments.
The key innovations and contributions of this work include: (1) Proposing a novel spatiotemporal behavior generation method combining chain-of-thought reasoning and MCP, extending the application boundaries of large models in urban spatial computing; (2) Developing a comprehensive MCP framework with specialized tool collections for urban activity simulation, addressing limitations of LLMs in spatial precision and logical coherence; (3) Constructing large-scale, high-quality spatiotemporal behavioral knowledge bases and local knowledge repositories, establishing a systematic data training and validation framework; (4) Developing a parallel processing pipeline suitable for large-scale spatiotemporal behavior generation, addressing efficiency and consistency issues in batch generation; (5) Demonstrating through experimental validation the advantages of the proposed method in generating high-quality, realistic individual spatiotemporal behaviors, thus establishing a novel technical framework for human behavior simulation under datalimited conditions.
Agent-Based Modeling (ABM) has emerged as a valuable methodology for simulating individual behaviors and social systems. Within urban studies, ABM utilizes autonomous agents equipped with decision-making capabilities
2*In this study, "spatiotemporal behavior" refers to human activity-travel patterns characterized by: (1) spatiotemporal coordinates: locations, timing, duration, and spatial-temporal sequences of activities and movements; and (2) behavioral dimensions: individual characteristics (age, household composition, socioeconomic status), activity purposes and types, travel companions, route trajectories, transportation mode choices, subjective perceptions and preferences, post-activity evaluations, and future planning strategies.
and defined interaction rules to generate macro-level phenomena from micro-level behaviors, thereby establishing a "bottom-up" framework for analyzing complex systems. Batty et al. 10 established the foundation for applying ABM to urban pedestrian behavior simulation, demonstrating how simple behavioral rules could effectively reproduce collective movement patterns in complex urban environments. Building upon this foundation, traffic simulation platforms such as MATSim11 have advanced this approach by integrating synthetic populations with transportation networks to achieve large-scale dynamic simulations of urban traffic flows, providing valuable empirical evidence for urban planning and traffic management.
Traditional ABM approaches, however, face two fundamental limitations. First, behavioral rule design relies extensively on expert knowledge, which constrains the model's ability to fully capture the inherent complexity, variability, and adaptability of human decision-making. Second, computational demands scale exponentially with simulation size, restricting practical applications to relatively small urban systems. In response to these challenges, scholars have increasingly incorporated machine learning techniques into ABM frameworks. Zheng et al. 12 developed an agent behavior model leveraging deep reinforcement learning, enabling agents to autonomously acquire decision strategies from empirical data rather than relying on predefined rules, thereby significantly enhancing adaptability to complex environments. Similarly, Liu et al. 13 employed graph neural networks to model agent interactions, effectively capturing both the influence of social network structures on individual behaviors and the intricate mechanisms underlying inter-agent dynamics. Despite these advances, such approaches remain computationally intensive and data-hungry, requiring extensive labeled datasets for training while exhibiting limited generalization in data-sparse environments or novel scenarios.
Recent developments in large language model (LLM)-based agent simulation frameworks have unveiled notable possibilities. Park et al. 14 introduced the concept of Generative Agents, which harness LLMs to construct sophisticated memory, reflection, and decision-making mechanisms, enabling the simulation of highly realistic and diverse human behaviors. Complementing this work, frameworks such as AutoGen15 and LangChain16 have established architectures for multi-agent collaboration, facilitating autonomous interaction and cooperation among LLM-driven agents. While these studies demonstrate the considerable promise of large language models for human behavior simulation, significant challenges persist in addressing the distinctive characteristics of urban spatiotemporal behaviors, including environmental constraints, multi-scale interactions, and long-term evolutionary dynamics.
Activity chain simulation represents an important approach for understanding and predicting human daily behavior. Hägerstrand's 17 time geography framework emphasizes the impact of spatiotemporal constraints on human activities, providing a theoretical foundation that has inspired numerous empirical studies and model developments. Granovetter 18 analyzed the motivations and processes underlying activity selection from a sociological perspective, highlighting the roles of personal preferences, social roles, and lifestyles in activity decision-making.
With advances in location-aware technologies, data-driven spatiotemporal behavior research has made considerable progress. Chen et al. 19 reviewed applications of big data and small data in human mobility analysis, demonstrating that mobile phone location data can be used to identify common activity patterns of urban residents. Widhalm et al. 20 effectively extracted stable activity clusters from multi-city mobile phone data by integrating activity timing, duration, and land-use characteristics; similarly, Ahas et al. 21 analyzed the spatiotemporal distribution characteristics of different social groups using mobile phone positioning data, while Yin et al. 22 discovered prevalent activity patterns of urban residents through mobile phone trajectory data. Nevertheless, these observation-based methods generally require extensive location data and face constraints related to data sampling frequency, accuracy, and coverage.
To overcome the limitations of observational data, various activity chain generation models have been proposed. Among these, CEMDAP23, ALBATROSS24, and TASHA25 generate activity chains based on demographic characteristics by integrating rule-based systems with statistical models. Drchal et al. 26 introduced DDAS, a deep generative model-based approach for activity chain generation that learns from extensive real-world activity data to produce activity sequences conforming to statistical distributions. Nevertheless, these models typically employ multi-stage decision processes: first determining activity types and temporal arrangements, then assigning activity locations, and finally planning transportation modes. Despite these advances, such methods tend to rely substantially on extensive labeled data, and the generated activity patterns often exhibit limited individual-specific characteristics, potentially constraining their ability to capture the full diversity and uniqueness of human behavior. Moreover, this staged linear decision framework may inadequately represent the dynamic trade-offs and interdependencies among various factors in actual human decision-making processes.
Large Language Models (LLMs) have demonstrated impressive performance across numerous tasks through the pretraining and fine-tuning paradigm. Models such as ChatGPT and DeepSeek not only generate fluent natural language but also exhibit notable reasoning capabilities and extensive world knowledge. These capabilities emerge from extensive textual data processed during pre-training. Research indicates that LLMs appear to implicitly learn complex concepts, facts, and reasoning rules from such data 27 28
Building upon these capabilities, scholars have begun exploring how to leverage LLMs' core training mechanism—next-token prediction—to directly model human activity sequences. This approach treats human mobility trajectories and activity chains as specialized sequential data, capturing inherent spatiotemporal correlations and mobility patterns through fine-tuned language models 29. The Geo-Llama framework7 established this approach by employing a visit-wise arrangement strategy that enables models to capture authentic mobility patterns without temporal ordering constraints. NextlocLLM30 further improved spatial relationship modeling by encoding continuous spatial coordinates rather than discrete location IDs. AgentMove decomposed mobility prediction into multiple subtasks, incorporating spatiotemporal memory modules to extract individual mobility patterns 31. These token prediction-based approaches demonstrate how LLMs can effectively model complex spatiotemporal behaviors, though their reasoning processes often exhibit limited transparency and interpretability.
In response to the interpretability challenges inherent in these spatiotemporal modeling approaches, Chain-of-Thought (CoT) reasoning emerges as a promising technique that helps mitigate this limitation by enhancing the reasoning transparency of LLMs. Wei et al. 32 showed that guiding models to generate intermediate reasoning steps can significantly improve performance on mathematical problems and commonsense reasoning tasks. Subsequent research revealed that CoT reasoning benefits models of various scales, particularly during knowledge distillation, while Kojima et al. 33 further demonstrated that simple prompts such as "let's think step by step" can elicit reasoning capabilities, achieving zero-shot chain-of-thought reasoning. These explicit reasoning mechanisms provide valuable foundations for developing more interpretable and controllable spatiotemporal decision-making systems, helping to resolve the transparency limitations observed in current LLM-based mobility modeling frameworks.
Complementing these interpretability advances, the Model-Context Protocol (MCP) represents a structured interaction paradigm that enhances LLMs' understanding of external environments. In contrast to the Toolformer model proposed by Schick et al. 34, which primarily focuses on discrete tool invocation, MCP emphasizes the establishment of unified contextual interaction protocols. These protocols facilitate integration between LLMs and diverse external systems, knowledge repositories, and computational environments. Through the embedding of structured instructions and responses within contextual frameworks, MCP enables LLMs to better comprehend and process complex external environments, thereby providing a suitable foundation for handling spatiotemporal information and decision logic.
These foundational capabilities and methodological advances have enabled diverse applications of LLMs in urban computing across multiple research domains. Zhang et al. 35 introduced the TrafficGPT framework, which integrates LLMs with domain-specific traffic management expertise to support observation, analysis, and processing of traffic data while facilitating decision support. Similarly, Zhou et al. 36 developed a multi-agent collaborative framework based on LLMs for participatory urban planning, generating land-use plans that consider diverse stakeholder needs through simulated interactions between urban planners and residents. Furthermore, Ning and Liu37 presented UrbanKGent, a unified framework that combines LLMs with urban knowledge graphs for knowledge graph construction. This methodology extracts relevant knowledge from multi-source urban data through heterogeneous perception, geospatialinjected instruction generation, and tool-enhanced iterative trajectory optimization, thereby supporting urban problem diagnosis and solution recommendation.
Despite these promising developments, current applications primarily emphasize textual understanding and generation capabilities, with limited exploration of precise spatiotemporal data processing, particularly at the microscopic individual behavioral level in urban research contexts. This limitation highlights the need for developing targeted methodological approaches that better integrate LLMs' reasoning capabilities with spatiotemporal modeling requirements.
Large-scale spatiotemporal behavior generation requires efficient parallel processing frameworks to handle the computational demands inherent in such applications. While traditional parallel computing frameworks such as MapReduce 38 and Spark39 provide foundational big data processing capabilities, they encounter notable limitations when applied to LLM-based applications that require complex reasoning and interactive processing workflows. Ray40 offers a distributed computing framework specifically designed to support parallel inference and batch processing for LLMs. Advanced optimization tools such as DeepSpeed41 and vLLM42 enhance LLM inference efficiency through sophisticated techniques including continuous batching, tensor parallelism, and PagedAttention mechanisms, achieving notable throughput improvements for large-scale deployment scenarios.
At the system coordination level, multi-agent collaboration frameworks including LangGraph and AgentForce have been developed to provide distributed architectures for coordinating multiple agents in LLM-driven systems. AgentForce, which is built upon the Atlas reasoning engine, enables autonomous reasoning and decision-making capabilities while effectively managing complex workflows in large-scale agent applications. These technological advances provide valuable insights and architectural references for developing the large-scale spatiotemporal behavior generation approach proposed in this research.
In summary, while traditional ABM methods, activity chain simulation techniques, and LLMs have each achieved notable progress in their respective domains, research that effectively integrates these approaches for large-scale urban individual spatiotemporal behavior generation remains relatively limited. Important challenges persist, including: how to enhance the spatiotemporal reasoning capabilities of LLMs, how to construct key application components (tools) for spatiotemporal behavior through MCP protocols, how to design efficient parallel processing frameworks supporting batch generation, and how to ensure the balance between individual diversity and collective consistency in generated spatiotemporal behavior. This research aims to bridge this gap by combining CoT reasoning with MCP-based tool construction to build a system capable of efficiently generating realistic and reasonable urban individual spatiotemporal behavior(Figure 1).
Figure 1: Evolution and Comparison of LLM-based Urban Activity Generation Methods
A theoretical framework for urban individual spatiotemporal behavior generation incorporates MCP-enhanced CoT reasoning (Figure 2). This approach synthesizes time geography, bounded rationality decision theory, the emergent capabilities of LLMs, and MCP, creating a comprehensive individual spatiotemporal behavior simulation and generation system.
Time geography provides the fundamental spatiotemporal constraint theory for this approach. According to Hägerstrand's classical theory17, individual activities are subject to three fundamental constraints: capability constraints, coupling constraints, and authority constraints. These constraints together form an individual's spatiotemporal accessibility range, known as the "spatiotemporal prism." Within this model, these constraints are encoded as contextual
Figure 2: MCP-Enhanced Chain-of-Thought Theoretical Framework
environment parameters through MCP, guiding LLMs to generate activity sequences that conform to realistic physical limitations.
Bounded rationality decision theory provides the cognitive modeling foundation for the approach. Unlike the perfect rationality assumption in traditional economics, Simon's bounded rationality theory43 posits that decisionmakers in real-world environments are constrained by cognitive capacity, information acquisition, and processing time, often adopting "satisficing" rather than "optimizing" strategies. This model incorporates the core tenets of bounded rationality—incremental decision-making, satisficing solution search, and heuristic reasoning—into the CoT design, thereby simulating human decision-making logic in complex spatiotemporal environments, including spatial decisions, activity selection, travel mode choice, and route planning.
The emergent capabilities of LLMs provide the technical and knowledge foundation for the entire system. These pre-trained models trained on large-scale text corpora have developed implicit representations of world knowledge, including human behavioral patterns, social activity regularities, and geographical spatial understanding. CoT reasoning activates the model's step-by-step reasoning capabilities, enabling systematic consideration of multiple factors and constraints while making the cognitive process transparent and revealing implicit knowledge explicitly.
MCP serves as the key innovation of this approach, providing enhanced interaction capabilities beyond traditional tool calling. Through MCP, the system enables the construction of structured spatiotemporal environment representations and supports multi-round reasoning processes, facilitating real-time external environment queries, spatial information retrieval, external database connections, and computational tool integration to create authentic contextual environments for individual spatiotemporal behavior simulation.
Compared to existing research, this approach establishes an integrated simulation mechanism spanning from individual internal decision-making to external environmental interaction by integrating two core components: CoT reasoning and MCP. CoT reasoning simulates the internal decision-making processes of individuals, while MCP facilitates the interaction between individuals and external environments. These components work synergistically to overcome the limitations of traditional methods in terms of authenticity and generalizability.
Based on the theoretical foundation established above, this study proposes a hierarchical architecture comprising three core layers (Figure 3): the autonomous model learning layer, the CoT reasoning layer, and the MCP interaction layer. These layers form a structured hierarchy that establishes a comprehensive methodology for individual spatiotemporal behavior generation. Each layer serves distinct yet interconnected functional purposes, employing specific technical approaches that correspond to three operational mechanisms of LLMs: direct generation based on implicit knowledge, deep reasoning through explicit inference, and environmental perception and interaction capabilities through MCP that encompass both external environmental and inter-individual dynamics.
Figure 3: LLM-based System Architecture and Methodology Framework
Left: Universal LLM Implementation Architecture; Right: LLM-based Methodology for Spatiotemporal Behavior Generation
The autonomous model learning layer represents the fundamental mechanism by which LLMs acquire foundational knowledge and domain-specific reasoning capabilities. This layer establishes the knowledge foundation upon which all subsequent operations are based, and it comprises two principal elements: foundation model selection and domain knowledge fine-tuning.
Foundation model selection constitutes the critical initial phase of system development, as it directly determines the system's comprehension capabilities and reasoning performance. This study evaluates four key dimensions that ensure optimal model performance when selecting open-source foundation models, with reference to established ranking platforms such as the Hugging Face Open LLM Leaderboard: language understanding capability, reasoning and decision-making capacity, parameter efficiency, and fine-tuning adaptability.
Language understanding capability serves as the foundational requirement, demanding that the model demonstrates robust comprehension of the target language while possessing comprehensive commonsense knowledge about realworld patterns. Reasoning and decision-making capacity builds upon this foundation, requiring strong logical reasoning abilities, particularly for models capable of generating coherent chain-of-thought processes and natively supporting tool invocation. Parameter efficiency addresses deployment constraints by achieving optimal balance between computational resources and performance, thereby maximizing model capabilities while minimizing computational overhead. Finally, fine-tuning adaptability ensures rapid domain adaptation through strong few-shot learning capabilities, enabling effective adaptation to target domains with limited annotated data.
The domain knowledge fine-tuning process establishes two complementary knowledge repositories that enhance model training effectiveness. The first repository comprises a specialized spatiotemporal behavior knowledge base that integrates classical research findings from sociology, urban planning, and geography, organized into three components: fundamental concepts, empirical findings, and application cases. This knowledge base encompasses core theories such as time geography and activity pattern theory within its fundamental concepts component, establishing
conceptual networks through definitions, explanations, and associations. The empirical findings component aggregates quantitative research discoveries from global studies, incorporating specific statistical data, behavioral metrics, and measurable relationships between environmental factors and spatiotemporal behaviors. These findings are categorized into "theoretical foundations of human behavior," "spatial and modal choice preferences," and "temporal utilization patterns", providing the model with concrete numerical evidence such as activity frequencies, travel distances, mode choice percentages, and environmental impact coefficients. The application cases component provides typical research examples that serve as specific application contexts for the model3 .
The second repository constitutes a local spatiotemporal behavior database developed for specific research areas, documenting spatial characteristics, activity patterns, and population behaviors within those regions. This database employs multi-source data fusion methods and incorporates four data types: ① regional environmental knowledge including POI, road networks, buildings, land use, and other spatial environmental elements; ② authentic population activity logs collected through structured questionnaire surveys, capturing activity chain characteristics, temporal utilization patterns, travel choice behaviors, social companionship patterns, and personal subjective experiences across different demographic groups, thus reflecting individual-level spatiotemporal behavioral decision patterns and providing microscopic behavioral samples for the model; ③ spatiotemporal big data primarily derived from anonymized mobile signaling data for extracting macroscopic statistical characteristics and activity patterns of population spatiotemporal behavior; ④ social media data from domestic platforms (e.g., Xiaohongshu, Weibo) including geotagged posts, check-in records, and location-based social interactions that reveal activity preferences, place sentiments, and socio-cultural contexts of spatiotemporal behaviors.
These knowledge repositories function synergistically: the knowledge base provides universal theories and patterns, while the local database offers region-specific environmental characteristics. Together, these repositories enhance the model's activity decision-making capabilities in specific contexts.
Building upon the comprehensive knowledge repositories, three sequential knowledge injection methods are implemented to progressively enhance LLMs' capabilities. First, instruction fine-tuning employs Parameter-Efficient Fine-Tuning (PEFT) techniques to strengthen the LLMs' understanding of spatiotemporal behavior-related instructions. The instruction set encompasses diverse spatiotemporal decision tasks including activity planning, route selection, and temporal scheduling, with each instruction explicitly defining input conditions and expected outputs.
Second, CoT Demonstration Learning extracts reasoning processes from high-parameter models to construct activity decision example repositories. Each example includes complete decision steps encompassing problem analysis, constraint identification, solution generation, and evaluation selection. These examples are classified by cognitive complexity, forming progressive learning pathways that guide the LLMs from simple to complex reasoning scenarios. The inclusion of common error patterns and correction processes helps the LLMs recognize and avoid typical decision pitfalls such as constraint omission, preference misinterpretation, and spatiotemporal conflicts.
Finally, MCP Training focuses on developing the LLMs' ability to understand and follow contextual protocols. This training enables LLMs to make appropriate tool selections and execute correct usage patterns based on contextual knowledge, while maintaining protocol consistency across diverse interaction scenarios. Through this three-stage approach, LLMs progressively develop from basic instruction following to contextual reasoning capabilities.
The CoT reasoning layer employs a five-stage progressive structure that decomposes complex activity decisions into explicit reasoning steps. The method employs a structured decision-making framework inspired by cognitive science literature, with each stage building upon previous insights to facilitate computational reasoning that approximates systematic deliberation processes.
Stage 1: Situational Awareness and Problem Definition. Establishes foundational context through analysis of individual characteristics, temporal conditions, location, and environmental factors.
Stage 2: Constraint Identification and Goal Clarification. Identifies relevant temporal limitations, spatial accessibility constraints, personal preferences, and social norms while constructing multi-layered objective systems. Particular attention is given to potentially conflicting constraints and requirements that may emerge during the decision process.
3The application cases component primarily serves future research extensions, aiming to enable individuals to provide precise decision references for urban planning from a microscopic behavioral perspective based on their spatiotemporal behavior data, thereby achieving participatory urban renewal.
The approach implements structured cognitive templates and markup systems to guide decision processing through explicit reasoning workflows encompassing situational analysis, constraint evaluation, and decision trees. Unlike traditional "black box" models, this structured chain-of-thought mechanism enhances interpretability by recording complete decision processes while incorporating human cognitive characteristics. Such integration improves both accuracy and realism of spatiotemporal behavior generation, producing decision-making patterns that authentically reflect human reasoning processes.
The MCP interaction layer is designed as a layered microservice architecture to address the challenges in generating individual spatiotemporal activity-travel chains. The system design decomposes functionalities into four collaborative tiers: the Protocol Layer is designed to establish standardized message formats and communication protocols; the Service Layer comprises six core tool suites implemented as independently deployable microservices; the Integration Layer facilitates connectivity with external data sources and third-party systems; and the Optimization Layer incorporates caching mechanisms, batch processing capabilities, and load balancing strategies. The architecture employs an event-driven paradigm with inter-component communication mediated through a unified message bus infrastructure, ensuring loose coupling, high cohesion, and system extensibility for iterative functional enhancements and performance optimization.
MCP employs structured message formats comprising four fundamental message types: ①Query messages initiated by large language models (LLMs) containing query types, parameters, and contextual information; ②Response messages returned by MCP services including data, status indicators, and metadata; ③Action messages representing model environmental interventions, modifications, or external tool invocations; ④Feedback messages providing operation execution results and updated system states.
All message types utilize unified JSON encoding with clear structural and semantic definitions. MCP supports message referencing and session history maintenance, enabling models to preserve contextual coherence across multi-turn interactions.
Six core tool categories are implemented for individual spatiotemporal activity-travel chain generation. These tools can operate independently or collaboratively to create complex behavioral sequences:
Environmental Perception Tools (Details in B.3) provide environmental condition queries including weather, special events, and emergency situations. These tools support historical, real-time, and predictive temporal modes, enabling environmental factor consideration in activity selection from macro-meteorological to microvenue conditions.
Personal Memory Tools (Details in B.4) manage individual historical behaviors and preferences through hierarchical cognitive structures incorporating event-level, pattern-level, and summary-level memory structures. The system supports dynamic storage, precise retrieval, real-time updates, and natural forgetting mechanisms. Additionally, it provides personalized decision support through intelligent matching of relevant historical experiences to current contexts.
Social Collaboration Tools simulate social relationship networks and coordinate group activities through contact management and social interaction mechanisms. This module employs graph-based representations to calculate social distance and relationship strength, thereby incorporating social dimensions into activity decision-making. (Note: Current experiments simplify the implementation by focusing on close friends' activities and mutual arrangements stored in memory.)
Experience Evaluation Tools assess activity scenarios, locations, and routes through scoring mechanisms for subjective feelings, objective ratings, and planning recommendations. These tools primarily focus on evaluating and rating activity venues and travel routes without involving final outcome reasoning, creating evaluation databases supporting venue analysis and urban spatial optimization.
Extension modules support spatiotemporal behavioral data generation and analysis through three complementary components. Activity-Travel Chain Validation provides basic quality control for LLM-generated sequences, performing feasibility checks to identify potential semantic gaps, errors, or logical inconsistencies. Benchmark Comparative Analysis evaluates the authenticity and representativeness of validated data by comparing outputs with observational big data across spatiotemporal distributions and behavioral characteristics. Visualization and Decision Support Systems enable data exploration and analysis, providing interactive visualization capabilities that display multi-level information ranging from individual trajectories to urban activity heat maps, facilitating both technical validation and practical decision-making processes.
The proposed system employs a large-scale parallel generation architecture that integrates task decomposition, dynamic scheduling, and context caching to achieve computational efficiency for spatiotemporal behavior generation. The system decomposes generation tasks into hierarchical structures and employs dynamic resource allocation to balance computational loads across multiple processing units. Batch processing optimization consolidates similar inference requests to maximize throughput, while hierarchical context caching reduces redundant computations by sharing relevant information across different processing levels. The architecture is implemented using the Ray distributed computing platform in conjunction with vLLM's inference optimization techniques, enabling elastic scaling and dynamic resource allocation.
Within this architecture, the system implements a multi-step iterative workflow for spatiotemporal behavior generation that integrates the system components into a cohesive structure comprising six principal phases: ① persona configuration and contextual initialization, ② daily activity structure planning, ③ activity detail specification, ④ travel route optimization, ⑤ state updating with dynamic adjustment, and ⑥ trajectory validation and refinement. The workflow leverages CoT reasoning to evaluate constraints and alternatives, utilizing MCP for information acquisition and environmental state updates, and employing memory mechanisms to capture cumulative activity effects.
The system incorporates several concrete optimization strategies that operate through the MCP-LLM integration. The system implements adaptive temperature scheduling, employing a higher sampling temperature (τ = 0.7) during chain-of-thought generation phases to encourage exploratory reasoning, while applying a lower temperature (τ = 0.1) during MCP query formulation and final output generation to ensure precision and consistency. The generation process follows a hierarchical planning strategy that adopts a coarse-to-fine approach, initially establishing high-level activity structures with temporal allocations, followed by progressive refinement of specific locations and routes, thereby reducing combinatorial complexity. Additionally, the system leverages historical memory patterns and preferences to introduce soft biases in decision-making processes under similar contextual conditions.
The approach integrates three layers for LLM-based spatiotemporal behavior generation: autonomous learning for knowledge foundations, CoT reasoning for decision-making, and MCP interaction for environmental engagement. The system enables large-scale parallel generation while maintaining consistency. Experiments in a selected urban study area validate technical performance and behavioral realism.
This study examines the Lujiazui area4\* due to its integrated urban functional system that contains diverse activities including financial services, retail commerce, and cultural recreation. The area attracts multiple population groups, including office workers, permanent residents, and visitors, thereby exhibiting diverse behavioral characteristics and varied spatiotemporal distributions. As a representative urban center in China, the research findings offer substantial applicability and research utility.
Specifically, we examine Lujiazui Subdistrict and Weifang New Village Subdistrict, bounded by Yuanshen Road to the east, Eshan Road to the south, and the Huangpu River to the northwest, covering a total area of 9.87 square kilometers (Figure4). The delineated area includes typical urban zones such as the Financial and Trade Core Zone, Central Green Space, Century Avenue corridor, and waterfront public spaces.
Figure 4: Delimitation map of the study area
The experimental data consist of:
4*The study area is delineated by the red-bounded region shown in the figure. This research analyzes human behavioral activities and simulates detailed activity-travel chains for individuals who conduct at least one activity within this designated zone. For activities occurring within the study area, comprehensive behavioral simulations are performed. For activities outside the red-bounded region, only departure, arrival, and transit movements are simulated without detailed activity modeling. While individuals' daily activities may span the entire Shanghai metropolitan area, any person with at least one activity within the study area is included in the simulation framework, ensuring complete coverage of relevant activity-travel patterns.
3.Spatiotemporal Behavioral Data: ①Activity diary survey data consisting of 571 daily activity records from diverse populations in the Lujiazui area, serving as baseline data for training dataset construction and model validation; ②Anonymized mobile signaling data containing spatiotemporal trajectory points of approximately 150,000 users from November 2023, which underwent data cleaning and privacy protection procedures, and were utilized for aggregate-level validation of generated data by comparing spatiotemporal distribution patterns and activity characteristics to assess trend consistency; ③Synthetic training data: Using the two aforementioned datasets, 2,000 individual activity-travel chains with "a priori rationality"5\* were generated through time-varying Markov chain modeling methods for model training and fine-tuning optimization.
This study adopts a comparative experimental framework to evaluate the performance of the proposed methods in activity-travel chain generation tasks. The experimental design comprises four primary components:
Due to the complexity of spatiotemporal behavior generation and evaluation, this study employs a comprehensive evaluation approach to assess the proposed methodology across four critical dimensions: generation quality, reasoning capability, generation diversity and computational performance. The evaluation adopts a multi-batch generation strategy, with each batch independently evaluated to obtain individual performance scores. The highest and lowest scoring batches are then excluded, and final metrics are calculated as the mean of the remaining batch scores. All performance metrics are standardized to a 0-10 scale to ensure comparability and consistency across different evaluation criteria. To maintain objectivity and consistency in the assessment process, GPT-4o-mini serves as an independent third-party evaluation model, utilizing structured template-based prompts to replace conventional expert-based scoring methodologies.
A generation quality assessment method is developed that combines subjective evaluation of individual activity patterns with objective validation using aggregate spatiotemporal data. The subjective evaluation systematically assesses generated activity-travel chains across multiple dimensions using predefined evaluation criteria. The evaluation examines four key dimensions(see C.1): ①Temporal consistency, which examines the logical sequencing of activities,
5*A priori rationality indicates that the synthetic activity-travel chains are generated with predefined statistical constraints derived from the empirical patterns observed in the activity diary and mobile signaling datasets, ensuring the generated data conform to realistic human spatiotemporal behavioral regularities rather than random sequences.
6*Due to time constraints and resource limitations, this comparative analysis has not yet been completed but will be pursued in subsequent research phases.
Figure 5: Schematic of the generation process for this method
realistic nature of time allocation, and reasonable duration of transition times; ②Activity coherence, which evaluates the logical relationships within activity sequences, alignment between trip purposes and activity types, and logical flow of activity chains; ③Persona conformity, which verifies the alignment between generated activity patterns and specified individual characteristics; ④Behavioral authenticity, which assesses the realistic nature of activity content, duration, and locations. Each dimension is scored on a 10-point scale, with the overall score derived through weighted averaging.
Complementing the subjective assessment, objective validation establishes quantitative benchmarks using real-world mobile signaling data. The validation conducts quantitative analysis across spatial and temporal dimensions. Spatial validation employs kernel density estimation to assess the similarity between observed and generated urban activity distributions, conducted at two temporal scales: all-day activity hotspot distribution and time-segmented hotspot distribution. The former aggregates total visit frequencies across all activity points throughout the day, while the latter analyzes time-specific population distributions at specific time intervals. Spatial distribution similarity is quantified using Jensen-Shannon divergence:
$$JS(P \parallel Q) = \frac{1}{2} D{KL}(P \parallel M) + \frac{1}{2} D{KL}(Q \parallel M), \tag{1}$$
where P and Q represent probability distributions of real and generated data respectively, and M = 1 (P + Q). The JS divergence ranges from 0 to 1, with smaller values indicating higher distributional similarity.
Temporal validation focuses on the distributional similarity of start times, end times, and durations across various activity types, employing the Kolmogorov-Smirnov test:
$$D{KS} = \sup{x} \left| F_n(x) - F_m(x) \right|, \tag{2}$$
where Fn(x) and Fm(x) denote the empirical cumulative distribution functions (CDFs) of real and generated data, respectively. Furthermore, daily temporal distribution patterns are validated by comparing population presence probability density curves across different time periods.
The overall objective quality score integrates spatiotemporal indicators:
$$Q{\text{obj}} = 0.5 \times \left(1 - \frac{\text{JS}{\text{spatial}}}{\ln(2)}\right) + 0.5 \times (1 - \text{KS}_{\text{temporal}})$$ (3)
The final generation quality is computed as:
$$Q{\text{total}} = \alpha \times Q{\text{subjective}} + (1 - \alpha) \times Q_{\text{obj}}, \tag{4}$$
where α represents the weighting parameter that can be adjusted according to application scenarios to balance the relative importance of subjective and objective evaluations (set to α = 0.5 in this study).
Reasoning capabilities are assessed by analyzing CoT quality during spatiotemporal behavior generation. Other large language models are employed to evaluate reasoning chains across five critical dimensions(see C.2 for details).
Information collection completeness examines whether models identify temporal constraints, spatial positioning, user preferences, resource limitations, environmental factors, etc. Analytical thinking depth evaluates analysis across temporal, spatial, cost-benefit, risk assessment, and personalization considerations. Logical reasoning rigor examines causal relationships between reasoning steps, assumption validity, and the logical foundations of conclusions. Decisionmaking rationality assesses how transparently models balance conflicting constraints. Tool invocation strategy analyzes the appropriateness of timing, sequencing, and parameter configuration.
The DTW-clustering sequence pattern-based approach for assessing generative diversity systematically transforms continuous spatiotemporal behaviors into discrete sequential patterns, thereby enabling precise quantification of sequence similarity through Dynamic Time Warping (DTW) distance metrics. This approach constructs activity sequences of length 96 with 15-minute temporal granularity, represented as S = {s1, s2, . . . , s96}, where each element st ∈ {life services,sports & leisure, employment, tourism, residence,shopping, dining, travel} denotes the predominant activity category at time step t.
The DTW algorithm serves as the foundation for measuring sequence similarity by constructing a cumulative distance matrix and employing dynamic programming to identify the optimal alignment path. The recurrence relation is formulated as:
$$\begin{aligned} \operatorname{DTW}(i,j) &= d(s_i,s_j) + \min \begin{cases} \operatorname{DTW}(i-1,j) & \text{(insertion)} \ \operatorname{DTW}(i,j-1) & \text{(deletion)} \ \operatorname{DTW}(i-1,j-1) & \text{(match)} \end{cases}$$
where d(si , sj ) represents the local distance function between sequence elements si and sj . For computational efficiency, the distance function employs a binary measure: d(si , sj ) = 0 if si = sj , and d(si , sj ) = 1 otherwise (treating all inter-category distances as equivalent despite their varying semantic relationships).
Subsequently, for the ensemble of N generated activity chains, pairwise DTW distances are computed to construct an N × N dissimilarity matrix D. To identify underlying behavioral patterns within this high-dimensional space, hierarchical clustering is applied using Ward's linkage criterion, which minimizes the increment in within-cluster sum of squares. The merge distance between clusters Ci and Cj is defined as:
$$d(C_i, C_j) = \sqrt{\frac{2n_i n_j}{n_i + n_j}} \cdot |\boldsymbol{\mu}_i - \boldsymbol{\mu}_j|_2$$ (6)
where ni and nj denote the number of samples in clusters Ci and Cj , respectively, and µi and µj represent their corresponding cluster centroids in the DTW distance space.
The optimal number of clusters k ∗ is determined by maximizing the silhouette coefficient:
$$s_i = \frac{b_i - a_i}{\max{a_i, b_i}} \tag{7}$$
where ai represents the mean intra-cluster distance for observation i, and bi denotes the mean distance to the nearest neighboring cluster. The silhouette coefficient ranges from -1 to 1, with higher values indicating better clustering quality.
The diversity assessment employs between-cluster average distance B and within-cluster average distance W to construct the diversity index:
$$DIV = \frac{B - W}{B + W} \quad \text{where DIV} \in [-1, 1]$$ (8)
This index is transformed to a standardized scoring scale using:
$$Score{GD} = 5.5 + 4.5 \times DIV$$ where $Score{GD} \in [1, 10]$ (9)
where ScoreGD represents the Generation Diversity score, with higher values indicating greater pattern diversity across activity chain sets.
Computational performance was evaluated across two dimensions: computational efficiency and resource consumption. All experiments were conducted on a standardized testing environment7\*
Computational efficiency was quantified using average generation time as the primary metric, representing the time required for the system to generate a complete daily spatiotemporal behavior pattern for a single individual, expressed in seconds per person-day (s/person·day). The standard deviation of generation times was calculated to assess performance stability. Resource consumption analysis focused on GPU memory utilization during system operation, with real-time monitoring capturing both average and peak memory usage to identify baseline requirements and potential bottlenecks.
We conducted this experiment using the proposed method under standardized conditions. To assess performance differences among base models, four selected open-source base models were evaluated. Given that parameter scale affects performance, the selected models covered a parameter range from 7B to 13B parameters. The experimental design comprised 10 batches of 50 samples for each model, yielding 500 samples per model and a total dataset of 2,000 samples. Each generation process for a single data instance involved an average of 12-18 tool calling sequences, encompassing geographic information queries, temporal planning, activity reasoning, path optimization, and other computational steps, with an average token consumption of approximately 8,000 tokens(Figure 6). The experimental results indicate that all four models perform comparably across all dimensions and can successfully complete spatiotemporal behavior generation tasks, but nevertheless exhibit their own characteristics in subtle differences and specific scenarios.
The experimental results(Table 1) show consistent performance across different base models under the MCP+CoT framework, despite significant differences in parameter count and architecture. Average generation quality scores differ by only 0.50 points across all models. Notably, the 7B DeepSeek model outperforms the 13B LLAMA-2 model (8.36 vs. 8.22), indicating that parameter count does not determine performance quality. This consistency extends to other evaluation dimensions: reasoning capabilities remain similar across models (CoT scores: 7.24-7.63), and computational efficiency shows stable performance (generation time: 2.2-3.0 min/person-day) regardless of model architecture. These findings suggest that the MCP+CoT framework supports relatively consistent task performance, Seemingly independent of the underlying model complexity under specific test configurations and task constraints. Success appears to depend primarily on the model's basic world knowledge and ability to use tools correctly, rather than architectural sophistication. The differences between models reflect implementation details rather than fundamental capability gaps, confirming that the framework works effectively across diverse model configurations.
7*Testing environment specifications: NVIDIA A800-80GB GPU, Intel Xeon Gold 6348 processor, 100GB RAM, CUDA 12.4 runtime environment. The results may vary depending on different deployment environments and hardware configurations.
Figure 6: Average Token Distribution Across Base Models for Individual Spatiotemporal Behavior Generation
Given the comparable performance across all models, GLM-4-9B was selected for subsequent experiments primarily due to its specialized optimization for Chinese language processing and superior contextual understanding of urban spatiotemporal behaviors. While DeepSeek-R1-7B achieved the highest generation quality score (8.36), GLM-4-9B demonstrates better semantic comprehension and cultural adaptability specifically for Chinese contexts, which is critical for generating realistic spatiotemporal behavior patterns. Its deep training on Chinese corpora enables more accurate interpretation of location semantics, activity patterns, and cultural behavioral norms essential for this task domain.
Table 1: Performance Comparison of Base Models for Individual Spatiotemporal Behavior Generation (N = 4 × 500, n = 10 × 50)
| Evaluation Dimension |
Sub dimension/Metric |
GLM-4-9B 0414 (9B) |
DeepSeek-R1- Distill-Qwen-7B (7B) |
LLAMA-2- 13B (13B) |
Bloom-7B1 (7B) |
|---|---|---|---|---|---|
| Generation | Subjective Individual (Qsubjective) |
7.45 ± 1.07 | 7.61 ± 0.80 | 7.54 ± 1.03 | 7.22 ± 0.91 |
| Quality | Objective Aggregate (Qobj) |
8.70 ± 0.45 | 9.10 ± 0.42 | 8.90 ± 0.38 | 8.50 ± 0.48 |
| Weighted Average (Qtotal) |
8.07 ± 0.58 | 8.36 ± 0.45 | 8.22 ± 0.55 | 7.86 ± 0.51 | |
| Reasoning Capability |
CoT Quality Assessment |
7.55 ± 1.11 | 7.62 ± 0.78 | 7.63 ± 1.05 | 7.24 ± 0.83 |
| Evaluation Dimension |
Sub dimension/Metric |
GLM-4-9B 0414 (9B) |
DeepSeek-R1- Distill-Qwen-7B (7B) |
LLAMA-2- 13B (13B) |
Bloom-7B1 (7B) |
|---|---|---|---|---|---|
| Generation Diversity |
Behavior Pattern ∗ Clusters (k ) |
11 | 9 | 15 | 8 |
| Diversity Score | 7.28 | 7.19 | 7.71 | 6.83 | |
| Computational Performance |
Generation Time (min/person-day) |
2.4 ± 0.9 | 2.7 ± 0.7 | 3.0 ± 1.1 | 2.2 ± 0.5 |
| GPU Memory Usage (GB) |
19.8 ± 2.5 | 16.6 ± 2.2 | 23.9 ± 3.2 | 16.2 ± 1.7 | |
| Peak Memory Usage (GB) |
22.8 | 19.5 | 28.7 | 19.6 |
To systematically assess the differential contributions of each component to spatiotemporal behavior generation quality, ablation experiments were performed with GLM-4-9B as the baseline model. Individual components were sequentially removed to quantify their impact on system performance (n=500). The experimental results are shown in Figure 7.
Figure 7: Ablation Study Results: Impact of Component Removal on Generation Quality
The ablation study reveals a clear hierarchy of component importance, with the spatial navigation tool serving as the foundational element of the entire system. Its removal resulted in severe performance degradation, reducing generation quality to 1.85 points—a 75.1% decline from baseline performance. This substantial degradation primarily stems from the system's inability to process spatial location information and maintain geographic constraints. The high standard deviation reflects a bimodal distribution of output quality: generated samples were either completely unusable or marginally acceptable, with the latter primarily relying on recombination of knowledge injected during the fine-tuning stage rather than systematic spatial reasoning.
CoT reasoning demonstrated the second-highest impact on system performance, with its absence causing a substantial 42.4% degradation to 4.27 points. Without this logical scaffolding, the system regressed to direct generation based on statistical patterns, losing its capacity for stepwise reasoning and multi-factor consideration. This degradation was particularly pronounced in complex decision scenarios, where the decision-making process became completely opaque and generated outputs exhibited excessive homogenization, resembling results from probability distribution fitting rather than reasoned human behavior. The substantial standard deviation indicates varying dependency on reasoning mechanisms across different task types.
Personal memory and implicit knowledge training both contributed significantly to system capabilities. The personal memory tool's removal led to a 26.5% performance decline (5.45 points), primarily manifesting as severe homogenization of individual behavior patterns and complete loss of learning adaptation capabilities. DTW clustering analysis revealed that behavior pattern clusters dramatically reduced from 11 to 5, confirming substantial diversity loss. Similarly, eliminating implicit knowledge training resulted in a 21.5% degradation (5.82 points), as the system lost its foundation of domain expertise and social normativity, making generated behaviors deviate significantly from realistic human behavioral patterns.
Other components demonstrated varying degrees of impact on system performance. Environmental perception tool absence caused a 13.9% decline (6.38 points), primarily affecting the system's ability to perceive external environmental factors and adapt contextually to real-world conditions. Temporal management tool removal resulted in a 11.0% degradation (6.59 points), with impacts mainly on the system's understanding of daily activity timelines and temporal flow coordination. Social collaboration tool showed minimal effects (7.15% degradation to 6.88 points), which may be attributed to the current implementation's limited scope (primarily adding friends' activity patterns to personal memory or generating social invitations, rather than comprehensive interpersonal social interaction processing) and the experimental dataset's focus on individual activities. The experience evaluation tool's removal showed negligible impact with only a slight decline to 7.38 points, consistent with its designed role in supporting future research extensions rather than core generation logic.
The ablation results reveal distinct importance levels across system components. Chain-of-thought reasoning appears essential for maintaining logical coherence in the tested scenarios, with its removal resulting in substantial performance degradation under the experimental conditions. Within the MCP tool system, spatial navigation emerges as the foundational component, with its absence leading to near-complete system failure. Other MCP tools show varying importance: personal memory and environmental perception contribute meaningfully to performance, while social collaboration and experience evaluation demonstrate minimal impact. These findings suggest that CoT reasoning and spatial navigation should be considered essential components, while other MCP tools can be configured selectively based on application requirements and computational constraints.
To evaluate the computational efficiency and scalability of the MCP CoT methodology, parallel performance evaluations were conducted using the unquantized GLM-4-9B model on A800 80G hardware. The experiment generated 1,000 person-day samples while varying the number of parallel workers from 2 to 12. Each worker operates independently to process individual sample generation tasks, enabling simultaneous generation of multiple person-day data samples without task interdependence. All experiments utilized the vLLM inference optimization engine.
| Parallel Workers | Mean Generation Time | Mean Memory Usage |
|---|---|---|
| (minutes/sample) | (GB) | |
| 2 | 1.30 | 38.4 |
| 4 | 0.70 | 51.7 |
| 8 | 0.30 | 67.2 |
| 12 | 0.17 | 76.8 |
Table 2: Performance Metrics under Different Parallel Configurations
Increasing from 2 to 8 parallel workers achieved substantial performance improvements, with mean generation time per sample decreasing from 1.30 minutes to 0.30 minutes, representing a 77% reduction in processing time. Memory consumption scaled predictably from 38.4GB to 67.2GB, remaining within the 80GB system capacity. Scaling to 12 workers further reduced generation time to 0.17 minutes while consuming 76.8GB of memory. However, acceleration gains diminish at higher parallelization levels due to memory bandwidth constraints and inter-worker communication overhead.
The results demonstrate that increasing parallelization achieves substantial performance improvements through independent task distribution across multiple workers. This validates that the MCP CoT methodology can effectively increase generation speed by scaling parallel workers to meet large-scale sample generation requirements, though efficiency gains diminish at higher worker counts due to hardware bottlenecks.
This investigation establishes an MCP-enhanced chain-of-thought framework for urban spatiotemporal behavior generation, contributing to theoretical, technical, and practical advances that partially address persistent challenges in computational urban behavior modeling.
Despite these substantial advances, several interconnected limitations constrain the methodology's current scope and effectiveness, necessitating acknowledgment and future development efforts.
Based on current achievements and identified limitations, future research should focus on advancing the following key aspects:
• Multi-dimensional Evaluation Framework Challenges: This presents a fundamental paradox representing one of the most challenging aspects in this field: if definitive evaluation methods existed to accurately assess synthetic behavioral authenticity, sophisticated simulation techniques would be largely unnecessary. Current approaches validate macro-level consistency with real-world trends, yet this creates potential vulnerability to overfitting observable data distributions without capturing underlying behavioral authenticity. Future research must develop frameworks that balance assessment rigor with practical feasibility, focusing on emergent behavioral properties rather than direct pattern matching.
This study presents a framework for individual spatiotemporal behavior generation using MCP-enhanced chain-ofthought large language models. The proposed approach alleviates important limitations of traditional behavior modeling methodologies by integrating natural language understanding capabilities with spatiotemporal reasoning mechanisms.
Key findings from experimental validation demonstrate the framework's effectiveness across multiple dimensions. The Shanghai Lujiazui district case study shows that the methodology generates realistic activity patterns with quality scores ranging from 7.86 to 8.36 across different base models. Parallel processing experiments reveal substantial efficiency gains, reducing generation times from 1.30 to 0.17 minutes per sample when scaling from 2 to 12 processes. Component ablation studies confirm the critical importance of chain-of-thought reasoning and spatial navigation tools, while other MCP components contribute varying levels of performance enhancement.
The research contributes to the intersection of urban computing, artificial intelligence, and behavioral science through several innovations. The integration of structured reasoning processes with external tool interaction capabilities addresses fundamental challenges in capturing both individual decision-making logic and environmental constraints. The comprehensive MCP framework with specialized tool categories provides a systematic approach to spatiotemporal data processing, while the parallel processing architecture enables practical large-scale deployment.
Despite these advances, several limitations constrain the methodology's current scope. Evaluation frameworks for synthetic behavioral data remain complex, individual behavior modeling faces inherent unpredictability challenges, and spatial-temporal generalization requires broader empirical validation across diverse urban contexts and extended time periods. Future research should focus on enhancing cross-regional generalization, incorporating real-time adaptation mechanisms, and expanding applications to diverse urban contexts. Priority areas include developing multimodal data fusion capabilities, advancing evaluation methodologies for synthetic behavioral authenticity, and extending the framework to model complex social interactions and collective behavior patterns.
The methodology's capacity to generate spatiotemporal behaviors that correspond with validation data while maintaining computational efficiency under tested conditions suggests promising directions for large-scale urban modeling applications. This work advances the integration of linguistic reasoning with spatial analysis, contributing to the development of responsive urban systems that can adapt to evolving population needs and support evidence-based urban planning decisions.
[22] Ling Yin, Nan Lin, and Zhiyuan Zhao. Mining daily activity chains from large-scale mobile phone location data. Cities, 109:103013, 2021.
[23] Chandra R Bhat, Jessica Y Guo, Sivaramakrishnan Srinivasan, and Aruna Sivakumar. Comprehensive econometric microsimulator for daily activity-travel patterns. Transportation Research Record, 1894(1):57–66, 2004.
[24] Theo Arentze, Frank Hofman, Henk Van Mourik, and Harry Timmermans. Albatross: multiagent, rule-based model of activity pattern decisions. Transportation Research Record, 1706(1):136–144, 2000.
[25] Matthew J Roorda, Eric J Miller, and Khandker MN Habib. Validation of tasha: A 24-h activity scheduling microsimulation model. Transportation Research Part A: Policy and Practice, 42(2):360–375, 2008.
[26] Jan Drchal, Michal Certick ˇ y, and Michal Jakob. Data-driven activity scheduler for agent-based mobility models. ` Transportation Research Part C: Emerging Technologies, 98:370–390, 2019.
[27] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020.
[28] Sang Michael Xie, Aditi Raghunathan, Percy Liang, and Tengyu Ma. An explanation of in-context learning as implicit bayesian inference. arXiv preprint arXiv:2111.02080, 2021.
[29] Yuebing Liang, Yichao Liu, Xiaohan Wang, and Zhan Zhao. Exploring large language models for human mobility prediction under public events. Computers, Environment and Urban Systems, 112:102153, 2024.
[30] Shuai Liu, Ning Cao, Yile Chen, Yue Jiang, and Gao Cong. nextlocllm: next location prediction using llms. arXiv preprint arXiv:2410.09129, 2024.
[31] Jie Feng, Yuwei Du, Jie Zhao, and Yong Li. Agentmove: Predicting human mobility anywhere using large language model based agentic framework. arXiv preprint arXiv:2408.13986, 2024.
[32] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems, 35:24824–24837, 2022.
[33] Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. Advances in neural information processing systems, 35:22199–22213, 2022.
[34] Timo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu, Maria Lomeli, Eric Hambro, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom. Toolformer: Language models can teach themselves to use tools. Advances in Neural Information Processing Systems, 36:68539–68551, 2023.
[35] Siyao Zhang, Daocheng Fu, Wenzhe Liang, Zhao Zhang, Bin Yu, Pinlong Cai, and Baozhen Yao. Trafficgpt: Viewing, processing and interacting with traffic foundation models. Transport Policy, 150:95–105, 2024.
[36] Zhilun Zhou, Yuming Lin, Depeng Jin, and Yong Li. Large language model for participatory urban planning. arXiv preprint arXiv:2402.17161, 2024.
[37] Yansong Ning and Hao Liu. Urbankgent: A unified large language model agent framework for urban knowledge graph construction. arXiv preprint arXiv:2402.06861, 2024.
[38] Jeffrey Dean and Sanjay Ghemawat. Mapreduce: simplified data processing on large clusters. Communications of the ACM, 51(1):107–113, 2008.
[39] Matei Zaharia, Mosharaf Chowdhury, Michael J Franklin, Scott Shenker, and Ion Stoica. Spark: Cluster computing with working sets. In 2nd USENIX workshop on hot topics in cloud computing (HotCloud 10), 2010.
[40] Philipp Moritz, Robert Nishihara, Stephanie Wang, Alexey Tumanov, Richard Liaw, Eric Liang, Melih Elibol, Zongheng Yang, William Paul, Michael I Jordan, et al. Ray: A distributed framework for emerging {AI} applications. In 13th USENIX symposium on operating systems design and implementation (OSDI 18), pages 561–577, 2018.
[41] Jeff Rasley, Samyam Rajbhandari, Olatunji Ruwase, and Yuxiong He. Deepspeed: System optimizations enable training deep learning models with over 100 billion parameters. In Proceedings of the 26th ACM SIGKDD international conference on knowledge discovery & data mining, pages 3505–3506, 2020.
[42] Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph Gonzalez, Hao Zhang, and Ion Stoica. Efficient memory management for large language model serving with pagedattention. In Proceedings of the 29th Symposium on Operating Systems Principles, pages 611–626, 2023.
[43] Herbert A Simon. A behavioral model of rational choice. The quarterly journal of economics, pages 99–118, 1955.
Table 3: Spatiotemporal Behavior Research Literature: A Systematic Classification Framework
| Theme Classification |
Research Direction | Core Findings and Application Value |
|---|---|---|
| 1.1 Time Geography Theory Applications |
Human activities are constrained by spatiotemporal factors, with most activities concentrated at key locations. Activity space is highly correlated with cognitive maps. |
|
| 1.2 Human Mobility Trajecto ries from Behavioral Geogra phy Perspective |
Human movement patterns are highly predictable, showing alter nating patterns of habitual repetition and occasional exploration, influenced by socioeconomic factors. |
|
| 1. Basic Theoretical and Empirical Applications of |
1.3 Cross-cultural Validation of Activity Pattern Theory |
Asian urban residents show smaller differences between week day/weekend activities than Europeans/Americans. Family struc ture affects activity time allocation, with cross-cultural differences in shopping-leisure combinations. |
| Human Behavior |
1.4 Spatiotemporal Behav ioral Constraint Theory Per formance |
Women's activity spaces are generally smaller than men's. Mod ern communication reduces distance dependence. Urban infras tructure affects residents' accessible space. |
| 1.5 GPS and Mobile Data based Behavior Tracking |
Weekday activity spaces are smaller than weekends. Mobile data reveals travel characteristics of Asian urban residents. Public space usage is closely related to weather conditions. |
|
| 1.6 Subjective vs. Objective Activity Space Comparison |
Cognitive maps are smaller than actual spaces. Familiar area distances are underestimated while unfamiliar areas are overesti mated. Transportation mode affects spatial perception. |
|
| 2.1 Time Budget Alloca tion Among Different Social Groups |
High-income groups work longer hours but have higher leisure quality. Women spend more time on household tasks. Education level positively correlates with reading time. |
|
| 2.2 Weekday vs. Weekend Ac tivity Pattern Differences |
Weekend leisure activities increase, trip chain complexity rises, activity start times are delayed, and family joint activities signifi cantly increase. |
|
| 2.3 Urban vs. Rural Resi dents' Time Use Comparison |
Large cities have long commute times. Rural areas have high proportions of local activities. Urban elderly have more outdoor activity time and late-night activities. |
|
| 2. Actual Patterns of Time Use |
2.4 Gender, Age, and Occupa tion Effects on Time Alloca tion |
Working women reduce leisure rather than work time. Middle aged weekend family activities are most frequent. Professionals have flexible but long working hours. |
| 2.5 Activity Trade-off Deci sions Under Time Pressure |
Time pressure first reduces household tasks and social activities. Under stress, activity space contracts, trip chains become complex, often sacrificing quality for quantity. |
|
| 2.6 Seasonal and Climate Ef fects on Time Use |
High temperatures reduce walking. Rain and snow increase indoor activities. Winter reduces outdoor activities. Weather affects leisure more than necessary activities. |
|
| 2.7 International Time Use Comparisons |
Nordic countries have equal household task division, Asia shows large differences. Americans watch more TV. Japanese work long hours with short sleep. Asian elderly spend more time on care. |
|
| Continued on next page |
Table 3 – continued from previous page
| Table 3 – continued from previous page | ||
|---|---|---|
| Theme Classification | Research Direction | Core Findings and Application Value |
| 3.1 Spatial Choice Character istics for Different Activity Types |
Shopping driven by price sensitivity. Leisure activities value environmental quality. Social activities often occur in intermediate locations or highly accessible areas. |
|
| 3.2 Distance Decay Effects in Destination Choice |
Daily shopping concentrates at short distances. Urban core dis tances are underestimated. Necessities have high distance sensi tivity. Distance matters when choices are diverse. |
|
| 3.3 Relationship Between Spatial Cognition and Actual Decision Behavior |
Decisions mainly based on cognitive maps rather than actual distances. Familiar areas have higher estimation accuracy. Drivers have more accurate spatial perception. |
|
| 3. Real Preferences in Spatial Choice |
3.4 Anchor Point Effects on Activity Space Formation |
Non-work activities mostly occur along home-work axis. Major anchor points cover most activity space. Transportation hubs become secondary anchor points. |
| 3.5 Built Environment Effects on Spatial Selection Mecha nisms |
High-density development promotes local activities. Mixed land use increases local activities. Walkable areas increase non motorized travel. |
|
| 3.6 Cultural and Social Net work Factors Shaping Spatial Preferences |
Social activities occur in network overlap areas. Kinship relation ships have low distance sensitivity. Cultural background affects spatial choice and activity preferences. |
|
| 3.7 Balance Between Famil iarity and Diversity Seeking |
Routine activities prefer familiar places. New activities tend to ward exploration. Location preferences stabilize after multiple visits. Life changes increase exploration. |
|
| 4.1 Key Factors and Weights in Transportation Choice |
Time cost is the primary factor. Cost weight decreases with in come. Elderly value comfort. Women focus on convenience. |
|
| 4.2 Transportation Choice Characteristics of Different Socioeconomic Groups |
High-income groups use private cars frequently. Women use pub lic transit for chain trips. Middle-aged use multiple transportation flexibly. Elderly have small travel ranges. |
|
| 4.3 Actual Factors Influencing Route Choice Decisions |
Routine routes dominate. Real-time adjustments during peak hours. Navigation users have variable routes. Familiar path deci sions are quick. Traffic information influences choice. |
|
| 4. Actual Behavior in Transportation Mode Choice |
4.4 Spatiotemporal Character istics of Public vs. Private Transportation Use |
Public transit has bimodal peaks, private cars are uniform. Non peak public transit use is high. Business around transit stations is active. Convenient transfers increase cross-regional travel. |
| 4.5 Usage Patterns of New Transportation Modes |
Bike-sharing users are mostly middle-class, partially replacing walking and public transit. Ride-hailing peaks on weekend nights. Young people use more, getting information via smartphones. |
|
| 4.6 Cognitive and Psychologi cal Factors' Impact on Travel Decisions |
Environmental attitudes have limited correlation with low-carbon travel. Perceived distances are biased long. Habits influence decisions. Transportation choice relates to identity. |
|
| 4.7 Thresholds and Condi tions for Transportation Mode Switching |
Long-term car use reduces switching willingness. Major events provide change opportunities. Mandatory policies are more effec tive. Experience increases acceptance. |
|
| 5. Actual Patterns of |
5.1 Typical Activity Chain Patterns and Occurrence Fre quency |
Home-work-home chains dominate. Few activity points constitute most chains. Few people contribute complex chains. Shopping dining combinations are high. |
| Activity Chains and Sequences |
5.2 Activity Combination and Sequencing Characteristics of Different Groups |
Women have more shopping and escort activities. Singles have variable activities. High-income work-leisure differences are small. Families with children have complex chains. |
| Continued on next page |
| Table 3 – continued from previous page | | | | |
|-----------------------------------------------|-----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--|--|
| Theme Classification | Research Direction | Core Findings and Application Value | | |
| | 5.3 Spatiotemporal Configura
tion of Planned vs.
Sponta
neous Activities | Work is planned in advance, leisure is often spontaneous. Spon
taneous activities are short, filling gaps between main activities
with high spatial dispersion. | | |
| | 5.4 Triggers for Activity Ad
justment and Rescheduling | Weather changes trigger adjustments. Mobile phones promote
instant changes. Congestion changes destinations. Social interac
tions cause unplanned activities. Time pressure cancels activities. | | |
| | 5.5 Empirical Studies of Ac
tivity Coordination Among
Family Members | Dual-career couples coordinate spatiotemporally to share house
hold tasks. Children's activities are coordination core. Resource
sharing links activity chains. Work distance affects escort cooper
ation. | | |
| | 5.6 Spatiotemporal Organiza
tion Patterns of Work and
Non-work Activities | Non-work activities revolve around work/home. Work-home dis
tance affects lunch activities. Flexible work increases non-work
activities. Commute chains are significant. | | |
| | 5.7 Activity Chain Complex
ity and Personal Characteris
tic Correlations | Children increase family activity chain complexity. Facility dis
tance increases chain trips. Women have longer chains. Income
positively correlates with complexity. | | |
| | 6.1
Social
Economic
At
tributes' Impact on Activity
Space Range | Low-income car-free households have small activity spaces. Vul
nerable groups have fewer accessible facilities.
Women have
smaller activity ranges.
Socioeconomic status affects activity
point quantity. | | |
| 6. Interactive
Relationships
Between | 6.2 Life Cycle Stage and Spa
tiotemporal Behavior Change
Correlations | Childbirth reduces women's activity space.
Early retirement
shows large changes. Newlyweds increase joint activities. Life
events affect behavior patterns short-term. | | |
| Individual
Attributes and
Environmental | 6.3
Family
Structure
Con
straints on Member Activity
Arrangements | Young children reduce parents' leisure. Women undertake family
care. Single-parent families have less social interaction but more
flexibility. Family roles shape activity differences. | | |
| Factors | 6.4 Quantitative Impact of
Built Environment Character
istics on Activity Choice | High density promotes non-motorized travel.
Mixed land use
reduces car use. Walkable design increases walking. Built envi
ronment significantly affects behavior. | | |
| | 6.5 Urban Form and Land Use
Shaping of Behavior Patterns | Polycentric cities have short commutes.
Compact residential
promotes local activities. Mixed land use reduces travel distances.
Urban form has significant impact. | | |
| 7. Actual Impact
of Technological | 7.1 Smartphone and Naviga
tion App Changes to Route
Choice | Navigation increases new route attempts, reduces peak time, sup
ports complex path choices, lowers perceived waiting time, affects
spatial cognition. | | |
| Change on
Behavior
Patterns | 7.2 Social Media Impact on
Activity Decisions and Loca
tion Choice | Social media check-ins affect new location choices. Popularity
influences decisions. Social data improves prediction ability. Re
views change choices. | | |
| | 7.3
E-commerce
Changes
to Shopping Behavior Spa
tiotemporal Characteristics | Online shopping reduces physical store frequency but increases
stay time. Strong substitution for standard goods, weak for experi
ence goods. Creates new consumption behaviors, changes spatial
distribution. | | |
| | 7.4 Remote Work Technol
ogy's Actual Impact on Com
muting Patterns | Remote work reduces commuting but increases other activity
distances. Activity space reorganization, peak dispersion, hybrid
work increases non-work activities. | | |
| | 7.5 Location-based Service
Activity
Recommendations'
Behavioral Guidance | Location service recommendations are widely accepted, increase
new location exploration, greatly affect shopping and dining, push
notifications increase local activities. | | |
| | | Continued on next page | | |
| Theme Classification | Research Direction | Core Findings and Application Value | | |
|----------------------|-----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--|--|
| | 7.6 New Human Mobility Pat
terns Revealed by Big Data
Analysis | Human movement is highly predictable, activities concentrate
at few locations, showing periodicity. Individual trajectories are
stable, populations divide into returning/exploring types. | | |
| | 7.7 Generational Differences
in Technology Use and Behav
ioral Impact | Youth frequently adjust plans via mobile devices. Smartphones
expand activity space.
Elderly are cautious about technology
adoption. Obvious generational digital divide. | | |
Table 3 – continued from previous page
Answer: "Mobile phone data analysis reveals that Singapore residents' daily activities exhibit highly ordered distribution patterns in the temporal dimension, forming six main time periods, each with specific activity combinations. The morning period (6:30-9:00) shows highly concentrated unidirectional movement patterns, with 83.7% of activities being departure from home, forming a distinct travel peak with an average duration of only 31 minutes. During work hours (9:00-17:00), activities are mainly concentrated at workplaces (72.4%), but 23.5% of people engage in brief outings, particularly during 12:00-14:00, forming a midday minor peak. The evening rush hour (17:00-19:30) is more dispersed than the morning peak, with 46.7% of people adding extra activities on their way home. The evening period (19:30-22:30) shows the highest activity diversity, including household activities (37.6%), social activities (31.2%), and leisure activities (19.7%). The nighttime period (22:30-6:30 next day) has the lowest activity level of the entire day, accounting for only 4.2% of total activities, mainly consisting of homeward journeys. Weekend temporal distributions differ significantly, with no distinct morning and evening peaks, and activity peaks occurring between 11:00-16:00, with average outbound activity duration extended by 76 minutes. Notably, different socioeconomic groups show distinct temporal distribution differences: high-income groups have later activity peaks, leaving workplaces an average of 58 minutes later than low-income groups; young adults (18-24 years) have noticeably delayed activity periods, with evening activity peaks after 22:00."
Answer: "Residents of different community types in Beijing exhibit distinct differences in non-commuting travel, fully reflecting the influence of the built environment. Work-unit community residents show high-frequency, short-distance, highly localized non-commuting travel characteristics, averaging 2.1 non-commuting activities per day with an average travel distance of 1.3 km, and 76.3% of non-commuting activities completed within the community; walking and cycling account for 72.5% of non-commuting trips, public transport 18.7%, and private cars only 8.8%. Commercial housing community residents exhibit low-frequency, long-distance, dispersed characteristics, averaging 1.8 non-commuting activities per day with an average travel distance of 4.2 km, with only 33.7% completed within the community; private car usage reaches 46.2%, public transport accounts for 28.4%, and walking and cycling only 25.4%. Affordable housing community residents show moderate frequency, moderate distance, bipolar characteristics, averaging 1.9 non-commuting activities per day with an average travel distance of 2.7 km; necessary activities like shopping are mainly short-distance, non-motorized (64.1%), while discretionary activities like leisure and entertainment are mainly long-distance, motorized (58.3%), reflecting the limitations of community environments lacking facilities. These differences clearly indicate that compact mixed-use community environments can significantly promote short-distance, non-motorized non-commuting travel patterns, while functionally single, facility-lacking communities lead to more long-distance, motorized travel. The study also found that for every 500-meter increase in commercial facility distance, walking trip probability decreases by 14.2%, and for every 1-kilometer increase in park distance, recreational walking probability decreases by 27.5%, showing that facility accessibility has a decisive impact on non-commuting travel modes."
Data Source: Based on systematic analysis of over 1,000 literature sources, a high-quality question-answer dataset of 1,845 pairs was compiled, with an average of 600+ Chinese characters per response, covering research from different countries, regions, and cultural backgrounds.
Algorithm 1 Temporal Management Tools
1: procedure TEMPORALSCHEDULING(events, tasks, constraints)
2: timeline ← SortedList(), schedule ← ∅
▷ Initialize timeline with existing events
3: for event ∈ events do
4: timeline.add({ConvertT oUT C(event.time), event.duration, event.type})
5: end for
▷ Sort tasks by priority × urgency
6: sorted_tasks ← Sort(tasks, key=t.priority ×
t.deadline−now
)
7: for task ∈ sorted_tasks do
8: duration ← task.estimate × 1.2 ▷ Add buffer
9: best_slot ← NULL, best_score ← −∞
10: current ← constraints.start_bound
▷ Find optimal time slot
11: while current + duration ≤ constraints.end_bound do
12: slot_end ← current + duration
13: has_conflict ← FALSE
▷ Check for conflicts
14: for existing ∈ timeline do
15: if current < existing.end ∧ slot_end > existing.start then
16: has_conflict ← TRUE
17: current ← existing.end
18: break
19: end if
20: end for
▷ Evaluate slot if no conflict
21: if ¬has_conflict then
22: time_pref ← constraints.evaluateT ime(current)
23: urgency ← max(0, 1 −
task.deadline−current
task.deadline−now
)
24: score ← task.priority + time_pref + urgency
25: if score > best_score then
26: best_score ← score
27: best_slot ← {current, slot_end, task}
28: end if
29: current ← current + 30min ▷ Time step
30: end if
31: end while
▷ Allocate best slot
32: if best_slot ̸= NULL then
33: timeline.add({best_slot.start, best_slot.duration, task.type})
34: timeline.sort()
35: schedule.add(best_slot)
36: end if
37: end for
▷ Calculate utilization and return results
38: total_busy ←
P
event∈timeline event.duration
39: total_available ← constraints.end_bound − constraints.start_bound
40: utilization ← total_busy
total_available
41: return {schedule, utilization, unscheduled : tasks.size() − schedule.size()}
42: end procedure
1: procedure SPATIALINTELLIGENCE(location, query, user_prof ile, constraints)
2: spatial_db ← ConnectSpatialIndex()
3: preferences ← BuildUserModel(user_prof ile, query.context)
▷ POI Search with semantic scoring
4: if query.type = "poi_search" then
5: candidates ← RangeQuery(spatial_db, location, query.radius)
6: for poi ∈ candidates do
7: scores ← {SemanticMapping(poi, query), WeightedScore(poi, preferences),
DistanceDecay(poi, location)}
8: poi.f inal_score ← α × scores[0] + β × scores[1] + γ × scores[2]
9: end for
10: return TopK(candidates, f inal_score)
11: end if
▷ Multi-modal route optimization
12: if query.type = "route_planning" then
13: route_graph ← BuildMultiModalGraph(query.transport_modes)
14: candidate_routes, hybrid_routes ← ∅, ∅
15: for mode ∈ query.transport_modes do
16: route ← CalculateRoute(location, query.destination, mode, route_graph)
17: if route ̸= NULL then
18: route.cost ← WeightedCost(route, constraints)
19: candidate_routes.add(route)
20: end if
21: end for
22: hybrid_routes ← CombineTransportModes(candidate_routes, route_graph)
23: return SelectOptimalRoute(candidate_routes ∪ hybrid_routes)
24: end if
▷ Traffic prediction with network simulation
25: if query.type = "traffic_prediction" then
26: network_state ← InitializeFromHistorical(location, query.time)
27: predictions ← ∅
28: for t ← 0 to query.horizon step ∆t do
29: demand ← GenerateTimeDemand(t) × EventImpact(t)
30: for segment ∈ network_state.segments do
31: flows ← UpdateTrafficFlow(segment, network_state, demand, ∆t)
32: segment.update(flows.density, flows.speed)
33: end for
34: predictions[t] ← network_state.copy()
35: end for
36: return {predictions, TimeVaryingShortestPaths(predictions)}
37: end if
▷ Semantic-spatial relationship analysis
38: if query.type = "semantic_mapping" then
39: query_embedding ← TextToEmbedding(query.text)
40: spatial_entities ← ExtractEntitiesInRadius(location, query.radius)
41: semantic_matches ← ∅
42: for entity ∈ spatial_entities do
43: joint_embedding ← CrossModalFusion(entity, location)
44: similarity ← CosineSimilarity(query_embedding, joint_embedding)
45: if similarity > semantic_threshold then
46: semantic_matches.add({entity, similarity})
47: end if
48: end for
49: return Sort(semantic_matches, key=similarity, descending=True)
50: end if
51: end procedure
39: end function
Algorithm 3 Environmental Perception Tools
Require: Q: Query parameters, Tmode ∈ {historical, realtime, predictive}
Ensure: Estate: Environmental state information
1: Data Structures:
2: W: Weather conditions, D: Pedestrian density
3: S: Special events, E: Emergency situations
4: function ENVIRONMENTALPERCEPTION(Q, Tmode)
5: Estate ← ∅
6: tquery ← Q.timestamp, loc ← Q.location
7: if Tmode = historical then
8: Estate ← RETRIEVEHISTORICALDATA(tquery, loc)
9: else if Tmode = realtime then
10: Estate ← QUERYREALTIMESENSORS(loc)
11: else ▷ predictive mode
12: Estate ← PREDICTENVIRONMENT(tquery, loc)
13: end if
14: return AGGREGATEMULTISCALE(Estate, loc)
15: end function
16: function QUERYREALTIMESENSORS(loc)
17: W ← GETWEATHERDATA(loc)
18: D ← GETPEDESTRIANDENSITY(loc)
19: S ← CHECKSPECIALEVENTS(loc)
20: E ← MONITOREMERGENCIES(loc)
21: return {W, D, S, E}
22: end function
23: function PREDICTENVIRONMENT(ttarget, loc)
24: ∆t ← ttarget − tcurrent
25: Wpred ← WEATHERFORECAST(loc, ∆t)
26: Dpred ← PREDICTCROWDFLOW(loc, ttarget)
27: Spred ← SCHEDULEDEVENTS(loc, ttarget)
28: conf ← e
−λ∆t ▷ Confidence decay
29: return {Wpred, Dpred, Spred, conf}
30: end function
31: function AGGREGATEMULTISCALE(Eraw, loc)
32: Estate ← ∅
33: for all scale ∈ {macro, micro, venue} do
34: e ← EXTRACTCONDITIONS(Eraw, scale, loc)
35: w ← COMPUTEWEIGHT(e, Q)
36: Estate ← Estate ∪ {e × w}
37: end for
38: return NORMALIZE(Estate)
This algorithm implements a multi-level, context-sensitive personal memory retrieval system for generating personalized activity trajectories. The core innovations lie in its three-tier memory architecture, dynamic transformation mechanism between short-term and long-term memory, and attention-based memory integration process.
Memory Hierarchy Structure The system organizes individual memories into three complementary levels:
Short-term and Long-term Memory Mechanism The algorithm implements a dual memory system inspired by cognitive science. Short-term memory (Mst) uses recurrent neural network structures to model temporal dependencies, offering fast retrieval advantages but limited capacity. Long-term memory (Mlt) utilizes sparse encoding and hierarchical storage structures, connecting different memory items through association strength matrices.
Memory transfer from short-term to long-term follows the hippocampal-cortical consolidation model, determined by an importance discrimination function: I(m) = α · frequency(m) + β · recency(m) + γ · emotionalsalience(m)
where frequency(m) quantifies the repetition frequency of memory items (Hebbian learning principle), recency(m) measures time decay effects (Ebbinghaus forgetting curve), and emotionalsalience(m) reflects emotional modulation. Parameters α, β, and γ are optimized through experimental data.
Context-Sensitive Retrieval The retrieval mechanism achieves precise memory localization through multidimensional similarity calculations. Given the current context C, the algorithm computes four types of similarities:
The total similarity is obtained through linear combination, with weight parameters optimized via gradient descent.
Memory Integration and Decision Generation Retrieved memories are integrated through an attention mechanism. First, attention weights are calculated: Att(Mi) = P exp(α·Relevance(C,Mi)) exp(α·Relevance(C,Mj ))
Then an autoregressive decoder extracts decision-relevant features, ultimately generating a comprehensive representation through weighted fusion. The system includes a consistency checking function Consistency to ensure internal consistency of the integration results.
Sleep Phase Consolidation The algorithm periodically executes a "sleep phase consolidation" process, optimizing short-term memory through the maximum entropy principle: minM′ LTM DKL(PSTM||P ′ LTM) + λ · H(M′ LTM)
This process compresses memory representations while preserving key information, improving storage efficiency.
Performance Optimization Through index optimization and locality-sensitive hashing techniques, the algorithm's time complexity is reduced from O(nm) (n being memory pool size, m being feature dimension) to O(n log n), significantly improving response speed while maintaining retrieval quality. The system supports memory pool preinitialization, allowing pre-planting of key information to reduce real-time computational burden.
Require: C: Current context, M: Memory store, Θ: Model parameters
Ensure: Mrelevant: Retrieved memories, M′
: Updated memory store
1: Memory Hierarchy:
2: Me = {Ei = (ti
, li
, ai
, ci
, ϕi)}: Event memories (time, location, activity, conditions, emotion)
3: Mp = {P(a|t, l, c) = P
Count(a,t,l,c)
a′ Count(a′
,t,l,c)
}: Pattern memories (probabilistic graph)
4: Ms = {S = Distill({Ei}, {Pj})}: Summary memories (knowledge distillation)
5: Mst: Short-term memory (RNN: ht = f(Wxhxt + Whhht−1 + bh))
6: Mlt = {M1, M2, ..., Mn}: Long-term memory with association matrix Aij
7: function MEMORYRETRIEVALALGORITHM(C,M, Θ)
8: Mrelevant ← CONTEXTSENSITIVERETRIEVAL(C,M)
9: Fintegrated ← MEMORYINTEGRATIONSYNTHESIS(Mrelevant)
10: D ← GENERATEDECISION(Fintegrated, C)
11: M′ ← DYNAMICMEMORYUPDATE(M, C, D)
12: SLEEPCONSOLIDATION(M′
) ▷ Periodic process
13: return (Mrelevant,M′
)
14: end function
15: function CONTEXTSENSITIVERETRIEVAL(C,M)
16: VC = [v
, vC
, ..., vC
d
] ← EXTRACTFEATURES(C)
17: R ← ∅ ▷ Candidate memories with relevance scores
18: for all Mi ∈ Me ∪ Mp ∪ Ms do
19: VMi = [v
Mi
1
, v
Mi
2
, ..., v
Mi
d
] ← EXTRACTFEATURES(Mi)
20: Weighted cosine similarity:
21: ρcos(C, Mi) = Pd
j=1 wj ·
v
·v
Mi
||vC
||·||v
Mi
22: Temporal similarity with periodicity:
23: ρtime(tC , tMi
) = cos
2π(tC −tMi
T
· e
−λt|tC −tMi
24: Spatial similarity:
25: ρspace(lC , lMi
) = K(lC , lMi
) ▷ Gaussian or Mahalanobis kernel
26: Semantic similarity:
27: ρsemantic(aC , aMi
) = ⟨ϕ(aC ), ϕ(aMi
)⟩ ▷ LM encoding
28: ρtotal = α1ρcos + α2ρtime + α3ρspace + α4ρsemantic
29: R ← R ∪ {(Mi
, ρtotal)}
30: end for
31: return TOPK(R, k) sorted by relevance
32: end function
33: function MEMORYINTEGRATIONSYNTHESIS(Mrelevant)
34: {Mi1
, Mi2
, ..., Mik
} ← sorted Mrelevant by relevance
35: Attention mechanism:
36: Att(Mi) = P
exp(α·Relevance(C,Mi))
exp(α·Relevance(C,Mj )) ▷ α: temperature
37: Autoregressive feature extraction:
38: h0 ← initial hidden state
39: for all i ∈ {1, ..., k} do
40: P(yt|y<t, Mi) = sof tmax(Woht + bo) ▷ Decoder
41: ht ← updated hidden state
42: Extract(Mi) ← decoded features
43: end for
44: Synthesis =
P
i Att(Mi) · Extract(Mi)
45: if Consistency(Synthesis) > τ then
46: return Synthesis
47: else
48: return RESOLVEINCONSISTENCY(Synthesis)
49: end if
50: end function
51: function DYNAMICMEMORYUPDATE(M, C, D)
52: 1. New memory formation:
53: Enew = (tcurrent, lcurrent, acurrent, ccurrent, ϕcurrent)
54: Mst ← Mst ∪ {Enew}
55: 2. Short-term to long-term transfer (Hippocampal-cortical model):
56: for all m ∈ Mst do
57: I(m) = α · frequency(m) + β · recency(m) + γ · emotionalsalience(m) ▷ Hebbian learning +
Ebbinghaus forgetting + Emotional modulation
58: if I(m) > θtransf er then
59: Transfer m from Mst to Mlt with sparse encoding
60: end if
61: end for
62: 3. Pattern extraction:
63: if Repeated patterns detected in Me then
64: Update P(a|t, l, c) in Mp
65: end if
66: 4. Time decay (Forgetting):
67: for all m ∈ Mlt do
68: Apply decay: strength(m) ← strength(m) · e
−λ(t−tm)
69: if strength(m) < θforget then
70: Remove m from Mlt
71: end if
72: end for
73: return Updated M
74: end function
75: function SLEEPCONSOLIDATION(M)
76: Memory compression via maximum entropy:
77: minM′
LTM DKL(PSTM||P
′
LTM) + λ · H(M′
LTM)
78: where DKL is KL divergence, H is complexity measure
79: Knowledge distillation for summary update:
80: Ms ← DISTILL(Me,Mp)
81: end function
This algorithm effectively avoiding the "average person" phenomenon through personalized memory retrieval, ensuring generated activity trajectories authentically reflect individual characteristics. As activity experiences accumulate, the system's understanding of individual behavioral patterns continuously deepens, achieving truly personalized decision support.
This algorithm represents a computational approximation of cognitive memory processes. The implementation simplifies complex neurological mechanisms for practical deployment and should not be interpreted as directly modeling biological memory systems.
Table 4: Subjective Evaluation Criteria for Activity-Travel Chains
| Dimension | Score Range | Criteria and Requirements |
|---|---|---|
| Time Logic Consistency (Weight: 25%) |
9-10 points | strong time logic, optimal utility allocation. Activity sequence completely reasonable with no time conflicts; Time allocation highly realistic, conforming to life patterns; Sufficient and feasible transition time between activities; Fully reflects individual utility maximization under time constraints. |
| 7-8 points | Good time logic, reasonable utility allocation. Activity sequence basically reasonable with occasional minor time pressure; Time allocation relatively realistic; Transition time between activities basically feasible; Better reflects time utility optimization principles. |
|
| 5-6 points | Average time logic, problematic utility allocation. Activity sequence has certain un reasonableness; Partial time allocation insufficiently realistic; Transition time between activities too tight or too loose; Time utility allocation needs optimization. |
|
| 3-4 points | Poor time logic, inappropriate utility allocation. Activity sequence unreasonable in multiple places; Time allocation obviously deviates from reality; Infeasible transition time between activities; Fails to reflect reasonable time utility consideration. |
|
| 1-2 points | Chaotic time logic, no utility optimization. Severely disordered activity sequence; Completely unrealistic time allocation; Obvious time conflicts exist; Completely ig nores time utility maximization principles. |
|
| Activity Purpose Coherence (Weight: 25%) |
9-10 points | Excellent purpose coherence, optimal utility trade-off. Strong logical correlation in activity sequence; Perfect match between travel purpose and activity types; Highly reasonable overall activity chain; Fully reflects utility trade-off optimization in multi objective decisions. |
| 7-8 points | Good purpose coherence, reasonable utility trade-off. Strong logical correlation in activity sequence; High match between travel purpose and activity types; Overall activity chain relatively reasonable; Better reflects utility trade-off mechanisms. |
|
| 5-6 points | Average purpose coherence, flawed utility trade-off. Average logical correlation in activity sequence; Medium match between travel purpose and activity types; Ac tivity chain has certain unreasonableness; Insufficient reflection of utility trade-off mechanisms. |
|
| 3-4 points | Poor purpose coherence, imbalanced utility trade-off. Weak logical correlation in activity sequence; Low match between travel purpose and activity types; Overall activity chain insufficiently reasonable; Lacks effective utility trade-off consideration. |
|
| 1-2 points | Very poor purpose coherence, no utility trade-off. Activity sequence lacks logical correlation; Serious mismatch between travel purpose and activity types; Overall chaotic activity chain; Completely ignores utility trade-off principles. |
| Dimension | Score Range | Criteria and Requirements |
|---|---|---|
| Persona Matching De gree (Weight: 25%) |
9-10 points | Extremely high persona matching, accurate utility preferences. Activity patterns highly match persona characteristics; Sufficient reflection of occupation, age, lifestyle habits characteristics; Perfect reflection of typical utility preferences of the group; Outstanding and reasonable personalized characteristics. |
| 7-8 points | Good persona matching, relatively accurate utility preferences. Activity patterns match persona characteristics well; Main characteristics clearly reflected; Better re flection of group utility preference characteristics; Basically reasonable personalized characteristics. |
|
| 5-6 points | Average persona matching, vague utility preferences. Medium matching between ac tivity patterns and persona characteristics; Insufficient reflection of some characteristics; General reflection of group utility preferences; Insufficiently prominent personalized characteristics. |
|
| 3-4 points | Poor persona matching, incorrect utility preferences. Low matching between activity patterns and persona characteristics; Most characteristics not obviously re flected; Inappropriate reflection of group utility preferences; Missing or unreasonable personalized characteristics. |
|
| 1-2 points | Very poor persona matching, no utility preference reflection. Activity patterns seriously inconsistent with persona characteristics; Chaotic or missing characteristic reflection; Completely ignores group utility preferences; No reasonable personalization. |
|
| Activity Authenticity (Weight: 25%) |
9-10 points | Extremely high activity authenticity, optimal rational choice. Activity content completely conforms to reality; Highly reasonable duration; Optimal location selection; Fully reflects rational choice behavior under resource constraints. |
| 7-8 points | Good activity authenticity, reasonable rational choice. Activity content basically conforms to reality; Relatively reasonable duration; Appropriate location selection; Better reflects rational choice principles. |
|
| 5-6 points | Average activity authenticity, biased rational choice. Activity content roughly con forms to reality; Duration has certain deviations; Average location selection; Insufficient reflection of rational choice. |
|
| 3-4 points | Poor activity authenticity, inappropriate rational choice. Activity content deviates from reality; Obviously unreasonable duration; Inappropriate location selection; Lacks rational choice consideration. |
|
| 1-2 points | Very poor activity authenticity, no rational choice. Activity content seriously deviates from reality; Completely unreasonable duration; Absurd location selection; Completely ignores rational choice behavior. |
Table 5: Reasoning Capabilities Evaluation Dimensions and Scoring Criteria
| Evaluation Di mension |
Weight | Scoring Criteria | Score Range |
|---|---|---|---|
| Information Collection Completeness |
20% | Excellent (8-10): Proactively identifies and collects all critical information dimensions including temporal con straints, spatial positioning, user preferences, resource limitations, and environmental factors Good (6-7): Collects basic information with minor omis sions in important dimensions Fair (4-5): Insufficient information collection with multi ple critical gaps Poor (0-3): Minimal or ineffective information gathering |
0-10 |
| Analytical Thinking Depth |
20% | Excellent (8-10): Conducts comprehensive multi dimensional analysis covering temporal, spatial, cost benefit, risk assessment, and personalization aspects with consideration of complex interrelationships Good (6-7): Performs basic analysis with insufficient depth Fair (4-5): Superficial analysis lacking thorough consid eration Poor (0-3): Minimal or ineffective analytical processes |
0-10 |
| Logical Reason ing Rigor |
20% | Excellent (8-10): Demonstrates rigorous logical reason ing with clear causal relationships, valid premises, and well-supported conclusions throughout each reasoning step Good (6-7): Generally sound logic with some apparent reasoning deficiencies Fair (4-5): Contains logical gaps or contradictions Poor (0-3): Confused logic with unreasonable reasoning processes |
0-10 |
| Decision Making Ratio nality |
20% | Excellent (8-10): Clearly identifies conflicts, demon strates transparent and rational trade-off processes, pro vides well-justified decisions with adequate consideration of alternatives Good (6-7): Insufficient consideration of trade-offs with unclear decision justification Fair (4-5): Limited conflict identification with superficial balancing processes Poor (0-3): Absence of trade-off processes with unjusti fied decisions |
0-10 |
| Tool Invocation Strategy |
20% | Excellent (8-10): Perfect timing of tool calls with reason able sequencing and strong strategic planning Good (6-7): Generally appropriate tool usage with occa sional improper applications Fair (4-5): Obvious problems in tool utilization lacking strategic approach Poor (0-3): Chaotic or missing tool usage |
0-10 |
Note: Final scores are calculated as weighted averages across all five dimensions, each contributing 20% to the overall reasoning quality assessment.