ava-langgraphjs

Narrative Intelligence

narrative-intelligence: A three-universe processing framework that analyzes events through Engineer, Ceremony, and Story Engine perspectives, performs narrative coherence analysis, classifies emotional beats, and provides unified narrative narrative state management with NCP schema and Redis-backed persistence.


Discover on npm

View narrative-intelligence on npmjs.com


Desired Outcome

The ava-langgraph-narrative-intelligence package enables developers to create narrative-aware processing systems that analyze events through three interpretive universes:

  1. Three-Universe Event Processing — Every event is analyzed through Engineer (Mia — technical precision), Ceremony (Ava8 — relational protocols), and Story Engine (Miette — narrative patterns) perspectives, with lead universe determination and coherence scoring
  2. Narrative Coherence Analysis — The NarrativeCoherenceEngine scores narrative health across structural, thematic, character, sensory, and continuity dimensions, identifies gaps with severity and routing targets, and produces a Trinity assessment (Mia/Miette/Ava8 synthesis)
  3. Emotional Beat Classification — The EmotionalBeatClassifierNode classifies story beats across 10 emotional tones (Devastating, Hopeful, Tense, Joyful, Melancholic, Triumphant, Fearful, Peaceful, Conflicted, Resigned) with keyword scoring and confidence metrics
  4. Unified Narrative State Management — A shared state contract (UnifiedNarrativeState) across six systems in the stack, with Redis-backed persistence through NarrativeRedisManager and episode lifecycle management
  5. NCP (Narrative Context Protocol) Schema — Full NCP data model with Moments, StoryPoints, NCPStoryBeats, Players, and Perspectives — enabling structured narrative data exchange across the Storytelling system

Structural Tension

The current reality provides complete three-universe processing, coherence analysis, emotional classification, and state management. The creative tension lives in advancing toward structural thinking — a four-node graph (picture→draft→review→revise) that ports miaco’s pde-to-st command into a LangGraph subgraph — and toward consent-gated episode retrieval that respects relational accountability when surfacing historical narrative context.