Skip to main content
SWI-Prolog offers a comprehensive free Prolog environment.

Installation and Setup

Once SWI-Prolog has been installed, install lanchain-prolog using pip:
pip install langchain-prolog

Tools

The PrologTool class allows the generation of langchain tools that use Prolog rules to generate answers.
from langchain_prolog import PrologConfig, PrologTool
See a usage example. See the same guide for usage examples of PrologRunnable, which allows the generation of LangChain runnables that use Prolog rules to generate answers.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I