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

# Isaacus integrations

> Integrate with Isaacus using LangChain Python.

[Isaacus](https://isaacus.com/) is a foundational legal AI research company building AI models, apps, and tools for the legal tech ecosystem.

Isaacus' offering includes [Kanon 2 Embedder](https://isaacus.com/blog/introducing-kanon-2-embedder), the world's best legal embedding model (as measured on the [Massive Legal Embedding Benchmark](https://isaacus.com/blog/introducing-mleb)), as well as [legal zero-shot classification](https://docs.isaacus.com/models/introduction#universal-classification) and [legal extractive question answering models](https://docs.isaacus.com/models/introduction#answer-extraction).

Isaacus offers first-class support for LangChain's embedding interface, accessible via the [`langchain-isaacus`](https://pypi.org/project/langchain-isaacus/) integration package.

## Setup

To get started using Isaacus models with LangChain, head to the [Isaacus Platform](https://platform.isaacus.com/accounts/signup/) and create a new account.

Once signed up, [add a payment method](https://platform.isaacus.com/billing/) (thereby claiming your [free credits](https://docs.isaacus.com/pricing/credits)) and [generate an API key](https://platform.isaacus.com/users/api-keys/).

Next, install the [`langchain-isaacus`](https://pypi.org/project/langchain-isaacus/) integration package:

<CodeGroup>
  ```bash pip theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  pip install langchain-isaacus
  ```

  ```bash uv theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  uv add langchain-isaacus
  ```
</CodeGroup>

You should then set your `ISAACUS_API_KEY` environment variable to your Isaacus API key.

<CodeGroup>
  ```bash macOS/Linux theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  export ISAACUS_API_KEY="your_api_key_here"
  ```

  ```powershell Windows theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  $env:ISAACUS_API_KEY="your_api_key_here"
  ```
</CodeGroup>

## Embeddings

The code snippet below demonstrates how you might use Isaacus' Kanon 2 Embedder model to assess the semantic similarity of legal queries to a legal document with LangChain. A more detailed walkthrough of how to generate embeddings with the Isaacus LangChain integration is available in the [Isaacus embeddings guide](/oss/python/integrations/embeddings/isaacus).

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import numpy as np # NOTE you may need to `pip install numpy`.

from langchain_isaacus import IsaacusEmbeddings

# Create an Isaacus API client for Kanon 2 Embedder.
client = IsaacusEmbeddings(
    "kanon-2-embedder",
    # dimensions=1792, # You may optionally wish to specify a lower dimension.
)

# Embed a dummy document.
document_embedding = client.embed_documents(texts=["These are GitHub's billing policies."])[0]

# Embed our search queries.
relevant_query_embedding = client.embed_query(text="What are GitHub's billing policies?")
irrelevant_query_embedding = client.embed_query(text="What are Microsoft's billing policies?")

# Compute the similarity between the queries and the document.
relevant_similarity = np.dot(relevant_query_embedding, document_embedding)
irrelevant_similarity = np.dot(irrelevant_query_embedding, document_embedding)

# Log the results.
print(f"Similarity of relevant query to the document: {relevant_similarity * 100:.2f}")
print(f"Similarity of irrelevant query to the document: {irrelevant_similarity * 100:.2f}")
```

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/providers/isaacus.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
