EricSun0218/OpenGameAgent
An open-source C# toolkit that lets game NPCs act like autonomous agents, not just chatbots
OpenGameAgent is a compact C# runtime that lets game characters observe game state, decide, call developer-defined tools, and keep working toward a goal instead of just returning a single line of dialogue. It runs inside Godot, Unity, or .NET servers, while the game itself always stays in control of whether an action actually happens. The project is at version 0.3.0-alpha.2, so its public interfaces can still change before a stable 1.0.
What it does
- Problem addressed: most AI-driven NPCs today just take a prompt and produce a reply, with no ability to observe results, use tools, or continue working across multiple steps.
- How it works: a small 'agent kernel' streams model output, runs validated developer-defined tools (move, trade, build, etc.), and loops back with results until the task is done; an optional 'game runtime' layer adds game-specific concepts like timelines, ticks, sessions, and memory.
- Key boundary: the AI model never directly changes game state — it can only request actions, and the game code validates and executes every mutation, returning an authoritative result.
- What's included: streaming tool-calling, persistent memory with vector/lexical search, task plans, multi-NPC concurrency control, image input support, plugin system (Agent Plugins), and connectors for many model providers (Anthropic, OpenAI, Gemini, Bedrock, Mistral, etc.).
- Where it runs: as a library inside Godot 4.7 or Unity 6 projects, inside a game's own server, or as a separate agent service reached over HTTP/SSE.
Why it matters
Game developers who want NPCs that plan, use tools, and remember things (not just chat) get a reusable, engine-agnostic building block instead of writing this agent-loop plumbing themselves. Because the framework keeps the game authoritative over every state change, it's a safer pattern for adding LLM-driven behavior without letting a model directly mutate game logic.
Terms in this repo
- agent kernel · the core loop that streams model output, calls tools, and repeats until a task finishes
- tool calling · letting the AI model request specific developer-defined actions (like 'move' or 'trade') instead of freely changing game state
- game runtime · an optional layer adding game-specific features like game clocks, sessions, and per-actor concurrency on top of the kernel
- MCP · Model Context Protocol, a standard way for external tool servers to be discovered and called by an agent
- vector index · a searchable store of text embeddings used to retrieve relevant memories by meaning, not just keywords
Repository description (English)
a compact, hackable C# runtime for AI-native games, autonomous NPCs, tool calling, memory, workflows, Godot, and Unity.
Open on GitHubTrending repos
- vorssaint/vorssaint-utilsOne free menu bar app replaces a dozen paid Mac utilities
- Alishahryar1/free-claude-codeA local proxy that lets coding AI agents run on 49 free or cheap model providers instead of one paid service
- freestylefly/awesome-gpt-image-2A library of 532 reverse-engineered prompts that turn GPT-Image2 into a predictable image-making tool
- block/buzzAn open-source workspace where humans and AI agents chat, code, and review in the same rooms
- NousResearch/hermes-agentNous Research's Hermes is an AI agent that gets smarter the more you use it
- virgiliojr94/book-to-skillA tool that turns technical book PDFs into on-demand reference skills for AI coding agents
- VoltAgent/awesome-agent-skillsA single hub collecting over 1000 'how-to' manuals that make AI coding assistants act like experts
- anthropics/claude-plugins-communityA shared shelf where anyone's Claude add-ons get listed for install