The Gemini AI Agent is a fully integrated chat interface inside the web client that lets you control Unreal Engine 5.8 using plain English (or any language). You type a request, and the agent figures out which Unreal tools to call, executes them against the live editor, and returns a markdown-formatted response — all without leaving the browser.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/davidbuenov/dbv-mcp-server/llms.txt
Use this file to discover all available pages before exploring further.
What It Is
The agent is a multi-turn, tool-calling AI loop built on the Google Gemini API. It is implemented entirely in the browser (src/js/app.js, function runAgentLoop) — no server-side LLM infrastructure is required.
On each turn, the agent:
- Sends the full conversation history plus the available tool declarations to
https://generativelanguage.googleapis.com/v1beta/models/<model>:generateContent. - Receives either a text response (conversation complete) or one or more
functionCallparts (tool invocations required). - Executes each requested tool call against the proxy server and collects the results.
- Appends the tool responses to the history and repeats.
Supported Models
Select your preferred model from the 🤖 Modelo dropdown in the app header:| Model | Characteristics |
|---|---|
gemini-3.5-flash ⚡ | Fast, low latency — best for most Unreal tasks |
gemini-3.5-pro 🧠 | Higher reasoning capacity for complex multi-step workflows |
gemini-3.1-pro 💡 | Balanced capability and cost |
gemini-3.1-flash-lite 💰 | Most economical — suitable for simple queries |
Setup
The agent requires a Google Gemini API key. To configure it:- Obtain a free API key from Google AI Studio.
- Paste the key into the 🔑 Gemini API Key field in the app header.
- The key is saved to
localStorageautomatically — it persists across page reloads and server restarts without ever being written to source code or sent to any backend other than the Gemini API directly from your browser.
Your Gemini API key is stored only in your browser’s
localStorage under the key gemini_api_key. It is never transmitted to server.py or logged to the terminal. All Gemini API calls are made directly from the browser to generativelanguage.googleapis.com.How the Agent Loop Works
TOOL_TIMEOUT_MS = 60000). If Unreal does not respond within that window the tool returns a timeout error message and the agent continues with the next iteration. The user can also click ✕ Cancel at any point to abort the entire loop via AbortController.
Tool Inventory Available to the Agent
The agent’s tool declarations are built dynamically at connection time bygetGeminiTools() and fall into three categories:
1. Virtual Tool — dbv_python_unreal_api
Queries the local Unreal Python API knowledge base (~11,600 class pages) before writing any Python script. The agent’s system instruction mandates calling this tool before any RunPython invocation to prevent hallucinated API calls.
The
dbv_python_unreal_api virtual tool is checked by the agent before generating RunPython scripts. When the Gemini model would otherwise hallucinate a UE Python method, this lookup returns the real class signature from the local knowledge base, grounding the generated code in the actual UE 5.8 API.2. Virtual Tool — dbv_unreal_dev_guide
Queries the local conceptual dev-guides knowledge base (~3,600 documentation pages) for design patterns, workflows, and recipes (Materials, Blueprints, PCG, Gameplay, Niagara, etc.).
dbv_unreal_dev_guide first for any task involving Blueprint design, PCG graphs, material workflows, or other high-level architecture decisions.
3. All Flattened Unreal MCP Tools
Every tool that appears in the sidebar after connecting is also registered with Gemini. Tool names are sanitised for Gemini compatibility: dots are replaced with underscores (e.g.editor_toolset.toolsets.scene.SceneTools.SpawnActor → editor_toolset_toolsets_scene_SceneTools_SpawnActor).
The client keeps a reverse-lookup map (availableAgentTools) so that when Gemini returns a function call with the sanitised name, the proxy correctly reconstructs the original toolset_name + tool_name pair before forwarding to Unreal.
JSON Schema Translation
MCP tool schemas are not directly compatible with Gemini’s strict schema validator. The client transforms each schema viaconvertSchemaToGemini() before sending tool declarations:
| Transformation | Reason |
|---|---|
Remove additionalProperties | Not supported by Gemini schema validator |
Remove $schema | Not supported |
Remove default | Not supported |
Remove title | Not supported |
Uppercase type values | Gemini requires "STRING", "OBJECT", etc. |
Recursively transform nested properties and items | Ensures all levels comply |
Example Prompts
Try these to get started after connecting and entering your API key:dbv_python_unreal_api lookup before the agent writes the script, ensuring it uses the correct unreal.SystemLibrary or unreal.EditorLevelLibrary class signatures for UE 5.8.
Mandatory Reasoning Order for Python Tasks
The agent’s system instruction enforces a strict workflow for any task that requires executing Python in Unreal:dbv_unreal_dev_guide— understand the conceptual design: what subsystem to use, what the workflow looks like.dbv_python_unreal_api— verify exact class names and method signatures for UE 5.8.- Write the Python script — using only API members confirmed by step 2.
RunPython(via the relevant toolset) — execute the validated script in the editor.