O3 mini - add Reasoning Effort Paramters AI AGENTS

The idea is:

Add openAI o3 mini reasoning effort parameters.

My use case:

using openAI o3 mini for AI Agents

I think it would be beneficial to add this because:

o3 mini capabilities largly vary with reasoning effort. low/medium/high

Also beneficial of o1 and upcoming o3 full.

Any resources to support this?

{
  "model": "o3-mini",
  "messages": [],
  "response_format": {
    "type": "text"
  },
  "reasoning_effort": "high"
}

Are you willing to work on this?

How can I help :slight_smile:

You can do this now, here is how.

  1. Define the Desired Behavior:
    Decide exactly what “reasoning effort” means in your context. For instance, do you want to:

Adjust the verbosity or multi-step reasoning of a language model?

Change the prompt structure to encourage a deeper chain-of-thought?

Set internal parameters (like temperature or maximum tokens) dynamically based on the desired reasoning level?

  1. Extend Your AI Agent Node:
    If you’re using a custom or existing n8n node for an AI agent (e.g., one that calls OpenAI’s API), you could modify or wrap it so that it accepts an extra parameter (say, reasoningEffort). Your node’s code would then adjust the prompt or API parameters accordingly. For example, you might modify the prompt like:

const basePrompt = “Answer the following question:”;
const reasoningInstruction = reasoningEffort > 5
? " Please provide a detailed, step-by-step explanation."
: “”;

const finalPrompt = ${basePrompt}${reasoningInstruction}\n${userQuestion};

  1. Generate the n8n Workflow JSON Dynamically:
    If your app takes a natural language prompt and converts it into an n8n workflow, you’d need to add logic that recognizes when the prompt includes a request for a certain “reasoning effort” and then includes that parameter in the JSON. For example, the JSON for an AI Agent node might look like:

{
“nodes”: [
{
“parameters”: {
“prompt”: “Answer the following question with detailed reasoning: {{ $json.question }}”,
“reasoningEffort”: 7 // Custom parameter you’re introducing
},
“name”: “AI Agent”,
“type”: “n8n-nodes-base.yourCustomAiAgent”,
“position”: [500, 300]
}
],
“connections”: {
“AI Agent”: {
“main”: [
[
{
“node”: “Next Node”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}

In this snippet, the node includes a reasoningEffort parameter that you can later use in your custom node logic to modify the request to the AI.

  1. Integrate and Validate:
    Once your JSON generation logic is set up, integrate it with your n8n instance (either via the API or by importing the JSON). Make sure to validate that the custom parameter is being correctly passed to your node and that the AI behaves as expected.

Thanks Brian but I think we talk about different things.

“Reasoning effort” is an openAI parameter in the API request that defines how many tokens are used in the reasoning process.

This is not a concept I came up with - but new in the documentation.

Default is “medium”, but o3-mini also allows for “low” and “high”.
This is a balance between price (number of generated tokens) and speed. (Low being much faster than high)

See details here:

[https://platform.openai.com/docs/guides/reasoning?example=planning#advice-on-prompting]

I have a very much related question. When will the open AI nodes be updated to include o1 and the new o3-mini? Including as per Gregor’s comment, there are three “levels of effort” characterised in the new o3-mini series. Low, Medium and High. It would be great if an Open AI node upgrade would include all three effort levels for the new o3-mini model

2 Likes

I need this urgently as well. please update the node to include the newest models and allow to specify reasoning effort.

4 Likes