CoChat

Hierarchical Memory Consolidation and Context-Efficient Retrieval forPersistent Personality in LLM-Based Game NPCs

Open access
Damastuti, Fardani Annisa, Firmansyah, Kenan, Barakbah, Aliridho, Hariadi, Mochamad · 2026 · SSRN Electronic Journal

The DOI matches its Crossref record; 6 of the 6 references it cites were found in a registry or an index.

Abstract

​Large Language Model (LLM) agents offer a practical path toward fully autonomous Non-PlayerCharacters (NPCs) in games, yet two engineering problems limit their adoption at scale. First, supplyingagents with uncompressed event histories causes context token usage to grow linearly with simulationlength, making concurrent multi-NPC deployment economically unviable. Second, generic episodicsummarization strips character-defining context from long-term memory, causing gradual personalityerosion over extended play sessions. We introduce a three-tier hierarchical memory architecture, Short-Term Memory (STM), Episodic, and Core, combined with a graph-based retrieval engine adapted fromHippoRAG. Our personality-aware consolidation pipeline injects each agent’s OCEAN psychologicaltrait scores and personal values into the episodic summarization prompt, producing identity-biasedmemory summaries that preserve character alignment over time. The architecture is implementedand evaluated inside Clone World, a multi-agent simulation framework built on hexagonal ports-and-adapters architecture. Over a 14-day agent simulation with𝑛=3agents, the hierarchical systemachieves a 94.8% reduction in context token usage relative to a full-history retrieval baseline (19.32×efficiency gain), confirmed over 1,809 observed decision cycles. Graph-based retrieval outperformsnaive vector cosine similarity for relational memory recall (Mann–Whitney𝑈=0, rank-biserial𝑟=1.000,Cohen’s𝑑=6.437). An analysis of 78 episodic summaries (39 OCEAN-aware, 39 generic) shows thatOCEAN-injected consolidation produces measurably more value-aligned content for 2 of 3 testedagents. Results suggest this architecture constitutes a scalable, economically viable approach forpersistent, personality-driven NPCs in production game environments.

Overview

Integrity signals

Registry

Crossref · 10.2139/ssrn.6536138

Cites

6 of 6 references verified0 citation errors · 0 not checkable

Statistics

Recomputing p-values needs the paper’s full text.

Verification

Claims the paper makes

We couldn’t retrieve this paper’s full text, so its claims and self-check weren’t run. The registry and citation checks still apply.

Citations

Cites

Show all 6 references

Research works printed but not linked: 20

  1. P Anokhin, 2024, AriGraph: Learning knowledge graph world models with episodic memory for LLM agents
  2. J Chen, 2025, AgentSociety: Large-scale simulation of LLM-driven generative agents advances understanding of human behaviors and society
  3. Y Chen, 2025, MIMIC: Integrating diverse personality traits for better game testing using large language model, Proceedings of the 40th IEEE/ACM International Conference on Automated Software Engineering (ASE 2025
  4. A Cockburn, 2005, Hexagonal Architecture (Ports and Adapters)
  5. D Edge, 2024, From local to global: A graph RAG approach to query-focused summarization
  6. B J Guti�rrez, 2024, HippoRAG: Neurobiologically inspired long-term memory for large language models
  7. X Hu, 2024, Enabling long-term memory for LLM agents via hierarchical summarization and selective retrieval
  8. P Lewis, 2020, Retrievalaugmented generation for knowledge-intensive NLP tasks, Advances in Neural Information Processing Systems (NeurIPS), 33, 9459
  9. X Li, 2024, Think twice before assigning personality to GPT, Evaluation of personality consistency in LLMs
  10. C Packer, 2023, MemGPT: Towards LLMs as operating systems
  11. G Rao, 2023, Can LLMs express personality? an exploration using the Big Five
  12. T Shen, 2025, A survey of graph retrieval-augmented generation for customized large language models
  13. N Shinn, 2023, Reflexion: Language agents with verbal reinforcement learning, Advances in Neural Information Processing Systems (NeurIPS)
  14. S Sun, 2025, PersonaAgent with GraphRAG: Communityaware knowledge graphs for personalized LLM
  15. E Tulving, 1972, Episodic and semantic memory, Organization of Memory, 381
  16. Z Wang, 2025, From experience to strategy, Empowering LLM agents with trainable graph memory
  17. G Xiong, 2026, Graph-based agent memory: Taxonomy, techniques, and applications
  18. S Yao, 2023, ReAct: Synergizing reasoning and acting in language models
  19. W Zhang, 2025, Memory in the age of AI agents: A survey
  20. Y Zhou, 2025, Enabling personalized long-term interactions in LLM-based agents through persistent memory and user profiles

Cited by

Still being checked.

Metadata

Authors
Damastuti, F. A., Firmansyah, K., Barakbah, A., & Hariadi, M.
Affiliations
Institut Teknologi Sepuluh Nopember (ID)
Corresponding author
Damastuti, Fardani Annisa
Venue
SSRN Electronic Journal
Publisher
Elsevier BV
Published
2026
ISSN
1556-5068 (ISSN-L)
OpenAlex
W7151540001
Cited by
0
References
6
Type
posted content
Language
en
Open access
Locations
SSRN Electronic Journal (acceptedVersion)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Artificial Intelligence in Games
  • Physical Sciences › Computer Science › Artificial Intelligence › Psychiatry, Mental Health, Neuroscience
  • Physical Sciences › Computer Science › Artificial Intelligence › AI-based Problem Solving and Planning
Keywords
LLM agents, memory hierarchy, memory consolidation, graph-based retrieval, multi-agent simulation

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

How to cite

Cite CoChat for the checks on this page, and the paper for its own findings.

This page
CoChat. (2026). Citation check: Hierarchical Memory Consolidation and Context-Efficient Retrieval forPersistent Personality in LLM-Based Game NPCs. https://app.cochat.ai/papers/10.2139/ssrn.6536138
The paper
Damastuti, F. A., Firmansyah, K., Barakbah, A., & Hariadi, M. (2026). Hierarchical Memory Consolidation and Context-Efficient Retrieval forPersistent Personality in LLM-Based Game NPCs. SSRN Electronic Journal. https://doi.org/10.2139/ssrn.6536138

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.