Skip to main content
WolframAlpha is an answer engine developed by Wolfram Research. It answers factual queries by computing answers from externally sourced data.
This page covers how to use the Wolfram Alpha API within LangChain.

Installation and setup

  • Install requirements with
pip install wolframalpha

Wrappers

Utility

There exists a WolframAlphaAPIWrapper utility which wraps this API. To import this utility:
from langchain_community.utilities.wolfram_alpha import WolframAlphaAPIWrapper
For a more detailed walkthrough of this wrapper, see this notebook.

Tool

You can also easily load this wrapper as a Tool (to use with an Agent). You can do this with:
from langchain_community.agent_toolkits.load_tools import load_tools
tools = load_tools(["wolfram-alpha"])
For more information on tools, see Tools.