Quickstart
Install the SDK, create a graph, create an NPC entity, log a witnessed event, and retrieve context before the next dialogue turn.
This flow keeps the object model visible on purpose. Once the loop feels right, wrap the same calls inside your Unity, Unreal, Godot, or backend runtime.
Install the SDK
Start with the published package so the project already has Seizn in its dependency graph, even if the first pass uses raw HTTP for graph setup.
npm install seizn
pip install seiznCreate a graph
Create one graph for the game world or shard you want this NPC memory loop to live in. Save the returned graph id for the next four calls.
curl -X POST https://seizn.com/api/v1/graph \
-H "Authorization: Bearer $SEIZN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "smallgod-world",
"description": "NPC memory graph for the first playable"
}'Create the NPC entity
Create or upsert the speaker you want to recall from later. Use a stable external id so the same NPC can be addressed across saves, shards, or engine sessions.
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"
}'Log the witnessed event
Send the line or event text exactly once. Seizn extracts entities and relationships, then stores the witness trail inside the graph.
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.",
"max_entities": 8
}'Retrieve next-turn context
Ask from the NPC's point of view before the next bark, dialogue node, or quest branch. Keep the budget small so the returned graph context stays tight.
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
}'After the first loop works
Move to the API reference for exact schemas, then port the same five calls into your engine wrapper or server-authoritative gameplay service.