System Specifications
1. The Social Graph Database
The social_graph.json is a global registry of relationships. It prevents NPCs from having "amnesia" and allows for emergent social dynamics.
Function: When an entity is mentioned, the agent queries this graph to retrieve the sentiment and context of the relationship, influencing the "Analyze" phase of the cognitive loop.
2. The Interaction Ledger
The interaction_ledger.json is a chronological archive of high-impact events that have occurred in the world.
Function: This serves as the world's "Collective Memory." NPCs can reference these events to create shared bonds or long-term grudges.
3. The Persistent Memory Store
Individual agents maintain private stores of player-specific data to track evolution and trust over time.
Function: This allows for highly personalized interactions. A player who is helpful to Grig but rude to Barnaby will be treated differently by each.
4. Dynamic Intent Queue (Scheduling)
To simulate authentic daily life, NPCs use a Daily Intent Ledger. This moves them beyond rigid state machines into a world of planned intentions and organic interruptions.
The Priority Logic
- Critical: (Eating, Sleeping). Non-negotiable. These blocks force an "Urgent Interrupt" if delayed too long.
- High: (Work, Essential duties). Primary goals of the day.
- Routine: (Socializing, Maintenance). Regular activities.
- Optional: (Hobbies, Wandering). First to be sacrificed to make room for player interactions.
The Execution Loop
1. Planning: At daybreak, the agent loads a default schedule and injects personal intentions based on Social Graph memories.
2. Execution: The Game Engine handles the movement and timing, but the AI Agent manages the "Interrupts" (reacting to events or overriding the schedule for a priority action).
3. Reflection: At the end of the day, the agent reviews the interruption_log to adjust their sentiment toward players who disrupted their routine.