CoChat

MemoryRepository for AI NPC

Open access
Zheng, Shijie, He, Keith, Yang, Le, Xiong, Jie · 2024 · IEEE Access

The DOI matches its Crossref record; 33 of the 36 references it cites were found in a registry or an index; 6 of the 11 sources its claims cite were checked for support.

Abstract

Since the release of ChatGPT, large language models (LLMs) have played a huge role in various industries. In the field of games, we have used LLMs to act as intelligent AI NPC, which makes NPCs more intelligent. However, there is still an obvious obstacle -the LLMs lacks long-term memory and human-like memory mechanism.This flawed memory mechanism prevents NPCs from Long-term interaction and humanized memory based on conversation records.Recognizing the necessity of long-term memory and humanized memory, we proposed MemoryRepository, a memory mechanism for LLMs specifically used in the AI NPC field.MemoryRepository enables the model to have short-term memory and long-term memory. Short-term memory is more detailed and full, while long-term memory are more concise and partial. MemoryRepository is inspired by human memory and forgetting mechanisms. This mechanism allows AI NPCs to forget and summarize past conversation records, thereby providing long-term interaction capabilities. More importantly, this process of forgetting and summarizing the details of short-term memory into general long-term memories makes NPCs more human-like. MemoryRepository is versatile and can adapt to closed source models such as ChatGPT and open source models such as ChatGLM. To Intuitively verify the effectiveness of MemoryRepository in the field of AI NPC, we created an example in which all NPCs are represented by LLMs adapted to MemoryRepository. The example shows that by embedding LLM in MemoryRepository and fine-tuning NPCs character dialogue data, AI NPC can conduct better long-term conversations and appear more human-like during the interaction process. To validate the effectiveness of MemoryRepository, one hundred pieces of NPCs dialogue data were created and then quantitatively analyzed through evaluation indicators. The analysis results show that NPCs equipped with MemoryRepository can summarize and forget past memories, which enables it to have the ability to hold long-term conversations and conduct more human-like conversations.

Overview

CoChat Summary

TL;DR

MemoryRepository is a human-inspired memory mechanism for LLM-driven AI NPCs that adds short-term and long-term memory with periodic summarization and forgetting. In a StarUniverse case study and 400-question evaluation, it improved human-like interaction and contextual coherence over base LLMs, while retrieval and correctness did not consistently improve.

Key findings

  • In the 100th dialogue round, MemoryRepository-embedded GPT-3.5 scored Human Like 0.861 vs MemGPT 0.718, Coherence 0.886 vs 0.874, Retrieval 0.806 vs 0.831, and Correctness 0.705 vs 0.713.
  • Against baseline LLMs, integration did not significantly improve correctness and retrieval declined; the authors attribute this to selective forgetting/summarization retaining correct but less detailed memory. It improved contextual coherence and human-like scores over time, with GPT-4 outperforming GPT-3.5, which outperformed ChatGPT-3.
  • Long-term interaction demo: after hundreds of unrelated records over several days, a MemoryRepository NPC recalled a prior “How to become a Jedi Master?” question while the base LLM did not. Human-like demo: an Anakin NPC with MemoryRepository recognized Luke as a Jedi and his son, saying “I am proud of you” and “May the Force be with you,” while the base model responded mechanically.
  • Robustness tests found MemoryRepository performance almost unaffected by temperature and top-p; retrieval declined with higher temperature, correctness decreased with higher temperature but increased with dialogue turns, and top-p had negligible effect on retrieval with a slight correctness decrement.

Methods

  • Architecture: each NPC has a MemoryRoom with Short-Term and Long-Term Memory Rooms; Memory Interaction uses an Interactive Dual-Tower DSSM and Approximate Nearest Neighbor Indexing akin to FAISS; Memory Renewal combines forgetting and enhancement. Short-term memory stores up to ten dialogue rounds; every m turns, the last m talks are summarized into one Summary, added to long-term memory, and removed from short-term memory.
  • Case study: StarUniverse, where all NPCs are LLM-based; the LLM was fine-tuned on open-source NPC dialogue data (the introduction reports 50k dialogues from game characters) and integrated via LangChain prompt engineering, with prompt structure P = Pm + Ps + Pl + Pt.
  • Evaluation: local multi-GPU server with 20 CPU cores and 4 NVIDIA RTX 3090 GPUs; 400 exploratory questions (200 ChatGPT-generated, 200 manually developed) from the dataset; human annotators scored memory retrieval accuracy, response correctness, contextual coherence, and human-like interaction on 0/0.5/1 scales; compared GPT-4, GPT-3.5, ChatGLM, and MemGPT; varied temperature (0.2, 0.7, 1, 2) and top-p (0.1, 0.4, 0.7, 1).

Limitations

  • The paper does not include a dedicated limitations section. It acknowledges that retrieval declined and that forgetting sacrifices short-term detail, though it argues this is acceptable for NPC human-likeness.
  • Evident from the text: evaluation relies on human annotators without reported inter-annotator agreement or statistical significance tests, and many results are described through figures rather than numeric tables, limiting reproducibility from the text alone.
  • Evident from the text: baseline and MemGPT comparisons are limited—Table 3 reports only the 100th round for GPT-3.5—and model naming is inconsistent (“ChatGPT-3” vs GPT-3.5), so generalizability across models and dialogue rounds is not fully established.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

Crossref · 10.1109/access.2024.3393485

Cites

33 of 33 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Verification

Claims the paper makes

2 Valid · 6 Not valid · 5 Not checked · 78 Own results and interpretations

29 more claims

Create a free account to see all 91 claims and every source verdict.

See all claims — free account
  • Probably not a substantial claim. 38
  • It may state two separate claims as one. 37
  • The quote only partly states this claim. 2

Create a free account to see these claims.

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

Each contradiction between two passages listed here was confirmed by an independent check.

2 of 2

Citations

Cites

Research works printed but not linked: 4

  1. Koster, 2019, Postmortems From Game Developer: Insights From the Developers of Unreal Tournament, Black and White, Age of Empire, and Other Top-Selling Games
  2. Pérez, Creativity in intelligent technologies and the non-player characters dilemma, 3
  3. Radford, 2019, Language models are unsupervised multitask learners, OpenAI Blog, 1, 9
  4. Achiam, 2024, GPT-4 Technical Report

Cited by

See all 18

Metadata

Authors
Zheng, S., He, K., Yang, L., & Xiong, J.
Affiliations
  • Yangtze University (CN)
  • OgCloud Ltd, Guangzhou, China
  • Guangdong University of Technology (CN)
Venue
IEEE Access
Published
2024
Volume
12
Pages
62581-62596
ISSN
2169-3536 (ISSN-L)
OpenAlex
W4395447431
Cited by
18
References
36
Citations by year
2026: 7 · 2025: 8 · 2024: 3
FWCI
2.66
Type
journal article
Language
it
Open access
Locations
  • IEEE Access (publishedVersion, cc-by-nc-nd)
  • DOAJ (DOAJ: Directory of Open Access Journals) (submittedVersion, cc-by-sa)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Artificial Intelligence in Games
  • Physical Sciences › Computer Science › Artificial Intelligence › Speech and dialogue systems
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
Keywords
long-term memory, short-term memory, forgetting mechanism, large language models, game AI, ChatGLM, ChatGPT

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.

The claim verdicts this report counts are experimental: their accuracy is not yet measured.

A language model drew the claims from the paper on 2026-10-01, under version 3 of the claim definition (model deepseek-v4.1-flash, prompt extract-v3).

A second model labelled each claim on 2026-10-01 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).

Cited sources are checked with a language model’s help (gpt-6-sol).

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

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.