A combinator you program with words, not wires.
The AI Combinator reads signals from red/green wires and outputs signals - just like any other combinator. The difference? You describe what you want in plain English instead of building complex arithmetic/decider logic.
Why Use It?
- Beginners: Skip the combinator learning curve. Describe what you want and learn from the generated code.
- Veterans: Automate tedious signal processing. Focus on system design, not implementation details.
- Everyone: Built-in test cases make your circuits reliable and debuggable.
Features
- Natural Language Input - Describe logic in plain English
- Test Case System - Define inputs/outputs, validate behavior, auto-fix failures
- Full Signal Support - Items, fluids, virtual signals, persistent variables
- Game Tick Access - Time-based operations and delays
๐ Getting Started
Requirements
- Factorio 2.0+
- API key from a supported AI provider (OpenAI, Anthropic, Google, xAI, or DeepSeek)
- AI Combinator Launcher (required - bridges Factorio to the AI service)
Installation
- Download the AI Combinator Launcher
- Run the installer and launch the app
- Configure your AI provider: Select provider and enter your API key
- Start Factorio through the launcher and activate the mod
First Combinator
- Research AI Combinator in the circuit network tech tree
- Craft and place one, connect it to your circuit network
- Click to open the interface
- Describe what you want: "Output signal A = 1 when at least 3 input signals are below 1000"
- Click Generate and wire the output to your system
How It Works
The AI Combinator is a standard combinator with one key difference: you describe its behavior in natural language.
Inputs:
- Red wire signals
- Green wire signals
- Current game tick
Outputs:
- Calculated signals to connected devices
- Optional console messages for player communication
Persistent State:
- Variables survive between game ticks
- Useful for counters, timers, and tracking
Limitations:
- Cannot directly control entities - only circuit signals
- Cannot read inventories
- All interaction happens through the circuit network
๐งช Test Cases: Making AI Reliable
AI-generated code can be unpredictable. The test case system solves this by letting you define expected behavior before generating code.
- Define test cases with specific input signals and expected outputs - or autogenerate baseline test cases using AI
- Run tests - instantly verify the code works correctly
- Auto-fix failures - if tests fail, click "Fix with AI" to regenerate
Why This Matters:
- Reproducible results - same test cases = same behavior
- Catch edge cases - define the tricky scenarios upfront
- Easy iteration - modify tests, regenerate, verify
- Documentation - test cases describe what the combinator does
๐ฎ Example Use Cases
Low Resource Alert
"Output signal-A = 1 when iron-plate < 1000 or copper-plate < 1000"
Wire to a speaker or warning lamp.
Production Counter
"Add all incoming iron-plate signals to a running total, output on signal-I"
Tracks cumulative production. Wire to a display or use for milestone detection.
Throughput Calculator
"Calculate items per minute (measured over 5 seconds) from the iron plate signal, output on signal-T"
Measures flow rate over time using persistent variables and game tick.
Priority Switcher
"Output the signal type with the highest value, set to 1"
Useful for selecting which resource needs attention most.
๐ก Prompt Tips
Be specific about signals:
- "Output signal-A = 1 when iron-plate < 1000"
- "Sum all input signals, output result on signal-T"
- "Pass through copper-plate signal only, ignore everything else"
Time-based operations:
- "Toggle signal-A every 60 ticks"
- "Output the average of signal-X over the last 60 ticks"
- "Only update output once per second (60 ticks)"
Complex logic:
- "Output the signal type with the lowest value"
- "Count how many different signal types have value > 0"
- "Multiply iron-plate by 2 and copper-plate by 3, sum the results"
โ๏ธ Technical Details
Performance: Heavier than vanilla combinators, but lighter than building equivalent logic manually. For UPS-sensitive builds, update less frequently ("check once per second").
AI Providers: OpenAI, Anthropic, Google, xAI, DeepSeek. All paid services - typical usage costs pennies per session.
Under the hood: The AI generates Lua code that reads from red/green tables, stores state in var, and writes to out. You can view and edit the code directly if needed.
๐ ๏ธ Troubleshooting
"No AI Bridge Connection"
- Launch Factorio through the launcher, not Steam directly
- Check the launcher is running (system tray)
- Verify your API key is valid
Combinator not responding
- AI generation takes a few seconds - wait for it
- Check for error messages in the combinator interface
- Try rephrasing your request more specifically
Need Help?
License
Based on Moon Logic 2, distributed under the MIT open-source license.