> ## Documentation Index
> Fetch the complete documentation index at: https://langchain.idochub.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# SWI-Prolog

SWI-Prolog offers a comprehensive free Prolog environment.

## Installation and Setup

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

<CodeGroup>
  ```bash pip theme={null}
  pip install langchain-prolog
  ```

  ```bash uv theme={null}
  uv add langchain-prolog
  ```
</CodeGroup>

## Tools

The `PrologTool` class allows the generation of langchain tools that use Prolog rules to generate answers.

```python theme={null}
from langchain_prolog import PrologConfig, PrologTool
```

See a [usage example](/oss/python/integrations/tools/prolog_tool).

See the same guide for usage examples of `PrologRunnable`, which allows the generation
of LangChain runnables that use Prolog rules to generate answers.
