From social interaction graphs to knowledge graphs: enabling GraphRAG for LLM-based analysis of online conversations
DOI:
https://doi.org/10.59476/ilpmt2026.v2i1.793Keywords:
GraphRAG, knowledge graph, large language models, social net works, X (formerly Twitter)Abstract
Large language models (LLMs) offer great support for the analysis of social media data; however, they often struggle to provide grounded and reli able responses when reasoning over social network structures. This limita tion mainly results from their dependency on unstructured text which can lead to hallucinations or incomplete interpretations of complex interac tion patterns. Retrieval-augmented generation (RAG) has been shown to improve grounding by including external knowledge; however, the exist ing approaches mainly use collections of documents and fail to exploit the relational and temporal structure already present in social media data. The aim of this research is to propose a framework for transforming social inter action graphs into knowledge graphs that can serve as context graphs for GraphRAG, enabling more grounded and interpretable LLM-based reason ing over online conversations.
The proposed framework starts from a social interaction network construct ed from X (formerly Twitter) data, where nodes represent users and edges represent interactions between users such as mentions, replies, reposts (retweets), and quotes. This interaction graph is then transformed into a heterogeneous knowledge graph which has posts (tweets) at its center and explicitly models authorship, conversational structure, and temporal dy namics. Furthermore, this schema contains entities such as posts(tweets), users, hashtags, URLs, and conversations, and defines relations including authored, mentions, replies to, reposts (retweets), and quotes. Additional semantic enrichment is incorporated through entity extraction and link ing, as well as metadata such as timestamps and community membership. The resulting knowledge graph can be used as a context graph within a GraphRAG pipeline, where relevant subgraphs are retrieved and provided to an LLM for answering questions.
This research highlights the potential of integrating social network analy sis with knowledge graph construction to enhance LLM-based analysis of social media data. By transforming interaction graphs into temporally en riched knowledge graphs, the proposed framework will enable structure aware retrieval and reasoning, improving the quality and interpretability of generated responses.
References
1. Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Her bert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D. M., Wu, J., Winter, C., … Amodei, D. (2020). Language Models are Few-Shot Learners (arXiv:2005.14165). arXiv. https://doi.org/10.48550/ arXiv.2005.14165
2. Ceni, A., Kika, A., & Çollaku, D. X. (2023). A Social Network Analysis of COVID-19 Vaccines Tweets. 1–12.
3. Edge, D., Trinh, H., Cheng, N., Bradley, J., Chao, A., Mody, A., Truitt, S., Metropolitansky, D., Ness, R. O., & Larson, J. (2025). From Local to Global: A Graph RAG Approach to Query-Focused Summarization (arXiv:2404.16130). arXiv. https://doi.org/10.48550/arXiv.2404.16130
4. Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küt tler, H., Lewis, M., Yih, W., Rocktäschel, T., Riedel, S., & Kiela, D. (2021). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (arXiv:2005.11401). arXiv. https://doi.org/10.48550/arXiv.2005.11401
5. Li, D., Niu, Y., Ai, Y., Zou, X., Qi, B., & Liu, J. (2025). T-GRAG: A Dynamic GraphRAG Framework for Resolving Temporal Conflicts and Redundancy in Knowledge Retrieval. Proceedings of the 33rd ACM International Conference on Multimedia, 11880–11889. https://doi. org/10.1145/3746027.3755628
6. Newman, M. E. J. (2003). The structure and function of complex networks. SIAM Review, 45(2), 167–256. https://doi.org/10.1137/ S003614450342480
7. Peng, B., Zhu, Y., Liu, Y., Bo, X., Shi, H., Hong, C., Zhang, Y., & Tang, S. (2024). Graph Retrieval-Augmented Generation: A Survey (arX iv:2408.08921). arXiv. https://doi.org/10.48550/arXiv.2408.08921
8. Ravi, R., Ginde, G., & Rokne, J. (2024). PRAGyan—Connecting the Dots in Tweets (arXiv:2407.13909). arXiv. https://doi.org/10.48550/arX iv.2407.13909
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Arber Ceni, Alda Kika

This work is licensed under a Creative Commons Attribution 4.0 International License.