Bring your NPCs to life.

A Rust runtime for game NPCs — conversations, quests, inventory, and beliefs — exposed through a stable C ABI that works with any engine.

Quick C example on this page →

💬

Freeform dialogue

Replace rigid dialogue trees with real back-and-forth. Players drive the topic; NPCs stay consistent with lore and personality instead of offering three canned replies.

📜

Quests

Write quests as step graphs. NPCs drop the right hints at the right time, and steps advance on what's said in conversation or on items changing hands — no dialogue parsing in your game.

🎒

Inventory

NPCs know what they carry and what you're visibly holding. They offer and ask for items in their own words; your game decides what changes hands, and they remember every trade.

💭

Beliefs

NPCs believe things about players and each other — who carries what, who they owe, what faith a stranger keeps. Seed their assumptions, and let them be wrong.

🌐

Universal C ABI

One shared library. Unity, Unreal, Godot, custom engines — if it can call C functions, it can use Animist.

🧱

Memory Safe

Built in Rust with panic catching at the FFI boundary. No undefined behavior leaking into your game.

📦

Zero Dependencies

Link a single static or dynamic library. No runtime to install, no package manager, no framework lock-in. On Linux the library uses the system's OpenSSL 3 (libssl.so.3), which most current distributions already include.

🛡

Clean Handle API

Opaque handles with status codes. Familiar patterns for anyone who's integrated a C library before.

🧠

NPC memory

Rolling summarization keeps long conversations coherent, and export/import lets you persist and restore dialogue with your saves.

A conversation in a few lines of C

const char* config = "{ \"license_token\": \"…\", \"api_key\": \"…\" }";
AnimistRuntimeHandle* runtime = NULL;
animist_runtime_create(config, &runtime);

uint64_t player_id = 1, char_id = 100;
animist_character_register(runtime, char_id, "{ \"name\": \"Merchant\" }", false);

uint64_t conv_id;
animist_conversation_begin(runtime, player_id, char_id, &conv_id);

AnimistResponseHandle* response = NULL;
animist_conversation_send_message(
    runtime, conv_id, char_id, "Merchant",
    player_id, "Do you sell potions?", &response);

char* text = NULL;
animist_response_get_text(response, &text);
printf("%s\n", text);

animist_string_free(text);
animist_response_destroy(response);
animist_runtime_destroy(runtime);

Config JSON carries your developer license token and your LLM provider's API key (OpenAI by default; leave the key out and the NPC gives placeholder replies while you wire things up). Create a runtime, register a character, start a conversation, send messages, read responses. Same pattern in C#, C++, Python, or any FFI-capable language — see the full C ABI docs for status codes, JSON payloads, and memory rules.

See it running right now

This site is itself a consumer of the Animist C ABI, loaded via Node.js FFI. The demo page talks to a real AnimistRuntime through the same shared library your game would link—try freeform NPC chat there, not just preset dialogue lines.

Integrating the C ABI in your game? Request a free developer license (email in, signed token out, verified offline; games you ship never expire). Questions? Reach us at support@animistnpc.com.

Open the Demo