A novel framework called TravelRAG is introduced in this paper, which is built upon a large language model (LLM) and integrates Retrieval-Augmented Generation (RAG) with knowledge graphs to create a retrieval system framework designed for the tourism domain. This framework seeks to address the challenges LLMs face in providing precise and contextually appropriate responses to domain-specific queries in the tourism field. TravelRAG extracts information related to tourist attractions from User-Generated Content (UGC) on social media platforms and organizes it into a multi-layer knowledge graph. The travel knowledge graph serves as the core retrieval source for the LLM, enhancing the accuracy of information retrieval and significantly reducing the generation of erroneous or fabricated responses, often termed as “hallucinations”. As a result, the accuracy of the LLM’s output is enhanced. Comparative analyses with traditional RAG pipelines indicate that TravelRAG significantly boosts both the retrieval efficiency and accuracy, while also greatly reducing the computational cost of model fine-tuning. The experimental results show that TravelRAG not only outperforms traditional methods in terms of retrieval accuracy but also better meets user needs for content generation.