This project addresses the challenge of generating varied, context-appropriate behavior for large populations of ambient NPCs in open-world games without exceeding tight runtime budgets. The core contribution is a memory-driven action selection framework where NPC behaviors are defined as directed graphs of actions and a bounded memory mechanism favors untried or least-recently used transitions, producing behavioral variety without requiring online planning or search. The framework is implemented as an engine-agnostic C++ shared library with a public C API and JSON-defined behavior configurations. It has been integrated and validated in both Unity and Unreal Engine, demonstrating cross-engine portability and sub-linear performance scaling from 50 to 200 NPCs while remaining well within per-frame budget targets.