Docs for shipping AI NPC memory
Start with an NPC retrieval call, then branch into entities, events, context budgets, and engine plugins.
The docs are organized around the memory graph behind your game. Keep your dialogue engine. Use Seizn for persistent entities, relations, witness logs, and next-turn recall.
Quickstart: create an NPC, log an event, retrieve context
This is the shortest path from a new graph to a memory-aware NPC turn using the public graph API.
curl -X POST https://seizn.com/api/v1/graph/$GRAPH_ID/entities \
-H "Authorization: Bearer $SEIZN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"character","name":"Mira","external_id":"npc_mira"}'
curl -X POST https://seizn.com/api/v1/graph/$GRAPH_ID/extract \
-H "Authorization: Bearer $SEIZN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Mira saw the player leave the old gate at dusk."}'
curl -X POST https://seizn.com/api/v1/graph/$GRAPH_ID/context \
-H "Authorization: Bearer $SEIZN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"What does Mira know about the player right now?","max_entities":8,"max_depth":2}'NPC entities + relations
Model the graph the way narrative design already thinks: characters, factions, households, locations, and the relations that connect them.
Entities
Use graph entities for NPCs, factions, locations, quest objects, and anything that should be recallable across turns.
Read tutorialRelations
Store kinship, faction allegiance, witness links, and social state in the graph instead of rebuilding them in prompt text.
Open API referenceEvents + witnesses
Log world changes once, then let Seizn extract entities and relationships from those event traces.
Event ingestion
POST raw narrative text or simulation output to extraction endpoints and turn it into graph updates.
See event endpointsWitness chains
Track which NPC saw, heard, or inherited an event so recall can diverge by perspective instead of flattening into one canon blob.
See modeling guideRetrieval + context budgets
Retrieve the smallest graph slice that explains the next turn: relevant entities, their relations, and the recent event chain.
Context building
Use graph context endpoints to limit recall by max entities, depth, and relationship inclusion before a turn is generated.
Inspect context APIBudgeting
Tune retrieval depth and entity count to keep context tight for both low-cost NPC loops and larger studio deployments.
Check limitsEngine plugins
The plugin story starts the same way in every engine: create the NPC node, log the event, ask for recall on the next turn.
Unity, Unreal, Godot
The integrations hub is where engine-specific setup will live. Use it when you are wiring the memory call into a real game loop.
Open integrations hubRaw HTTP, Python, JavaScript
If you are still proving the loop, start from thin wrappers and keep the memory call explicit before moving into engine plugins.
See integration pathsAPI reference
When you need exact request shapes, limits, auth, and failure modes, jump out of the hub and into the reference pages.
Errors, limits, security
Plan for bad requests, auth failures, throughput limits, and deployment constraints before launch.
Review failure modes