First AI Mutation
DUUMBI’s AI mutation system lets you describe changes in natural language. The AI generates structured graph patches — no text parsing, no syntax errors.
Prerequisites
Section titled “Prerequisites”- A DUUMBI project (see quickstart)
- An LLM provider configured (see installation)
Adding a function
Section titled “Adding a function”From your project directory:
duumbi add "create a multiply function that takes two i64 parameters and returns their product"The AI will:
- Analyze the current graph
- Generate a
GraphPatchwith anadd_functionoperation - Validate the patched graph (schema + type check)
- Show you a diff summary for confirmation
Changes: + Function: multiply(a: i64, b: i64) -> i64 + Block: entry + Const: Load(a) + Const: Load(b) + Mul + Return
Apply changes? [y/N]Type y to apply. The change is saved to main.jsonld and a snapshot is created in .duumbi/history/.
Modifying existing code
Section titled “Modifying existing code”duumbi add "modify the main function to call multiply(6, 7) and print the result"The AI generates modify_op and add_op patches to update the existing main function.
Made a mistake? Undo the last change:
duumbi undoThis restores from the latest snapshot in .duumbi/history/. Undo is a LIFO stack — you can undo multiple times.
Multi-provider support
Section titled “Multi-provider support”DUUMBI supports multiple LLM providers with automatic fallback:
[[providers]]name = "anthropic"api_key_env = "ANTHROPIC_API_KEY"model = "claude-sonnet-4-20250514"
[[providers]]name = "openai"api_key_env = "OPENAI_API_KEY"model = "gpt-4o"If the primary provider fails (rate limit, network error), DUUMBI automatically tries the next provider in the chain.
How it works internally
Section titled “How it works internally”- The current graph (
main.jsonld) is sent to the LLM as context - The LLM responds with tool calls defining graph patches (6 patch types)
- Patches are applied atomically (all-or-nothing)
- The result is validated against the schema
- On failure: automatic retry with error feedback (up to 3 attempts)
The 6 patch operations:
| Operation | Description |
|---|---|
add_function | Append a complete function to the graph |
add_block | Add a block to an existing function |
add_op | Append an operation to a block |
modify_op | Change a field on any node |
remove_node | Remove a node (op, block, or function) |
set_edge | Set an @id reference between nodes |
Next steps
Section titled “Next steps”- Build a multi-module project with separate modules
- Use the intent system for complex, multi-step programs