Skip to content

chiarap2/urbanRAG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

UrbanRAG

UrbanRAG is a spatially-enhanced Retrieval-Augmented Generation (RAG) framework for recommending urban itineraries. It integrates Large Language Models (LLMs) with spatial reasoning and geographic data to support exploratory itinerary and urban discovery through a conversational interface.

This project is associated with the paper:

Spatial RAG for Big Data–Driven Urban Itinerary Recommendation
Maddalena Amendola*, Chiara Pugliese*, Raffaele Perego, Chiara Renso
*Both authors contributed equally to this research.


🚢 What is UrbanRAG?

UrbanRAG helps users explore cities by generating personalized routes that prioritize:

  • Domain-specific spatial indicators (e.g., sidewalks, air quality, greenery, accessibility)
  • User preferences (e.g., types of POIs or route aesthetics)
  • Contextual information (e.g., fun facts, history, or details about places encountered along the route)

The system combines three main components:

  • QUAG: Query understanding and answer generation via an LLM (Llama 3.1 8B)
  • Spatial Component: Computes routes and scores them based on domain-specific spatial indicators
  • IR Component: Retrieves relevant context passages using a dense vector index (FAISS + Snowflake bi-encoder)

πŸ” Key Features

  • Natural language queries for both routes and urban information
  • Multi-criteria assessment using OpenStreetMap and environmental data
  • Retrieval-augmented generation to mitigate hallucinations and improve accuracy
  • Custom dataset for evaluating spatial and information-seeking queries

πŸ“‚ Repository Structure

  • main.py – sets up and runs the interactive UrbanRAG system
  • QUAG.py – LLM-based query classification and generation
  • src/spatial_component/ – Route generation, itinerary scoring, and POI enrichment
  • src/RAG_system/ – Dense passage indexing and neural search
  • dataset/ – UrbanRAG evaluation dataset (10 route queries + 30 follow-ups)
  • output/ – UrbanRAG outputs

πŸ“Š Evaluation Summary

Query Type Metric UrbanRAG LLM-Only
Spatial Queries Fully Correct 4 / 10 0 / 10
Partially Corr 6 / 10 0 / 10
Info Queries Fully Correct 20 / 30 12 / 30
Partially Corr 5 / 30 11 / 30

UrbanRAG clearly outperforms closed-book LLMs in both spatial understanding and factual accuracy.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages