Hidden Door 发布分形记忆系统以解决 AI 叙事上下文难题
Fractal memory: managing knowledge, canon, and secrets at story scale
实践案例
更多技术实践 →- 引擎 / 框架
- 未说明
- 模型
- 未说明
- 耗时
- 未说明
- 成本 / 额度
- 未说明
- 产出
- 未说明
- AI 用在
- 叙事 / 对话
- 辅助工具
- 未说明
- 参与人数
- 工作室
字段由模型依据原文抽取,未说明不代表没有。请核对原文。字段有误?
原文展示了分层记忆与权限隔离的叙事架构,为长文本AI创作提供了可迁移的方法。
Ever tried explaining the plot of a beloved long-running set of stories (a novel series, a ten-season TV show, a long-running manga) to a friend who’s never heard of it? It’s more or less impossible to do at any level of detail while still conveying meaning or holding the interest of your audience. (“But then it turns out that the emperor is the hedgehog guy! No, no, that’s the beast guy with the tusks—”)
Any sufficiently long and complex narrative eventually runs into memory and context issues, whether it’s problem-solving in code, keeping track of hundreds of characters and their plotlines across a long-running novel series, or, at Hidden Door, forging ahead many chapters deep into an interactive story.
Consider a story world where the player’s character has been slowly winning over their rival for a few scenes now, with an eye toward completing a rivals-to-lovers narrative arc. There’s a major betrayal planned for chapter five. The innkeeper is hiding a relevant secret, the player character’s rival is hiding another (that just might doom their incipient relationship), and there are a hundred small details that have already happened in every scene. Some of them are irrelevant, some would make a perfect callback to tie off a prior subplot. How should an agentic storyteller make decisions accounting for all that?
When it goes poorly, it looks like this:
It falls apart.
The player character’s rival acts hostile because their last exchange was a quarrel, and a couple chapters’ worth of tiny concessions and a bit of rapport don’t outweigh the most recent scene’s events and the
condition: angrythat it added to the game state. The betrayal spills out immediately, because LLMs are incredibly bad at handling asymmetrical information—a cast of characters who all know different things, and a player who might know more than their own character. The innkeeper’s secret gets lost, and the rival’s secret leaks into the narrative with so little explanation that it’s barely coherent.Lots of things happen, but it won’t feel like a story at all.
When we ask "How should an agentic storyteller make decisions?", we're really asking two questions. What's important, and what will feel satisfying in a story? The question of importance is shared with technical systems everywhere: we need to maximize the signal-to-noise ratio, figure out what's relevant or important and what isn't, and to do so in a finite context or volume of information. Machine learning is full of well-established tools to achieve that goal. We can draw on techniques from recommender systems, information retrieval, and natural language processing to figure out what's relevant and how much detail is useful.
The question of what will feel satisfying in a story is far more challenging, and it can change the answer to what’s important. Narrative has its own structures, patterns, and goals, and over time, choices about what happens will both draw from existing and create new facts—things that were, things that are, and some things that have not yet come to pass[footnote][Tolkien knew a thing or two about long-running stories.]. Stories also have asymmetrical information: plans, secrets, and multiple characters who know different things and should act accordingly. So we must manage not only the inputs into our agentic storytelling tasks, but the same systems must also use that information to create outputs that serve the larger structural goals of the narrative—and there isn't ever one right answer.
Top-down purpose, bottom-up memory
Stories have a naturally nested structure, and that’s reflected in our system. The plot is driven by storylines, which are handwritten and curated playbooks of recognizable narrative arcs with archetypal beats, such as a heist or a rivals-to-lovers arc. A storyline contains chapters that can hit those beats, a chapter contains scenes, and scenes are made up of individual moments clustered as turns.
These structures are also fractal, in a flexible sort of way, and often play out similar patterns at their own levels of scale—rising and falling tension, information reveals, changing relationships, cliffhangers. But for each level, the amount of detail that decides what’s important is a bit different. In one turn of the story, the actual words spoken between two characters matter a great deal. At the level of the scene, it’s important that they were trapped alone in a room by a strange coincidence and argued about the plan. And at the level of the chapter, the key piece of information is that one of them has started to distrust the other.
Once we know what’s important at each of these levels, we can compress information to reduce the space it takes up. Our story harness and narrative world model store different representations of information at each of these levels. A rolling scene summary can stand in for the events of dozens of individual turns, while a chapter-level record of one specific character’s role in the events can be much more useful than a summary of the chapter as a whole. Some information, like inventory, conditions, and basic relationships, is better represented as a structured state than as a summary at all.
But information also flows in the other direction: if the editorial purpose of a storyline is to build toward a betrayal, that gives us a pretty good idea of what we should be paying attention to several levels down, and guides what existing information is appropriate to share for a given task. If the overall narrative context were different, one character starting to distrust the other might instead be an afterthought for the chapter.
These different structural levels also provide a handy mechanism for “forgetting.” A piece of editorial guidance attached to a scene naturally falls out of relevant context when the scene ends, while guidance attached to the world informs every story we tell in it. We apply a similar technique for evaluating loose plot threads to decide which ones have been resolved, which get stored in a longer-lived record, and which can be gracefully dropped. We don’t actually discard any data, but by attaching information to the appropriate structure, we get quite a bit of appropriate forgetting more or less for free.
Clear models of complex systems > general-purpose capabilities
General-purpose approaches to relevance and narrative next steps, even applied well with a capable model, can at best hit the bar of “mediocre.” But we want excellence! What is important at the moment isn’t an intrinsic property of the information; it’s a function of where the narrative is trying to go. A well-developed model of world and story gives us considerable leverage over what needs to go into context. For example, we use embedding-based retrieval to rank which pieces of world lore are relevant to a scene, but the most important piece of information for writing that scene might have very little semantic similarity to anything happening in it. It might be a seemingly innocuous interaction from three chapters ago that lays the groundwork for that stunning reveal! The connection could be causal, thematic, or editorial rather than semantic. Because we've explicitly modeled the editorial purpose of different parts of the story, we have another avenue for bringing that information into the brief for an individual turn of play.
But even information that's extremely important to the story might be exactly what we want to keep out of context. Consider the whole keeping-secrets thing that LLMs are very bad at. What's generally known to be true in the world, what a character knows to be true, what that character says to others, and what the audience is expected to know at any given moment can be very different. LLMs are also bad at simply making decisions based on what each character should or shouldn’t know. The most effective solution for secrets is keeping each task on a need-to-know basis, because an agent can’t leak what it doesn’t know.
Our narrative world model holds most of that record in the world's state, including what each character has seen of the world, which secrets are in play, and who knows them. We track not just facts about the world but who knows them and when they found out, with a background process picking up new revelations as the story unfolds. Modeling this distinction explicitly lets us manage the asymmetry of information—not just among characters, but for the AI storytelling tasks themselves. An agent planning the scene needs to know about the planned betrayal in detail; the agent writing each turn’s events will make much better choices in the moment if it receives a slow drip of that information.
The more nuanced our model of storytelling, the more we can make decisions about context at the architectural level, rather than leaving those decisions to a general-purpose LLM at inference time and converging on infinitely mid outputs.
What lets us tell better stories isn't just a bigger memory. It isn’t even a better-organized one—a well-organized memory and fact system that doesn’t enable meaningful retrieval is worthless. Our stories are satisfying and coherent because we built a system that can fluidly pull from memories across different scales of narrative structure. That integration between facts and narrative means the system can surface the right information, at a level of detail appropriate for the task at hand, all in service of the narrative goals. Critically, the system can also “keep secrets” by not providing information that would drive change too early; it can also actively and passively “forget” information that served the story before but isn't needed going forward.
After all, a big part of good storytelling is knowing what to leave out.
来源:Hidden Door · AI 叙事与游戏工程 · hiddendoor.co