
Portal 2 AI Mod: A Talking Test-Chamber AI and Voice Commands
Portal 2 map scripts cannot reach the internet. That is the one problem every Portal 2 AI mod has to solve, and the answer is a small helper app that sits next to the game. Once it is in place, your test chamber can have its own talking AI, which suits a game about being judged by a voice in the walls: a chamber that notices you failing the same jump five times and has something to say about it, a chamber you control by speaking, and a quiz that only opens the exit for correct answers. Neocortex provides the AI character, Conversation Flows, quizzes and on-device voice commands.
Screenshot: Portal 2 © Valve
Why does a Portal 2 AI mod need a helper app?
Portal 2 maps are built in Hammer with the Portal 2 Authoring Tools and shared on the Steam Workshop. Map logic is entity I/O plus VScript, which in Portal 2 is Squirrel. VScript can read and move entities, track the player and print to the console, but it has no network or HTTP access.
So the map does what it can do, report and react, and a local helper app does the talking to Neocortex. The helper can be written in any language with an HTTP client.
How do events get out of the game and back in?
| Direction | How |
|---|---|
| Out of the game | Your VScript prints tagged lines (an event, a chamber state) to the console. Launching Portal 2 with -condebug writes console output to a console.log file the helper can watch. See Valve's command line options. |
| Back into the game | The -netconport launch option opens a console port that lets the helper send console commands back, for example a script call into your map's VScript. Keep that port on your own machine. |
| Subtitles | Your map shows reply text with a game_text entity. |
| Voice | The helper plays the character's voice through the PC's audio output. |
On the Neocortex side, the helper reads game state from the console log and sends it with the player's message to a character through /v3/chat. The map shows the reply as subtitles, the helper plays the voice from /v3/audio/generate or /v3/audio/stream, and the actions the character returns go back to the map as console commands. Conversation Flows return checkpoint keywords (flowState) the map reacts to, such as opening the next test, and the quiz engine runs question-and-answer games through /v3/quiz.
What can a test-chamber AI do?
Create an original overseer instead of borrowing the game's: PROCTOR-7, a facility intelligence that was demoted to running one chamber and is not happy about it. Give it a Personality, an Emotion setting and a Knowledge base about your chamber's solution, its history and its petty grievances.
Your map reports what happens: "player fell in the goo", "third failed fling at panel B", "cube placed on the wrong button", "player has been standing still for 40 seconds". The helper sends those as events with each message, and PROCTOR-7 comments in voice, with an emotion tag on every line: CURIOUS when you try something new, ANGRY when you break the intended solution.
It can also return actions, such as a grudging { "name": "SPAWN_CUBE", "targetId": "dropper_01" } after enough failures, which your map runs as a hint.
A Conversation Flow can turn the whole chamber into a story: introduction, first test, a "malfunction" the player has to talk PROCTOR-7 through, and a final test. Each checkpoint keyword the API returns opens the next part of the map.
Screenshot: Portal 2 © Valve
Can the player solve a chamber by talking?
Yes. Build a chamber the player solves by talking to it. In the Neocortex dashboard you design a command set as actors, actions and objects: actor "chamber", actions "raise", "lower", "drop" and "extend", objects "platform", "cube" and "bridge".
Players speak naturally, and the helper receives matched commands instantly, including several actions and quantities in one sentence: "drop two cubes and raise the platform". It works with push-to-talk or always-listening, in multiple languages, and Neocortex Voice Commands runs on the player's machine with no cloud round trip, which matters when the timing of a fling depends on it.
Voice Commands is a licensed SDK: contact us for a Voice Commands license.
The same chamber can test knowledge instead of reflexes. An announcer character asks physics questions built in the Neocortex dashboard: momentum, gravity, why a portal keeps your speed. The quiz engine (Team plan) runs the questions and scoring; each right answer powers one more light bridge segment, and a wrong one drops a cube into the goo.
Does it work in Portal 2: Community Edition?
Portal 2: Community Edition is a community-maintained version of Portal 2 on Strata Source, an officially licensed fork of the CS:GO engine branch. It entered open beta on Steam on April 17, 2026, is free for Portal 2 owners, and adds a native 64-bit port, AngelScript scripting, Panorama UI, an addon system and its own Workshop.
It is still a beta, so check its documentation for what its scripting can do. The helper-app pattern works there either way.
Can you publish it on the Workshop?
Valve's Workshop terms apply to the map, and the helper app is a separate download players choose to run. Keep AI and voice features to single-player chambers, never use them to gain an edge in co-op with players who did not opt in, and have each player use their own Neocortex API key.
Build your first talking chamber
- Build a test chamber in Hammer with a VScript file that prints tagged events to the console.
- Design your character in the Neocortex dashboard: PROCTOR-7's Personality and Knowledge, a Conversation Flow for the chamber, a quiz, and a command set.
- Write the helper app: watch
console.log, call/v3/chat, play the voice, and send commands back through the console port. - Keep the API key in the helper's config file, filled in by the player, never hard-coded in a build you share.
- Test in single-player with the launch options set, then publish the map on the Workshop and the helper separately.
For the voice side, read on-device voice commands for game mods. For engine-level mods on Source, see our Half-Life 2 AI NPC mod guide, and for a Source game whose scripts can call the API directly, our Titanfall 2 AI mod guide. And if you later want PROCTOR-7 in a standalone game, the same Neocortex character works through our Unity integration.
Tool versions and links checked October 2026. Modding tools change often; check each project's page for the latest release.
Frequently Asked Questions
Can you add an AI character to Portal 2?
Yes, with a small helper app. Portal 2 map scripts cannot reach the internet, so the map prints events to the console and a local helper app passes them to an AI character. Neocortex supplies the character, its voice and its replies, and the helper sends them back into the game.
Can Portal 2 VScript make HTTP requests?
No. VScript in Portal 2 is Squirrel running inside the map, with no network access. The usual pattern is to log events to the console, read them from a helper app, and let that app call web APIs such as Neocortex.
Can I control a Portal 2 test chamber with my voice?
Yes. A helper app can listen to the microphone and send matched commands into the game, such as raising a platform or dropping a cube. Neocortex Voice Commands does the matching on the player's PC, so it works offline and responds instantly.
What is Portal 2: Community Edition?
Portal 2: Community Edition is a community-maintained version of Portal 2 on the Strata Source engine, in open beta on Steam since April 2026 and free for Portal 2 owners. It adds AngelScript, Panorama UI and an addon system, and the helper-app pattern for Neocortex works there too.
Can I publish an AI test chamber on the Steam Workshop?
You can publish the map on the Workshop as usual, but the helper app has to be shared separately, for example on GitHub. Each player runs it with their own Neocortex API key, which you can get on our free plan.
Written by
Sercan Altundas
Date
Oct 20, 2026
Read time
6 min






