From social interaction graphs to knowledge graphs: enabling GraphRAG for LLM-based analysis of online conversations

Arber Ceni, Alda Kika · Innovations in Publishing Printing and Multimedia Technologies · 2026

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.

Read the paper · More papers on PaperTik