Skip to main content
The hkunlp/instructor-* family introduced instruction-tuned sentence embeddings. They have been broadly superseded by modern instruction-aware models, but the original models are still available on Hugging Face and usable via the legacy HuggingFaceInstructEmbeddings class.
For new projects, prefer HuggingFaceEmbeddings from langchain-huggingface with a current instruction-aware model such as intfloat/e5-large-v2, Qwen/Qwen3-Embedding-0.6B, or BAAI/bge-m3. Pass query and document prompts via encode_kwargs and query_encode_kwargs:

Legacy Instructor usage

The langchain-community package is no longer maintained. Examples that import from langchain_community may be outdated or broken. Use with caution.