Skip to content

WolframAlphaAPI

WolframAlphaAPI sends a question to Wolfram Alpha and returns its answer. Wolfram Alpha is a service that specialises in calculations: maths, unit conversions, scientific data and questions with an exact answer.

You can use it as a step in a flow, typing the question in Input, or as a tool for an agent: connect its Tool output to the agent’s Tools input and the agent uses it when it has to answer maths questions.

When to use it

  • A technical assistant has to do precise calculations that an AI model could get wrong.
  • You need to convert units or currencies inside an answer.
  • A virtual tutor solves maths or physics exercises.
  • You want to check a formula’s result before putting it in a report.

Configuration

You need a Wolfram Alpha API credential with your Wolfram Alpha application ID. See Credentials.

FieldWhat it does
InputThe question or calculation, for example integral of x^2 from 0 to 3 or 150 miles in kilometres. When the component is used as a tool, the agent writes the question.
App ID (required)Your Wolfram Alpha application ID.

Output

  • Data: one item with the answer text. It includes how Wolfram Alpha understood the question and the answer. If no answer is found, the text says so.
  • Tool: the Wolfram Alpha query ready for an agent. Connect it to the agent’s Tools input.

Example

An engineering firm wants its internal assistant to answer quick calculation questions.

  1. Add WolframAlphaAPI and choose the company’s Wolfram Alpha API credential.
  2. Connect the Tool output to the agent’s Tools input.
  3. In the agent’s instructions, say it must use this tool for any numerical calculation.
  4. When someone asks how many litres fit in a 2 by 3 by 1.5 metre tank, the agent asks Wolfram Alpha and replies with the exact result.
  • Calculator: simple arithmetic without a credential.
  • Agent: the agent you can give this tool to.