NPC AI

Biologically-Grounded Game AI

Five brain tiers from reactive insects to scheming politicians. Persistent personality evolution, faction dynamics, and emergent social behavior — all stored as temporal vectors with behavioral compression.

Five Brain Tiers

Scale NPC cognitive complexity to match their narrative importance. Background crowds use T0 reactive behaviors. Key characters use T4 strategic planning with personality-driven decision making.

T0 — Reactive
Stimulus-response
Simple state machines for ambient NPCs: wildlife, background crowds, environmental entities. Minimal compute cost, maximum population density. Responds to immediate stimuli with fixed behaviors.
T1 — Instinctive
Need-driven behavior
Behavioral drives (hunger, fear, curiosity) that create emergent daily routines. NPCs autonomously seek resources, avoid threats, and form basic habits without scripted schedules.
T2 — Emotional
Mood and memory
Emotional state that persists across interactions and colors future decisions. An NPC insulted by the player remembers the slight and adjusts behavior accordingly. Mood decays naturally over time.
T3 — Social
Relationship-aware
Tracks relationships with other NPCs and players. Forms alliances, holds grudges, and makes decisions based on social context. Social bonds influence quest availability and dialogue options.
T4 — Strategic
Long-term planning
Goal-oriented reasoning with multi-step plans. Political NPCs scheme, merchants optimize trade routes, and faction leaders coordinate group strategy. Full OCEAN personality model drives decision-making style.
Resource Scaling
Automatic tier assignment
Assign brain tiers based on narrative importance, player proximity, or runtime budget. Thousands of T0 NPCs coexist with dozens of T4 characters. The database handles state persistence for all tiers uniformly.

OCEAN Personality Model

Each NPC has a five-factor personality profile that evolves through experience. No two NPCs respond identically to the same situation.

Five Factors
Persistent personality dimensions
Every NPC carries five personality dimensions that influence behavior across all interactions:
  • Openness — curiosity, willingness to explore or try new approaches
  • Conscientiousness — discipline, reliability, adherence to rules
  • Extraversion — social energy, leadership tendency, group preference
  • Agreeableness — cooperation, empathy, conflict avoidance
  • Neuroticism — stress reactivity, emotional volatility, risk aversion
Evolution
Personality shifts through experience
Personality traits evolve based on the NPC's experiences. A shy NPC forced into repeated combat may become more assertive. A trusting NPC who is betrayed shifts toward suspicion. VectorScaleDB tracks these personality trajectories as temporal vectors, enabling:
  • Personality evolution queries over time
  • Behavioral archetype classification
  • Emergent personality drift detection
  • Cross-population personality analytics

Faction Dynamics

Factions are living organizations with measurable cohesion, internal politics, and inter-faction relationships that evolve based on member actions.

Cohesion Analysis
Measuring faction unity
Track how aligned faction members are in their behavior and goals. High cohesion factions act as unified blocs. Low cohesion factions splinter, with members defecting or forming sub-factions. Query faction cohesion scores to drive narrative events.
Social Cascades
Actions ripple through networks
When a key NPC changes allegiance or is eliminated, the effects cascade through social bonds. VectorScaleDB predicts which NPCs will be affected and how strongly, enabling the game to trigger appropriate reactions across the faction network.

Behavioral Compression

NPC state is inherently compressible. An NPC guarding a door for 8 hours generates one compressed segment. The moment they spot an intruder, a new behavioral regime begins.

Idle NPCs
1,000x+ compression
Background NPCs in stable routines — shopkeepers, guards, farmers — compress at extreme ratios. Store thousands of idle NPC histories in kilobytes.
Combat
5-10x compression
Active combat creates rapid state changes. Compression adapts automatically, capturing every tactical decision while still reducing storage significantly over raw state dumps.
Emergent Events
Regime boundaries as events
Compression regime boundaries align with meaningful behavioral transitions. A segment boundary is a detectable event: the moment an NPC changed behavior. Query these transitions directly.

NPC Query Functions

Seven built-in query functions for NPC AI analytics and runtime decision support.

Prediction & Classification
Behavioral intelligence
  • POST /v1/npc/response-prediction — predict NPC response to a stimulus based on personality and history
  • POST /v1/npc/personality-evolution — track how an NPC's personality has shifted over time
  • POST /v1/npc/behavioral-archetype — classify NPCs into behavioral archetypes from their history
  • POST /v1/npc/emergent-behavior — detect unexpected behavioral patterns in NPC populations
Social Analysis
Faction and relationship queries
  • POST /v1/npc/faction-cohesion — measure behavioral alignment within a faction
  • POST /v1/npc/social-cascade — predict ripple effects of NPC actions through social networks
  • POST /v1/npc/relationship-trajectory — forecast relationship evolution between NPCs

Game Engine Integration

Native ingestion adapters for game engine state. Push NPC, faction, and social bond data directly from your engine without format conversion.

Integration
REST API with game engine adapters
VectorScaleDB accepts game engine state via REST API with built-in adapters that convert NPC agent state, faction configurations, and social bond updates into temporal vectors. State is compressed and indexed automatically, with sub-millisecond ingest latency.
# Ingest NPC state from game engine
curl -X POST https://api.vectorscaledb.com/v1/ingest/game-engine \
  -H "Content-Type: application/json" \
  -d '{
    "npc_agents": [{
      "entity_id": "guard-captain-01",
      "brain_tier": 3,
      "personality": [0.3, 0.8, 0.5, 0.6, 0.2],
      "mood": [0.7, 0.1, 0.3],
      "position": [120.5, 45.2, 10.0],
      "faction": "city-guard",
      "state": "patrolling"
    }],
    "timestamp": "2026-03-13T14:30:00Z"
  }'

# Query: predict NPC response to player action
curl -X POST https://api.vectorscaledb.com/v1/npc/response-prediction \
  -H "Content-Type: application/json" \
  -d '{
    "entity_id": "guard-captain-01",
    "stimulus": "player_bribe",
    "k": 5
  }'

Related Capabilities

Build NPCs that remember, evolve, and surprise

See biologically-grounded NPC AI running on your game data.