Apache 2.0 · Self-hostable

Give your NPCs a soul.
Not a script.

Neshama is a soul engine that runs inside your game. Emotions, memory, personality, social relationships — all local, all real-time.

TavernKeeper.cs
var soul = NPCSoul.Create(preset: "tavern_keeper");
soul.OnEmotionChanged += e => { /* update NPC behavior */ };
await soul.Chat("Hello, how's business?");

// Soul handles the rest:
//   → Emotion: Content → Curious (joy +0.12, trust +0.08)
//   → Memory: "Player asked about business"
//   → Personality: OCEAN traits influence response tone

Three things you can verify.

No marketing spin. Each claim is testable in under 5 minutes.

Runs in your game, not on our server

Local-first soul engine

The emotion engine runs in your game process. Emotions update every frame. No server dependency. Works offline. Your players never hit a cloud endpoint just to feel something.

from neshama.soul import CompositeEmotion emotion = CompositeEmotion.evaluate( stimulus="player_insulted", personality=ocean_traits, history=recent_events ) # No network call. Pure math. <10ms.

< 10ms. Every frame.

Rule-based emotion calculation

Pure rule-based emotion engine. No LLM calls for emotions. Only dialogue generation needs AI. The math is deterministic, testable, and fast enough to run per-frame.

# Benchmark: 10,000 emotion evaluations import time start = time.perf_counter() for _ in range(10000): engine.update(stimulus) elapsed = time.perf_counter() - start print(f"Avg: {elapsed/10000*1000:.2f}ms") # → Avg: 0.34ms

3 lines of code

Integration under 5 minutes

Create a soul, subscribe to emotion changes, start chatting. That's the entire API surface. No config files, no dashboards to configure, no schema to learn.

pip install neshama from neshama import NPCSoul soul = NPCSoul.create("tavern_keeper") response = await soul.chat("Hello!")

Same scene. Different soul.

Player insults the tavern keeper, then comes back 3 game-days later. Watch what happens.

Without Neshama

Player

"Your ale tastes like dishwater."

Tavern Keeper

"I'm sorry to hear that. Would you like something else?"

...3 game-days later...
Player

"Hello there!"

Tavern Keeper

"Welcome, traveler! What can I get for you?"

With Neshama

Player

"Your ale tastes like dishwater."

Tavern Keeper

"You got a lot of nerve saying that. Maybe try the place down the street."

Emotion: Anger +0.45, Disgust +0.30 | Agreeableness −0.12
...3 game-days later...
Player

"Hello there!"

Tavern Keeper

"Oh. It's you. Last time you were here, you insulted my ale. What do you want?"

Memory: "Player insulted ale" retrieved | Emotion: Resentment +0.28

How a soul is built.

Five subsystems. One deterministic core. Only dialogue generation touches an LLM.

NPCSoul
├── OCEAN Personality      ← 5 factor traits, evolves over time
│   ├── Openness
│   ├── Conscientiousness
│   ├── Extraversion
│   ├── Agreeableness         ← this one just went down after the insult
│   └── Neuroticism
│
├── Composite Emotion Engine  ← rule-based, <10ms, no LLM
│   ├── 8 primary emotions
│   ├── 15 composite recipes   ← e.g. Rage = Anger + Disgust + Anticipation
│   ├── Decay curves
│   └── Conflict resolution
│
├── Progressive Memory      ← L0 → L1 → L2 consolidation
│   ├── L0: Working memory     ← last N interactions
│   ├── L1: Summarized memory  ← automatic consolidation
│   └── L2: Core memory        ← permanent, identity-defining
│
├── Entity Graph           ← who knows whom, what, where
│   ├── 8 entity types
│   └── 15 relation types
│
└── Dialogue Generator       ← the ONLY part that uses an LLM
    └── 21 providers, 55+ models

Drop into your engine.

Native packages for major game engines. REST API for everything else.

U
Unity
UE
Unreal Engine 5
T
团结引擎
{ }
REST API
Py
Python SDK

Start free. Scale when ready.

Free tier includes 3 NPC souls. Bring your own LLM key, conversations are unlimited.

Free

$0/mo

Prototype and learn

  • 3 NPC souls
  • 5,000 emotion calculations/mo
  • L0 working memory
  • Static OCEAN traits
  • BYOK = unlimited dialogue
Get Started

Indie

$19/mo

Ship your indie game

  • 10 NPC souls
  • 50,000 emotion calculations/mo
  • L0 + L1 memory
  • Dynamic personality evolution
  • Community support
Start Trial

Studio

$79/mo

Mid-size studios

  • 50 NPC souls
  • 500,000 emotion calculations/mo
  • L0 + L1 + L2 full memory
  • Entity graph & social engine
  • Priority support
Start Trial

Enterprise

Custom

AAA & platforms

  • Unlimited NPC souls
  • Unlimited calculations
  • Custom memory hierarchies
  • On-premise deployment
  • SLA & dedicated support
Contact Us

BYOK = Bring Your Own Key. Use any of 21 LLM providers. You pay the model provider directly — we don't add markup.

Ship NPCs worth talking to.

Open source. Self-hostable. Free to start. 3 lines of code.