← Back to Papers

PersonaAgent with GraphRAG: Community-Aware Knowledge Graphs for Personalized LLM

Siqi Liang, Yudi Zhang, Yue Guo
arXiv.org | 2025
PersonaAgent combines Knowledge Graph-enhanced Retrieval-Augmented Generation (GraphRAG) with community detection to construct personalized LLM agents that embody individual user personas through dynamic prompt engineering.

Problem Statement

Standard LLMs lack the ability to consistently adapt to individual user preferences and historical behaviors, producing generic outputs that fail personalization tasks. Prior RAG methods retrieve documents in isolation without capturing relational or community-level patterns in user behavior. This work addresses the gap between flat retrieval approaches and richer, graph-structured contextual understanding needed for genuine personalization.

Key Novelty

  • Construction of an LLM-derived Knowledge Graph index over user-relevant documents to capture structured relational information about user preferences and behaviors
  • Graph-based community detection to identify and summarize clusters of related interaction patterns, enabling global preference signals to augment local user history
  • Dynamic persona-aligned prompt engineering that fuses user-specific behavioral summaries from the KG with community-level knowledge for consistent agent persona maintenance

Evaluation Highlights

  • On the LaMP benchmark, news categorization F1 improved by 11.1% and movie tagging F1 improved by 56.1% over prior methods
  • Product rating prediction MAE reduced by 10.4% over prior methods on the LaMP benchmark, demonstrating improved regression-style personalization

Breakthrough Assessment

6/10 The paper presents a solid and well-motivated combination of GraphRAG and community detection for personalization, with strong empirical gains on established benchmarks; however, it is largely an engineering integration of existing techniques (GraphRAG, community detection, RAG-based prompting) rather than a fundamentally new algorithmic advance.

Methodology

  1. Step 1 — Graph Index Construction: An LLM processes user historical documents and interactions to extract entities and relationships, building a structured Knowledge Graph that represents the user's behavioral and preference landscape.
  2. Step 2 — Community Detection & Summarization: Graph community detection algorithms (e.g., Leiden or Louvain) are applied to the KG to identify clusters of related information; an LLM then summarizes each community into compact, semantically rich representations of collective preference patterns.
  3. Step 3 — Personalized Prompt Generation & Inference: At query time, relevant user-specific summaries and global community summaries are retrieved and combined into a dynamic persona-aligned prompt, which is fed to the LLM agent to generate outputs consistent with the user's persona.

System Components

Persona Agent

The core LLM-powered agent that embodies a user's persona (profile, tastes, preferences) and generates personalized responses based on dynamically constructed prompts

Knowledge Graph Builder

Processes user historical documents using an LLM to extract entities, relations, and build a structured graph index capturing user behavioral patterns

Community Detection Module

Applies graph community detection to the KG to identify clusters of semantically related user interactions and preference patterns

Community Summarizer

Uses an LLM to generate concise natural language summaries of each detected community, encoding collective knowledge for retrieval

Dynamic Prompt Engineer

Combines user-specific KG summaries with relevant community-level summaries at inference time to construct context-rich, persona-aligned prompts for the LLM

Results

Metric/Benchmark Prior Best Baseline PersonaAgent (This Paper) Delta
LaMP News Categorization (F1) Baseline F1 +11.1% relative +11.1% F1
LaMP Movie Tagging (F1) Baseline F1 +56.1% relative +56.1% F1
LaMP Product Rating (MAE) Baseline MAE Lower MAE -10.4% MAE

Key Takeaways

  • GraphRAG with community detection is a powerful drop-in enhancement for personalization tasks: structuring user history as a KG and summarizing communities captures global preference signals that flat retrieval misses, yielding large gains especially on tagging tasks.
  • For LLM practitioners building personalized agents, dynamic persona-prompt construction—combining individual behavioral summaries with community-level patterns—is more effective than static user profiles or naive document retrieval alone.
  • The LaMP benchmark provides a useful testbed for personalization research; the 56.1% F1 gain on movie tagging suggests that relational structure in user-item interaction data is highly underexploited by standard RAG pipelines.

Abstract

We propose a novel framework for persona-based language model system, motivated by the need for personalized AI agents that adapt to individual user preferences. In our approach, the agent embodies the user's"persona"(e.g. user profile or taste) and is powered by a large language model (LLM). To enable the agent to leverage rich contextual information, we introduce a Knowledge-Graph-enhanced Retrieval-Augmented Generation (Graph RAG) mechanism that constructs an LLM-derived graph index of relevant documents and summarizes communities of related information. Our framework generates personalized prompts by combining: (1) a summary of the user's historical behaviors and preferences extracted from the knowledge graph, and (2) relevant global interaction patterns identified through graph-based community detection. This dynamic prompt engineering approach allows the agent to maintain consistent persona-aligned behaviors while benefiting from collective knowledge. On the LaMP benchmark, our method improves news categorization F1 by 11.1%, movie tagging F1 by 56.1%, and reduces product rating MAE by 10.4% over prior methods. Our code is available at https://anonymous.4open.science/r/PersonaAgentwGraphRAG-DE6F

Generated on 2026-03-02 using Claude