I gave NPCs a graph database. Now the whole village knows I stole an apple.
Description and use
Hearsay uses FalkorDB to give NPCs a graph‑based memory of events, rumours, trust, and provenance, enabling realistic gossip dynamics and explainable beliefs.
Problem
Game characters forget everything and cannot trace how reputation or gossip spreads, making in‑game social interactions unrealistic.
Outcome
Hearsay demonstrates that a graph‑based memory model can give NPCs realistic gossip dynamics, including trust‑based propagation, confidence decay, exaggeration, and provenance tracking, enabling in‑game explanations of beliefs.
Workflow
- 1. Create a read‑only template village graph.
- 2. For each player, copy the template to a per‑player graph (hearsay_
<playerId>). - 3. Every in‑game hour, match villagers in the same place who trust each other to identify gossip opportunities.
- 4. When a teller tells a listener a story, create a new Rumour node for the listener with confidence, severity, and provenance via HEARD_FROM and ORIGIN relationships.
- 5. Update confidence based on trust and hops, adjust severity if the teller exaggerates, and merge rumours if already known.
- 6. Provide a query that, given a villager, returns the shortest provenance chain to the true event.
- 7. Use the provenance chain to answer “Why do you think that?” questions.
- 8. Render the game world and allow players to interact with NPCs whose memories evolve over time.
Evidence
Game characters forget everything. The shopkeeper greets you warmly five seconds after you robbed them.
Each player gets their own graph (hearsay_<playerId>), created with GRAPH.COPY from a read-only template village.
When A tells B a story, B gets their own version: … CREATE (b)-[:HOLDS …]->(r)...
MATCH (v:Villager {id:$villager})-[:HOLDS]->(r:Rumour)... RETURN [n IN nodes(path) WHERE n:Rumour | n.id] AS rumour_ids, e.base_text AS what_happened
- Record date: 2026-10-17T12:56:08.250Z