Lore Storage
Persistent storage for lore entries and weekly news snapshots.
This class extends Minecraft's SavedData to automatically persist lore entries to the world save. It maintains weekly snapshots for the Lorekeeper Gazette and submitted-book inventory.
Usage
val storage = LoreStorage.get(server)
storage.addEntry(LoreEntry("Player built a castle", "Steve", System.currentTimeMillis()))See also
for generating books from stored entries
for the data structure of individual entries
Types
A single lore entry recording an event or player contribution.
Canonical interpreted memory record used for retrieval-oriented AI context assembly.
A structured event describing why reputation changed or what context was observed.
A snapshot of lore entries for a specific in-game week.
AI-generated summary for a specific week.
Functions
Adds a single lore entry to storage.
Convenience method to add a lore entry from raw values.
Adds a long text as multiple chunked entries.
Adds a long text as multiple chunked entries and returns the created entries.
Adds a lore entry and returns the created entry.
Records a reputation memory event for later profile generation and narrative grounding.
Stores the active archived reputation profile for a player.
Stores an accepted player-submitted book for Lorekeeper resale.
Clears the news snapshot and AI summary for the given week.
Finds a submitted book by stable identifiers for resale-volume delivery.
Returns the published edition number of the history book.
Returns the AI-generated history summary, or empty string if none exists.
Returns the timestamp when the AI history summary was last generated.
Returns the AI-generated summary for the given week, or null if none exists.
Returns all stored AI weekly summaries (one per week).
Returns a copy of all stored entries in chronological order.
Returns all canonical memory records sorted oldest-to-newest by timestamp.
Returns all recorded reputation memory events.
Returns all archived reputation profiles.
Returns the current number of stored entries.
Returns the most recent entries up to the specified limit.
Returns the timestamp of the most recent entry, or 0 if no entries exist.
Returns latest canonical memory records in chronological order.
Returns the latest archived reputation profile for a player.
Returns the most recent submitted books up to the specified limit.
Returns completed memory-index backfill version for this world.
Returns current canonical memory record count.
Returns an existing news snapshot for the given week, or null if none exists.
Returns the last time Notion sync completed, or 0 if never synced.
Gets or creates a weekly news snapshot.
Returns the version of completed pagination republish backfills for this world.
Returns recent reputation memory events for the given player, newest-first.
Returns the current number of stored submitted books.
Returns true if a news snapshot exists for the given week.
Marks the memory-index backfill version when a migration run completes.
Marks the pagination republish backfill version when a one-time migration completes.
Removes an entry at the specified index.
Removes memory records by source and optional source reference.
Stores an AI-generated history summary with its generation timestamp.
Stores an AI-generated summary for the given week.
Updates the last Notion sync timestamp.
Upserts a canonical memory record by deterministic MemoryRecord.recordId.
Upserts a batch of memory records and returns the number of changed rows.