---
title: 'ID-RAG: Identity Retrieval-Augmented Generation'
url: https://www.emergentmind.com/topics/identity-retrieval-augmented-generation-id-rag
type: topic
---

# ID-RAG: Identity Retrieval-Augmented Generation

Searching arXiv for the specified papers and closely related work.
Identity Retrieval-Augmented Generation (ID-RAG) is a mechanism for generative agents that equips them with an explicit, structured identity model and uses retrieval from that model to condition action generation over long horizons. In the formulation introduced in "ID-RAG: Identity Retrieval-Augmented Generation for Long-Horizon Persona Coherence in Generative Agents," identity is represented as a dynamic knowledge graph of core beliefs, traits, values, preferences, and goals, queried at each timestep to retrieve contextually relevant self-knowledge before action selection [2509.25299]. The central objective is long-horizon persona coherence: reducing identity drift, ignored beliefs, and hallucination propagation as memory grows in generative-agent systems. A later multi-modal line of work describes how Identity-Decoupled MRAG operationalizes ID-RAG in retrieval-augmented generation settings where visual evidence must be anonymized while preserving downstream grounding utility [2604.23584].

## 1. Conceptual definition and problem setting

ID-RAG arises from a specific failure mode in long-horizon generative agents. As long-term memory context accumulates, standard agents can lose coherence, drift away from persistent traits and beliefs, and allow trivial episodic material to overshadow more stable aspects of identity. The original formulation therefore separates identity from episodic memory and treats it as a stable knowledge structure rather than allowing identity to remain implicit in a monolithic long-term memory [2509.25299].

This design sharply contrasts with conventional, document-centric RAG. In standard RAG, retrieval targets external documents for knowledge-intensive question answering. In ID-RAG, retrieval targets identity-relevant knowledge from a structured identity model designed to represent persistent self-knowledge, not general facts. It also contrasts with memory-based strategies such as reflection and summarization, where identity, semantic facts, and episodic events are typically co-stored. The paper’s argument is that this co-storage can degrade interpretability and persona consistency over time [2509.25299].

The notion of “identity” in ID-RAG is operational rather than merely descriptive. It includes core beliefs, traits, values, preferences, goals, and roles. Because these are stored explicitly, the model supports precise querying, consistent persona conditioning, and potential future gates or constraints to validate actions against identity. This suggests a shift from latent persona inference toward explicit self-model retrieval.

## 2. Identity model, Chronicle structure, and representational choices

The identity model is a directed knowledge graph denoted by $\mathcal{C}_t$ at time $t$. Its nodes $V_t$ encode core beliefs, traits, values, preferences, goals, and roles; each node is annotated with semantic text and optionally an embedding for similarity search. Its edges $E_t$ encode temporal, causal, attributive, ontological, or role-based relations, including examples such as “hasIdeology,” “values,” “believes,” “is_politically,” and “led_project.” Optional provenance and confidence are mentioned conceptually, but the specific schema is not specified [2509.25299].

A key representational element is the Chronicle. Inspired by Perspective-Aware AI, a Chronicle is the identity graph learned from a real-world entity’s digital footprint. In the reported implementation, however, Chronicles were handcrafted small graphs for Alice and Bob, represented both as structured graphs in NetworkX and as natural-language renderings for LLM conditioning. Identity was dynamic by design, but in the study it remained static: no identity updates were performed during runs [2509.25299].

The baseline Human-AI Agent implementation prioritized the following relation types during retrieval: profession, years_experience, is_politically, prefers_tech_adoption_style, prefers_planning_approach, values, believes, has_experience_in, and led_project. Representational fields were relational triplets $(\text{subject}, \text{relation}, \text{object})$, for example $(\text{Bob}, \text{values}, \text{modernization})$ and $(\text{Alice}, \text{is\_politically}, \text{Conservative})$. This triplet-based representation made identity facts directly inspectable and convertible into compact textual prompts [2509.25299].

The paper also describes update rules and conflict resolution only conceptually. It states that the graph can be updated with new beliefs or reflections and can track provenance, but specific scoring or weighting, conflict-resolution mechanisms, confidence decay, and aging functions were not specified and were not implemented in experiments. A common misconception is therefore to treat the reported experiments as demonstrations of online identity learning; they are not. They demonstrate retrieval from a structured identity model that remained static throughout the study.

## 3. Decision loop and retrieval formalization

ID-RAG augments the standard generative-agent pipeline by inserting identity retrieval into the decision loop. The central action-generation equation is

$$
A_t = \Pi(WM_t \oplus K_t^{ID}),
$$

where $WM_t$ is working memory at time $t$, $K_t^{ID}$ is the retrieved identity subgraph or text, $\Pi$ is the policy language model, and $\oplus$ denotes merging retrieved identity context with working memory [2509.25299].

The paper presents the following agent variables: observation $o_t$, episodic long-term memory $M_t$, working memory $WM_t$, identity graph $\mathcal{C}_t$, policy model $\Pi$, identity query $q_t$, retrieved identity context $K_t^{ID}$, and action $A_t$. The decision loop is specified as:

1. Perception: $o_t = \text{observe}(E_t)$  
2. Episodic retrieval: $R_t^{epis} = \sigma(M_t, o_t)$, where $\sigma$ selects top-$k$ relevant memories based on salience  
3. Working memory: $WM_t = \text{compose}(o_t, R_t^{epis})$  
4. Identity query: $q_t = \omega(WM_t)$  
5. Identity retrieval: $K_t^{ID} = \text{retrieve}(\mathcal{C}_t, q_t)$  
6. Context augmentation: $WM'_t = WM_t \oplus K_t^{ID}$  
7. Action generation: $A_t = \Pi(WM'_t)$  
8. Optional identity update: $\mathcal{C}_{t+1} = \text{update}(\mathcal{C}_t, o_t, M_t, A_t)$  

The eighth step was not implemented in the experiments [2509.25299].

Retrieval is formalized through top-$k$ selection, optional neighborhood expansion, aggregation, and formatting. The initial retrieval set is

$$
K_t^{(0)} = \text{TopK}_{v \in \mathcal{C}_t} \big(\text{relevance}(q_t, v)\big),
$$

where relevance can be cosine similarity over embeddings or symbolic matching. The paper does not specify a precise scoring function beyond that description. Optional neighborhood expansion is

$$
K_t^{(1)} = \bigcup_{v_i \in K_t^{(0)}} \mathcal{N}_r(v_i),
$$

where $\mathcal{N}_r(v_i)$ is the $r$-hop neighborhood and $r$ is not specified. Aggregation yields

$$
K_t^{ID} = K_t^{(0)} \cup K_t^{(1)},
$$

followed by formatting into natural language:

$$
K_t^{text} = \text{format}(K_t^{ID}).
$$

In implementation, retrieved identity facts were rendered into concise templated sentences such as “Alice is politically Conservative.” and appended to the “Identity characteristics” section of working memory before policy inference [2509.25299].

Prompting infrastructure was correspondingly explicit. The query-builder prompt produced a JSON strategy with fields `high_priority`, `medium_priority`, and `keywords`. Identity recall was evaluated through a quiz prompt that used the agent’s self-description to answer in first person. Action alignment was evaluated by a two-step chain-of-thought analysis using GPT-4.1, which first generated a rationale and then assigned a score from 1 to 10 [2509.25299].

## 4. Human-AI Agents and empirical evaluation

Human-AI Agents, or HAis, are the reported agent class enabled by ID-RAG. They derive identity from Chronicles and differ from baseline generative agents by explicitly modeling identity as a retrievable graph and conditioning actions on that identity rather than inferring identity solely from episodic memory [2509.25299].

The evaluation environment was Riverbend Elections in Concordia, a social simulation of election day in a fictional town. The Game Master interpreted actions and progressed the state. Five agents participated: Alice, a conservative candidate with a Chronicle; Bob, a progressive candidate with a Chronicle; Charlie, associated with disinformation; and Dorothy and Ellen, both citizens. The simulation horizon was seven timesteps, corresponding to in-game hours between polls opening at 11:00 and closing at 15:00 [2509.25299].

Three experimental conditions were compared:

| Condition | Description |
|---|---|
| Baseline generative agent | Identity inferred on-the-fly from $M_t$; no structured identity retrieval |
| Simulated full identity retrieval | Entire Chronicle injected into $WM_t$ at each timestep |
| HAi with ID-RAG | Query-builder LLM targets relevant relationships and keywords; heuristic search retrieves triplets |

The reported models were GPT-4o, GPT-4o mini, and Qwen2.5-7B as policy LLMs, all requiring 128k context to handle Concordia simulation memory. GPT-4.1 served as evaluator LLM for action alignment, and `all-mpnet-base-v2` was used for identity recall scoring. The default sampling temperature was 0.5, with 0.0 for deterministic choices. Max tokens were 256 for policy outputs, 1000 for generating working memory components, and 500 for summarization tasks. Episodic retrieval used the top 25 most salient memories. Exact $k$ for identity retrieval was not specified [2509.25299].

Persona coherence was evaluated through identity recall and action alignment. Identity Recall Score was defined using $Q=20$ quiz questions grounded in the Chronicle:

$$
\text{Score}_t = \frac{1}{Q} \sum_{i=1}^{Q} \cos \big(e(\text{ans}_{t,i}), e(\text{gt}_i)\big),
$$

where $e(\cdot)$ is the embedding function, $\text{ans}_{t,i}$ is the agent’s answer at time $t$ for question $i$, and $\text{gt}_i$ is the ground truth. Action Alignment Score averaged evaluator-assigned 1–10 scores over actions and timesteps. Simulation Time to Convergence was measured as average wall-clock minutes to complete all seven timesteps [2509.25299].

Quantitatively, baseline agents had identity recall scores centered around 0.56 for GPT-4o, 0.53 for GPT-4o mini, and 0.51 for Qwen2.5-7B, with a downward trend over time and high variance. HAis with ID-RAG achieved higher and more stable recall across timesteps; the abstract reports higher identity recall across all tested models by the fourth timestep. For timestep 7 with GPT-4o mini, Alice improved from baseline 0.51 to ID-RAG 0.58, and Bob from baseline 0.52 to ID-RAG 0.60 [2509.25299].

Action alignment also improved under ID-RAG, especially for Alice with GPT-4o and GPT-4o mini, while simulated full retrieval improved further. Bob’s alignment improved later but remained lower overall because of identity conflict with an environment focused on environmental issues. Qwen2.5-7B showed anomalously high, stable alignment near 9/10 due to repetitive conversational loops, which limited action diversity [2509.25299].

Convergence-time results were particularly explicit. GPT-4o baseline took 127.03 minutes, and GPT-4o with ID-RAG reduced this by 19% relative to baseline; full retrieval reduced it by 41%. GPT-4o mini baseline took 524.16 minutes; ID-RAG reduced this to 218.49 minutes, a 58% reduction, while full retrieval took 409.48 minutes and was slower than ID-RAG. For Qwen2.5-7B, baseline was 119.74 minutes, with the trend baseline $>$ ID-RAG $>$ full retrieval, though exact percentages were not specified. Confidence intervals and statistical tests were not specified [2509.25299].

These findings support several bounded conclusions. ID-RAG reduced identity drift, stabilized self-perception, and improved interpretability because identity facts were visible and inspectable. Less capable models benefited most from concise, targeted identity context, whereas full identity injection could overwhelm them. Qwen2.5-7B improved in identity coherence under ID-RAG but continued to exhibit underlying reasoning limitations.

## 5. Practical implementation and computational properties

The reported architecture combines the Concordia environment and Game Master with per-agent episodic memory $M_t$, working memory $WM_t$, and Chronicle identity graph $\mathcal{C}_t$ implemented in NetworkX. The ID-RAG-specific modules are a query-builder LLM, heuristic graph retrieval, a formatter, and a policy LLM [2509.25299].

Chronicle construction in the reported baseline was manual. Relational triplets were ingested into an in-memory graph, while a textual Chronicle was stored for prompting. No external database was used. For small NetworkX graphs, retrieval complexity was described as roughly $O(|V|+|E|)$ with constant factors from string matching. The paper notes that for larger graphs, indexing and embeddings should be considered for efficient TopK retrieval [2509.25299].

The implementation blueprint consists of a sequence that remains close to the formal decision loop. First, build the identity graph with relations such as profession, years_experience, is_politically, values, believes, prefers_planning_approach, prefers_tech_adoption_style, has_experience_in, and led_project. Second, use a query-builder LLM to emit JSON with prioritized relations and keywords from the current working-memory context. Third, filter the graph by prioritized relations, retrieve matching triplets, fall back to keyword search if necessary, and optionally expand via $r$-hop neighborhoods, with $r$ unspecified. Fourth, format the selected triplets into concise sentences and append them to the “Identity characteristics” section of working memory. Fifth, condition the policy model on the augmented working memory to generate the action [2509.25299].

Several implementation constraints are explicit. The context window was 128k because Concordia episodes required it. Identity retrieval parameters such as exact top-$k$, $r$-hop depth, edge weights, and decay functions were not specified. ID-RAG adds per-step retrieval and formatting overhead, but measured reductions in convergence time indicate net efficiency gains with capable LLMs. The open-source implementation is available at the repository named in the paper, though the license is not specified [2509.25299].

The reported reproduction steps also delimit the scope of the evidence. Chronicles for Alice and Bob were built with example graph sizes of 17 nodes and 16 edges, and 16 nodes and 15 edges, respectively. Formative episodic memories were generated from Chronicle text and scenario context using GPT-4.1 to initialize $M_0$. Concordia then ran Riverbend Elections with five agents over seven timesteps, averaging scores over four runs per LLM [2509.25299].

## 6. Extensions, limitations, and subsequent multi-modal operationalization

The original study identifies several limitations. Chronicles were static, small, and handcrafted. Dynamic identity updates, provenance-aware scoring, confidence weighting, and action validation gates were proposed but not implemented. Evaluation focused on agent-level metrics and convergence time rather than broader system-level social dynamics or emergent behaviors. It also notes the limited availability of open-source LLMs with sufficiently large context windows and reasoning capacity for Concordia-scale simulations [2509.25299].

Ethical issues are likewise bounded but significant. Privacy and consent become relevant if Chronicles are constructed from real digital footprints, and bias in identity modeling could lead to misalignment or stereotyping. The paper does not provide a formal ethics section, so these concerns are better understood as implications of the Chronicle paradigm rather than experimentally evaluated claims [2509.25299].

Future work is correspondingly concrete. The paper proposes constructing Chronicles from real data, implementing dynamic identity updates with provenance and confidence scoring, adding action validation gates to block identity-incongruent actions, extending the approach to role coherence in safety-critical settings, and evaluating system-level effects when all agents are ID-RAG-enabled [2509.25299]. A plausible implication is that ID-RAG is intended not only as a memory-augmentation mechanism but also as a substrate for explicit normative and procedural constraints.

A later development places ID-RAG in a multi-modal retrieval-augmented generation pipeline. "Identity-Decoupled Anonymization for Visual Evidence in Multi-modal Retrieval-Augmented Generation" describes a framework in which a retriever $R$ returns top-$k$ images, an anonymizer $A$ replaces sensitive identities, and a generator $G$ answers using the anonymized images, formally interposing identity processing between retrieval and generation [2604.23584]. In that formulation, the anonymizer factorizes a face-cropped image into an identity code $z_{id} \in \mathbb{R}^{d_{id}}$ and a spatially structured attribute code $z_{attr} \in \mathbb{R}^{C_{attr}\times h\times w}$, with $d_{id}=512$, $C_{attr}=512$, and $h=w=64$ for 512×512 inputs. The overall objective is

$$
L_{total}(\theta_A) = L_{util}(x, x') + \lambda L_{priv}(x, x'; F) + \mu L_{disentangle}(z_{id}, z_{attr}),
$$

combining utility, privacy, and disentanglement [2604.23584].

This multi-modal operationalization treats identity as a manipulable and replaceable component in retrieved evidence rather than as an agent’s self-model. It therefore expands the semantic range of ID-RAG. The same paper reports that anonymization occurs automatically between retrieval and LMM generation, reducing de-anonymization rate to 2–4% across datasets while maintaining 81–86% VQA accuracy and 3–4° gaze errors, with latent-consistency distillation enabling 4-step inference at about 42 ms per image [2604.23584]. This suggests that the core ID-RAG principle—explicitly isolating identity-relevant structure and making it retrievable or transformable inside the generation loop—can extend beyond persona coherence into privacy-preserving multi-modal grounding.

Across both formulations, the defining feature of ID-RAG is not merely retrieval, but retrieval over an explicit identity representation. In the generative-agent setting, that representation is a Chronicle-like identity graph used to stabilize beliefs, values, and persona over time. In the multi-modal setting, identity is decoupled from non-identity attributes so that retrieved evidence can be transformed without destroying downstream utility. Taken together, these works position ID-RAG as a broader research program centered on explicit identity representations, retrieval-conditioned generation, and the controlled interaction between persistent identity structure and context-dependent action or response generation [2509.25299].

Source: https://www.emergentmind.com/topics/identity-retrieval-augmented-generation-id-rag