# UniAI

UniAI is a Unity framework for adding AI chat, agents and tool use to a game or editor, with a unified provider layer for Claude- and OpenAI-compatible APIs, streaming responses, multimodal input, an MCP client and image generation.

Model differences are handled through a model-metadata and adapter system rather than hardcoded model names in the core provider logic, and the framework auto-discovers conversation providers, generative providers and chat or image API dialects through an attribute-based registration mechanism. Streaming responses are implemented over UnityWebRequest with a custom server-sent-events parser, and an agent runner supports multi-turn tool-calling loops with replay of both tool results and reasoning content.

An MCP client supports both stdio and Streamable HTTP MCP servers, merging their tools and resources dynamically, and context-window management includes token estimation, a sliding window, summarization-based compaction and an interface for injecting external context. Editor tooling includes a manager configuration window and dedicated windows for chat, agents, MCP connections, models and tools, and the framework can be used both as a Unity Editor assistant and embedded in a game's own runtime.

It targets Unity 2022.3 and newer, is written in C#, and is released under the Apache-2.0 license.

Website: https://github.com/PiscesGameDev/UniAI
