NARRA WORKS

Narra is a strongly typed TypeScript runtime for dynamic quests, adaptive stories, game-safe NPC decisions, world events, memory, lore, and player-aware narrative systems.

Narra SDK v1.0.0

What Narra changes

The model can imagine. Your game stays in control.

Narra turns probabilistic provider output into schema-validated, developer-authorized data grounded in player history, world state, lore, and memory.

Trusted input
Player state
World state
Lore + memory
Developer constraints

Only the bounded context needed for the current narrative decision.

Narra runtime02

Generate. Parse. Validate. Guard.

One provider contract, strict Zod schemas, bounded retries, and deterministic action checks.

Game-safe outputValidated

{

status: "ready",

type: "quest",

objectives: 4,

authorized: true

}

Typed narrative data returns to your authoritative game server for execution.

01

Provider creativity

Use capable models for narrative variation, character voice, and story possibility.

02

Deterministic boundaries

Validate schemas, enforce limits, and reject actions your game never authorized.

03

Server authority

Return typed data to the backend that already owns your rules, state, and execution.

Capabilities

Stories adapt. Rules stay yours.

Six focused systems for building responsive narrative without handing authority to a model.

01
ObjectivesRewardsBranches

Generate living quests

Build objectives, rewards, hooks, and branching outcomes from player and world state—within limits you define.

02
ZodLimitsActions

Authorize every action

Validate model output with strict schemas and reject NPC decisions outside your explicit allowedActions.

03
PlayersLoreSessions

Remember what matters

Carry player history, relationships, lore, and session memory into the next narrative decision.

04
DialogueToneNPCs

Adapt dialogue safely

Create contextual NPC dialogue and decisions without handing execution authority to a model.

05
EventsStateConsequences

Let the world respond

Generate bounded world events and narrative consequences grounded in current simulation state.

06
OpenAIxAIClaude

Choose your provider

Use OpenAI, xAI, Gemini, Claude, or a custom adapter behind one strongly typed provider contract.

How it works

From game state to narrative—without losing control.

A clear server-side boundary between probabilistic generation and deterministic game systems, shown as the code your team actually owns.

01

Send trusted game context

Your server supplies player state, world state, established lore, memory, and developer-defined constraints.

Context ready
context.ts
TypeScript
const context = {
  player: {
    id: "player_123",
    level: 8,
    reputation: { ashguard: 40 },
  },
  worldState: {
    location: "Ashen Port",
    weather: "storm",
  },
  constraints: { maxObjectives: 4 },
};
No schema errors · typed output ready
02

Generate through one provider contract

Narra builds one structured request and runs it through OpenAI, xAI, Gemini, Claude, or your own provider adapter.

Provider connected
provider.ts
TypeScript
import { Narra } from "naraworks";

const narra = new Narra({
  provider: "openai",
  apiKey: process.env.OPENAI_API_KEY!,
  timeoutMs: 30_000,
  maxRetries: 2,
});

const quest = await narra.quests.generate(context);
No schema errors · typed output ready
03

Validate every narrative result

Strict schemas parse the response while deterministic guardrails enforce objective, item, and allowed-action limits.

Validation passed
guardrails.ts
TypeScript
const decision = await narra.npc.decide({
  npc: captainMara,
  context,
  allowedActions: [
    "offer_quest",
    "share_rumor",
    "refuse_service",
  ],
});

// Unsupported actions never reach the game.
assertAllowedAction(decision.action);
No schema errors · typed output ready
04

Execute only what your game allows

Narra returns typed data. Your authoritative server decides what becomes dialogue, a quest, a world event, or an action.

Game-safe output
game-server.ts
TypeScript
if (quest.status === "ready") {
  await gameServer.quests.create({
    playerId: context.player.id,
    title: quest.title,
    objectives: quest.objectives,
    rewards: quest.rewards,
  });
}

// The model proposes. Your server executes.
No schema errors · typed output ready

Roadmap 2026—2027

From typed runtime to a living narrative platform.

Four focused releases that move Narra from server-side SDK to a collaborative system for adaptive game storytelling.

01Complete

Jun — Aug 2026

Narra SDK release

Ship typed quests, narrative, NPC decisions, world events, memory, lore, guardrails, and multi-provider support.

02In progress

Aug — Sep 2026

Narrative studio

Build a visual workspace for testing quests, dialogue, world events, player context, and structured narrative output.

03Planned

Oct — Dec 2026

Engine integrations

Deepen Unity, Godot, Unreal, and web integration patterns with production-ready server examples and adapters.

04Planned

Jan — Mar 2027

Live world operations

Introduce shared lore governance, narrative observability, event histories, evaluation suites, and team-safe release controls.

Questions worth asking

Before Narra enters your world.

The practical boundaries teams need before generated narrative becomes part of a live game.