Documentation

Everything you need to integrate NeuraNPC. Most developers are up and running in an afternoon.

1Quick Start

Get started with NeuraNPC in minutes. Install the SDK, configure your API key, and create your first NPC.

Install the SDK
npm install @neuranpc/sdk

# or with yarn
yarn add @neuranpc/sdk

2Installation

NeuraNPC supports JavaScript/TypeScript, Unity, and Unreal Engine. Choose your platform:

JS

JavaScript/TS

npm, yarn, pnpm

U

Unity

Coming Soon

UE

Unreal

Coming Soon

3Your First NPC

Create an NPC with personality and start a conversation:

Create and chat with an NPC
import { createNPC } from '@neuranpc/sdk';

// Initialize your NPC
const innkeeper = createNPC({
  apiKey: process.env.NEURANPC_API_KEY,
  name: 'Mira',
  personality: {
    traits: ['friendly', 'helpful', 'curious'],
    backstory: 'A warm innkeeper who runs the Golden Flagon tavern.',
    speechStyle: 'warm and welcoming, slight medieval tone'
  }
});

// Start a conversation
const playerId = 'player-123';

const response = await innkeeper.chat(
  "Hello! Is there a room available?", 
  playerId
);

console.log(response.message);
// "Welcome to the Golden Flagon, traveler! Of course we have rooms..."

console.log(response.emotion);
// "friendly"

console.log(response.memories);
// ["Player is looking for a room", "First interaction"]

How It Works

NeuraNPC uses a cloud-based AI engine to generate contextual, personality-driven responses in real-time.

Your GameUnity / Unreal / Web
NeuraNPC SDKLightweight Client
NeuraNPC CloudAI + Memory
AI EngineLLM Processing
Average response: <100ms
Uptime: 99.9%

SDK Overview

The SDK handles connection, authentication, and conversation management. Here's what you can do:

Chat Management

Send messages, receive responses with emotion and context.

Memory Access

View, edit, or inject memories into NPC context.

Emotion Detection

Get real-time emotion state to drive animations.

Multi-NPC Support

Manage multiple NPCs with shared world context.

Memory System

NPCs automatically extract and store relevant information from conversations. Access or modify memories programmatically:

Working with memories
// Get NPC's memories about a player
const memories = await npc.getMemories(playerId);

// Inject a memory (game events, quest updates, etc.)
await npc.addMemory(playerId, "Player defeated the dragon");

// Clear memories for testing
await npc.clearMemories(playerId);

Personality Engine

Define rich personalities with traits, backstories, and speech patterns:

Defining personality
const grumpyBlacksmith = createNPC({
  apiKey: process.env.NEURANPC_API_KEY,
  name: 'Grumble',
  personality: {
    traits: ['grumpy', 'skilled', 'secretly kind'],
    backstory: 'A master blacksmith who lost his apprentice to war.',
    speechStyle: 'short sentences, gruff, occasional softness',
    likes: ['quality craftsmanship', 'honest work'],
    dislikes: ['small talk', 'lazy adventurers']
  }
});

Emotion Detection

Every response includes an emotion state you can use to drive character animations:

neutralhappysadangrycurioussuspiciousamusedconcerned
Using emotions
const response = await npc.chat("I stole from the merchant", playerId);

console.log(response.emotion); // "angry" or "disappointed"

// Use in your game
character.playAnimation(response.emotion);
character.setFacialExpression(response.emotion);

Authentication

Authenticate with your API key. Keep it secure on the server side.

Authentication
// Environment variable (recommended)
const npc = createNPC({
  apiKey: process.env.NEURANPC_API_KEY,
  // ...
});

// Or pass directly (development only)
const npc = createNPC({
  apiKey: 'nnpc_live_xxxxxxxxxxxxx',
  // ...
});

Security Note: Never expose your API key in client-side code. Use a backend proxy for browser-based games.

Chat Endpoint

Direct REST API access for custom integrations:

POST /api/chat
curl -X POST https://api.neuranpc.com/v1/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "npcId": "npc_xxxxx",
    "playerId": "player_123",
    "message": "Hello, innkeeper!"
  }'

# Response
{
  "success": true,
  "message": "Welcome, traveler! Looking for a room?",
  "emotion": "friendly",
  "memories": ["New visitor arrived"]
}

NPC Management

Create, update, and manage NPCs via API:

NPC CRUD Operations
// Create NPC
POST /api/npcs
{
  "name": "Mira",
  "personality": { ... }
}

// List NPCs
GET /api/npcs

// Update NPC
PUT /api/npcs/:id
{
  "personality": { ... }
}

// Delete NPC
DELETE /api/npcs/:id

Integration Examples

See how NeuraNPC integrates with popular development environments

VS Code SDK Integration

TypeScript SDK

Full IntelliSense support with typed configurations and autocomplete.

Unity Editor Integration

Unity Integration

Seamless dialogue management with the NeuraNPC SDK in Unity.

See It In Action

NPC Dialogue System

Natural Dialogue

NPCs respond naturally to player choices with context-aware dialogue.

NPC Memory System

Persistent Memory

NPCs remember player actions and reference them in future conversations.

Ready to Build?

Start building with NeuraNPC today. Get your API key and create your first NPC in minutes.