Incrementally build a game world. Each queue run adds a new location, character, or item — all stored in memory and cross-referenced for consistency. The PromptTemplate makes it easy to swap entity types with named variables.
Recall existing world → PromptTemplate fills in entity type → LLM generates → ToolParser saves to memory.
Use {a}, {b}, {c}, {d} to parameterize the prompt. Swap "tavern location" for "ancient temple" or "magic sword" without rewiring the graph.
Each queue run adds one element. The agent reads ALL previous memories, so "The Ember Hearth" tavern knows about characters who live nearby and items stored inside.
The system prompt instructs the LLM to link characters to locations, items to owners, and lore to places. Memory becomes a knowledge graph over time.