Haystack v1.12.1 adds PromptNode for LLM integration, BM25 support in InMemoryDocumentStore, and parallel dense batch search for Elasticsearch/OpenSearch.
$ git clone --branch v1.12.1 https://github.com/deepset-ai/haystack.git # already have the repo? check out this version: $ git checkout v1.12.1
from haystack.nodes import EmbeddingRetriever
# OpenAI
retriever = EmbeddingRetriever(
embedding_model="text-embedding-ada-002",
batch_size=32,
api_key=api_key,
max_seq_len=8191
)
# Cohere multilingual
retriever = EmbeddingRetriever(
embedding_model="multilingual-22-12",
batch_size=16,
api_key=api_key
) - ›Introduces
PromptNode(inhaystack.nodes.prompt) withPromptModelandPromptTemplate, enabling LLM-powered NLP tasks via prompt templates; supports Google Flan-T5 and OpenAI GPT-3 models (e.g.google/flan-t5-base,text-davinci-003) standalone or chained in pipelines. - ›Adds
all_terms_must_matchparameter to BM25Retriever, configurable at runtime. - ›Adds
query_by_embedding_batchtoElasticsearchDocumentStoreandOpenSearchDocumentStore, enabling parallel dense searches viamsearch— up to 49% faster forrun_batch,eval_batch, andMostSimilarDocumentsPipeline. - ›Extends
EmbeddingRetrieverto support Cohere multilingual embedding models (e.g.multilingual-22-12) and OpenAI embedding models (e.g.text-embedding-ada-002withmax_seq_len=8191). - ›Adds BM25Retriever support to
InMemoryDocumentStore, making it the first dependency-free document store to support all Haystack retrievers.
+2 moreshow less
- ›Adds
offsets_in_contextfield to evaluation results. - ›Enables
SQLDocumentStoreto store metadata using JSON.
- !Docker images
deepset/haystack-cpu,deepset/haystack-gpu, and their tags are discontinued; Dockerfiles/Dockerfile,/Dockerfile-GPU, and/Dockerfile-GPU-minimalwill be removed from the codebase after this release.