The Three-Way Alignment
In AllCodex, lore attributes live in three states:- Database Templates (
hidden_subtree_templates.ts): Promoted labels defined in the database. These render as high-priority, structured input fields in the Portal UI. - AI Extraction Schema (
lore.ts): Zod-validated JSON keys that AllKnower instructs LLMs to extract during a Brain Dump. - Portal UI Render: The client layout matches database templates. AI-extracted attributes that do not map to a database promoted label are saved as raw, unpromoted tags at the bottom of the entry.
The 21 Lore Entity Types
Below is the complete catalog of all 21 lore entity types supported by AllCodex, including template IDs, database promoted attributes, and AI pipeline fields.1. Character
NPCs, PCs, and historical figures.- Template ID:
_template_character - Database Promoted Attributes:
fullName(Text) — Full name of the character.aliases(Text) — Titles, monikers, or pseudonyms.age(Number) — Numerical age.race(Text) — Species or ethnic lineage.gender(Text) — Gender expression.affiliation(Text) — Factions, guilds, or groups.role(Text) — Class, profession, or social role.status(Text) — e.g. Alive, Dead, Missing.secrets(Text) — Hidden GM-only facts.goals(Text) — Motivations or immediate plans.
- AI Pipeline Schema:
- Extracts all of the above plus
physicalDescription,personality, andbackstory(written directly into the note’s HTML body instead of database labels).
- Extracts all of the above plus
2. Location
Cities, dungeons, regions, landmarks, or planes.- Template ID:
_template_location - Database Promoted Attributes:
locationType(Text) — e.g. City, Dungeon, Region, Landmark.region(Text) — The broader geographic area containing this location.population(Text) — Total inhabitants or size categorization.ruler(Text) — Factions or characters in control.secrets(Text) — Hidden GM-only facts.geolocation(Text) — Latitude/longitude coordinates for map pins.
- AI Pipeline Schema:
- Extracts
locationType,region,population,ruler,secretsplushistory,notableLandmarks, andconnectedLocations(stored as unpromoted labels).
- Extracts
3. Faction
Organizations, guilds, or political powers with goals and leadership.- Template ID:
_template_faction - Database Promoted Attributes:
factionType(Text) — e.g. Guild, Empire, Secret Society.foundingDate(Text) — Calendar date or era of creation.leader(Text) — Chief NPC or council.goals(Text) — Major objectives.secrets(Text) — GM-only details.status(Text) — Active, Defunct, Disbanded.
- AI Pipeline Schema:
- Extracts
factionType,foundingDate,leader,goals,secretsplusmembers,allies,enemies, andhierarchy(saved as unpromoted labels).
- Extracts
4. Creature
Monsters, beasts, or distinct entities.- Template ID:
_template_creature - Database Promoted Attributes:
creatureType(Text) — e.g. Beast, Aberration, Undead.habitat(Text) — Natural terrain or plane.diet(Text) — Feeding habits.dangerLevel(Text) — Threat level or CR indicator.abilities(Text) — Notable traits.
- AI Pipeline Schema:
- Extracts all of the above plus
lore(written to HTML content) and D&D-style stats (ac,hp,speed,str,dex,con,int,wis,cha,cr).
- Extracts all of the above plus
5. Event
Historical occurrences, campaign sessions, or planned encounters.- Template ID:
_template_event - Database Promoted Attributes:
date(Text) — Calendar timestamp.location(Text) — Geopolitical node where it occurred.participants(Text) — Active factions/NPCs.outcome(Text) — Historical result.secrets(Text) — GM-only details.
- AI Pipeline Schema:
- Extracts all database promoted attributes.
6. Timeline
Sequences of events.- Template ID:
_template_timeline - Database Promoted Attributes:
calendarSystem(Text) — e.g. Harptos, Gregorian.sorted(Text) — Sorting mechanism.sortBy(Text) — Key field to sort.
- AI Pipeline Schema:
- Extracts
startDate,endDate, andevents(stored as unpromoted labels).
- Extracts
7. Manuscript
Books, ledgers, ancient scrolls, or in-world literature.- Template ID:
_template_manuscript - Database Promoted Attributes:
genre(Text) — e.g. Arcane Thesis, Diary.manuscriptStatus(Text) — e.g. Complete, Fragment, Lost.wordCount(Number) — Document length.
- AI Pipeline Schema:
- Extracts
wordCountandstatus(mapped tomanuscriptStatus).
- Extracts
8. Statblock
TTRPG stats (e.g., D&D 5e monster templates).- Template ID:
_template_statblock - Database Promoted Attributes:
crName(Text),challengeRating(Number),crLevel(Number).creatureType(Text),size(Text),alignment(Text).- Stats:
ac,hp,speed,str,dex,con,int,wis,cha. - Resistances/Vulnerabilities:
immunities,resistances,vulnerabilities. - Actions:
abilities,actions,legendaryActions.
- AI Pipeline Schema:
- Extracts
systemandcralongside standard stats, mapping actions and abilities to the database.
- Extracts
9. Item
Equipment, artifacts, weapons, or key campaign items.- Template ID:
_template_item - Database Promoted Attributes:
itemType(Text) — e.g. Weapon, Wondrous Item, Potion.rarity(Text) — e.g. Common, Rare, Legendary.creator(Text) — Historical figure or faction.magicProperties(Text) — Enchanments.history(Text) — Origins.
- AI Pipeline Schema:
- Extracts all of the above plus
currentOwnerandsecrets(unpromoted).
- Extracts all of the above plus
10. Spell
Magical incantations or abilities.- Template ID:
_template_spell - Database Promoted Attributes:
school(Text) — e.g. Evocation, Necromancy.level(Number) — Spell level (0 for cantrips).castingTime(Text) — Action, Bonus Action, Hours.range(Text) — Distance.components(Text) — V, S, M (and materials).duration(Text) — Concentration, Instantaneous.
- AI Pipeline Schema:
- Extracts all of the above plus
originandsecrets(unpromoted).
- Extracts all of the above plus
11. Building
Specific structural objects like taverns, keeps, or shrines.- Template ID:
_template_building - Database Promoted Attributes:
buildingType(Text) — Tavern, Castle, Temple.owner(Text) — Proprietor or faction.purpose(Text) — Role in town.condition(Text) — Ruined, Pristine, Under Construction.secrets(Text) — GM-only details.
- AI Pipeline Schema:
- Extracts all of the above plus
location(unpromoted).
- Extracts all of the above plus
12. Language
In-world speaking tongues and alphabets.- Template ID:
_template_language - Database Promoted Attributes:
languageFamily(Text),speakers(Text),script(Text),samplePhrase(Text).
- AI Pipeline Schema:
- Extracts all of the above plus
origin(unpromoted).
- Extracts all of the above plus
13. Organization
Guilds, clubs, or non-political local groups.- Template ID:
_template_organization - Database Promoted Attributes:
orgType(Text),leader(Text),headquarters(Text),membership(Text),purpose(Text),status(Text),secrets(Text).
- AI Pipeline Schema:
- Extracts
orgType,purpose,foundingDate,leader,headquarters,status,secretsplusmembersandresources(unpromoted).
- Extracts
14. Race
Species, sub-species, or ethnic groups.- Template ID:
_template_race - Database Promoted Attributes:
homeland(Text),lifespan(Text),traits(Text),culture(Text),relations(Text).
- AI Pipeline Schema:
- Extracts
homeland,lifespan,culture,abilities,racialType,physicalTraits(which maps totraits),languages,relations, andsecrets.
- Extracts
15. Myth
Lore legends or folklore.- Template ID:
_template_myth - Database Promoted Attributes:
mythType(Text),origin(Text),truthStatus(Text),relatedEntities(Text).
- AI Pipeline Schema:
- Extracts
mythType,originplustellers,truthBasis,significance, andsecrets(saved as unpromoted).
- Extracts
16. Cosmology
Planes of existence or cosmic dimensions.- Template ID:
_template_cosmology - Database Promoted Attributes:
planes(Text),cosmicForces(Text),afterlife(Text),creationMyth(Text).
- AI Pipeline Schema:
- Extracts
planesplusdomain,laws,source,interactions, andsecrets(unpromoted).
- Extracts
17. Deity
Gods, pantheons, or celestial powers.- Template ID:
_template_deity - Database Promoted Attributes:
domain(Text),alignment(Text),symbol(Text),worshippers(Text),divineStatus(Text).
- AI Pipeline Schema:
- Extracts
alignment,symbol,worshippersplusdomains(plural),rank,allies,enemies, andsecrets(unpromoted).
- Extracts
18. Religion
Organized faiths and belief networks.- Template ID:
_template_religion - Database Promoted Attributes:
deity(Text),tenets(Text),practices(Text),holyText(Text),faithStatus(Text).
- AI Pipeline Schema:
- Extracts
deity,tenetspluspantheon,clergy,holyDays,headquarters,followers, andsecrets(unpromoted).
- Extracts
19. Session
TTRPG campaign recap entries.- Template ID:
_template_session - Database Promoted Attributes:
sessionDate(Text) — Real-world game date.players(Text) — List of active players.sessionStatus(Text) — e.g. Played, Cancelled, Scheduled.recap(Text) — Campaign events.hooks(Text) — Unresolved clues or tasks.gmNotes(Text) — Secret GM ledger.
- AI Pipeline Schema:
- Extracts
sessionDate,players,sessionStatus,recap,hooks.
- Extracts
20. Quest
Campaign objectives or milestones.- Template ID:
_template_quest - Database Promoted Attributes:
questStatus(Text) — Must beactive,completed,failed, ordeferred.questGiver(Text) — Entity initiating the quest.reward(Text) — EXP, gold, or items.location(Text) — Destination node.hooks(Text) — Plot hooks.consequences(Text) — Results of completion or failure.
- AI Pipeline Schema:
- Extracts all of the above (allowing
"unknown"status as a fallback).
- Extracts all of the above (allowing
21. Scene
Encounters, locations, or isolated narrative units.- Template ID:
_template_scene - Database Promoted Attributes:
location(Text) — Context location node.participants(Text) — Involved NPCs/monsters.outcome(Text) — Resolving event.gmNotes(Text) — Secret notes.
- AI Pipeline Schema:
- Extracts all of the above.
Canonical Relation Types
The AI auto-relate pipeline suggests and applies these 17 bidirectional relationship types. Each is mapped to a Core relation attribute prefixed with~rel.
| Canonical Type | Core Relation Name | Inverse Canonical |
|---|---|---|
ally | ~relAlly | ally |
enemy | ~relEnemy | enemy |
rival | ~relRival | rival |
family | ~relFamily | family |
member_of | ~relMemberOf | has_member |
leader_of | ~relLeaderOf | led_by |
serves | ~relServes | served_by |
located_in | ~relLocatedIn | contains |
originates_from | ~relOriginatesFrom | origin_of |
participated_in | ~relParticipatedIn | has_participant |
caused | ~relCaused | caused_by |
created | ~relCreated | created_by |
owns | ~relOwns | owned_by |
wields | ~relWields | wielded_by |
worships | ~relWorships | worshipped_by |
inhabits | ~relInhabits | inhabited_by |
related_to | ~relRelatedTo | related_to |