> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-opensw-1774858546-a100bff.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Instruct embeddings on Hugging Face integration

> Integrate with the Instruct embeddings on Hugging Face embedding model using LangChain Python.

> [Hugging Face sentence-transformers](https://huggingface.co/sentence-transformers) is a Python framework for state-of-the-art sentence, text and image embeddings.
> One of the instruct embedding models is used in the `HuggingFaceInstructEmbeddings` class.

```python theme={null}
from langchain_community.embeddings import HuggingFaceInstructEmbeddings
```

```python theme={null}
embeddings = HuggingFaceInstructEmbeddings(
    query_instruction="Represent the query for retrieval: "
)
```

```text theme={null}
load INSTRUCTOR_Transformer
max_seq_length  512
```

```python theme={null}
text = "This is a test document."
```

```python theme={null}
query_result = embeddings.embed_query(text)
```

```python theme={null}
```

***

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

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