AI Assistant
The Code Editor has a built-in AI assistant: a chat panel that knows about the function you are looking at. Use it to explain unfamiliar code, suggest optimizations, or sketch out an extension before you write it.
Turning it on
Section titled “Turning it on”The AI features need an API key. Add one under Project Settings → Plugins → Code Editor:
- Claude: set your Claude API Key (and optionally the model and endpoint).
- ChatGPT: set your OpenAI API Key (and optionally the model and endpoint).
See Settings for the exact fields and their defaults.
Opening the chat
Section titled “Opening the chat”The AI panel is part of the Code Editor and starts collapsed. Expand it from the editor to reveal the conversation, an input box, and two dropdowns: provider and context.
Choosing a provider
Section titled “Choosing a provider”The provider dropdown switches between Claude and ChatGPT per message. The default comes from Default Chat Agent in settings (Claude out of the box). The model used for each provider is whatever you set in Claude Model / OpenAI Model.
Choosing the context
Section titled “Choosing the context”The context dropdown controls what slice of code is attached to your message:
| Context | What gets sent |
|---|---|
| Visible code | The function currently loaded in the active pane. This is the default. |
| User selection | Only the text you have selected in the active editor. |
Pick User selection and highlight a few lines when you want the model to focus on one spot; leave it on Visible code for questions about the whole function.
Per-function conversations
Section titled “Per-function conversations”Conversations are saved per function. Select a node, chat about its code, move to another node, and come back: your earlier thread for that function is still there. The close / reset control on the panel clears the current conversation while keeping the function context.
What the assistant is told
Section titled “What the assistant is told”Every conversation is seeded with System Instructions you can edit in settings. The default keeps answers focused on Unreal C++:
- UE C++ function context- Keep answers concise- Help understand/optimize/expand function- Follow UE5.1+ conventions- Verify functions existTune these to change the assistant’s behavior globally (house style, preferred patterns, verbosity, and so on).
Keeping token use down
Section titled “Keeping token use down”A few settings cap how much is sent on each request:
| Setting | Default | Effect |
|---|---|---|
| Max History Messages | 5 | How many recent messages are resent for context. |
| Simple Query Max Tokens | 1024 | Token cap for short exchanges (1 to 2 messages). |
| Regular Max Tokens | 2048 | Token cap once a conversation is longer. |
Lower values mean cheaper, faster calls at the cost of less context; raise them for longer, more involved discussions.