Skip to main content
`Ctrl`+`K`

# Weaviate Hybrid Search

This notebook shows how to use Weaviate hybrid search as a LangChain retriever.

    import weaviate
    import os

    WEAVIATE_URL = "..."
    client = weaviate.Client(
        url=WEAVIATE_URL,
    )

    from langchain.retrievers.weaviate_hybrid_search import WeaviateHybridSearchRetriever
    from langchain.schema import Document

    retriever = WeaviateHybridSearchRetriever(client, index_name="LangChain", text_key="text")

    docs = [Document(page_content="foo")]

    retriever.add_documents(docs)

    ['3f79d151-fb84-44cf-85e0-8682bfe145e0']

    retriever.get_relevant_documents("foo")

    [Document(page_content='foo', metadata={})]