you strip out information that is not relevant for \the retrieval task. Here is the user query: {question}"""llm = ChatOpenAI(temperature=0)retriever_from_llm = RePhraseQueryRetriever.from_llm(    retriever=vectorstore.as_retriever(), llm=llm)docs = retriever_from_llm.get_relevant_documents(    "Hi I'm Lance. What are the approaches to Task Decomposition?")    INFO:langchain.retrievers.re_phraser:Re-phrased question: The user query can be converted into a query for a vectorstore as follows:        "approaches to Task Decomposition"docs = retriever_from_llm.get_relevant_documents(    "I live in San Francisco. What are the Types of Memory?")    INFO:langchain.retrievers.re_phraser:Re-phrased question: Query for vectorstore: "Types of Memory"Custom prompt‚Äãfrom langchain.chains import LLMChainfrom langchain.prompts import PromptTemplateQUERY_PROMPT = PromptTemplate(    input_variables=["question"],    template="""You are an assistant tasked with taking a natural languge query from a user    and converting it into a query for a vectorstore. In the process, strip out all     information that is not relevant for the retrieval task and return a new, simplified    question for vectorstore retrieval. The new user query should be in pirate speech.    Here is the user query: {question} """,)llm = ChatOpenAI(temperature=0)llm_chain = LLMChain(llm=llm, prompt=QUERY_PROMPT)retriever_from_llm_chain = RePhraseQueryRetriever(    retriever=vectorstore.as_retriever(), llm_chain=llm_chain)docs = retriever_from_llm_chain.get_relevant_documents(    "Hi I'm Lance. What is Maximum Inner Product Search?")    INFO:langchain.retrievers.re_phraser:Re-phrased question: Ahoy matey! What be Maximum Inner Product Search, ye scurvy dog?PreviousPubMedNextSEC filingExampleSetting upUsing the default promptCustom promptCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
RePhraseQuery is a simple retriever that applies an LLM between the user input and the query passed by the retriever.
RePhraseQuery is a simple retriever that applies an LLM between the user input and the query passed by the retriever. ->: you strip out information that is not relevant for \the retrieval task. Here is the user query: {question}"""llm = ChatOpenAI(temperature=0)retriever_from_llm = RePhraseQueryRetriever.from_llm(    retriever=vectorstore.as_retriever(), llm=llm)docs = retriever_from_llm.get_relevant_documents(    "Hi I'm Lance. What are the approaches to Task Decomposition?")    INFO:langchain.retrievers.re_phraser:Re-phrased question: The user query can be converted into a query for a vectorstore as follows:        "approaches to Task Decomposition"docs = retriever_from_llm.get_relevant_documents(    "I live in San Francisco. What are the Types of Memory?")    INFO:langchain.retrievers.re_phraser:Re-phrased question: Query for vectorstore: "Types of Memory"Custom prompt‚Äãfrom langchain.chains import LLMChainfrom langchain.prompts import PromptTemplateQUERY_PROMPT = PromptTemplate(    input_variables=["question"],    template="""You are an assistant tasked with taking a natural languge query from a user    and converting it into a query for a vectorstore. In the process, strip out all     information that is not relevant for the retrieval task and return a new, simplified    question for vectorstore retrieval. The new user query should be in pirate speech.    Here is the user query: {question} """,)llm = ChatOpenAI(temperature=0)llm_chain = LLMChain(llm=llm, prompt=QUERY_PROMPT)retriever_from_llm_chain = RePhraseQueryRetriever(    retriever=vectorstore.as_retriever(), llm_chain=llm_chain)docs = retriever_from_llm_chain.get_relevant_documents(    "Hi I'm Lance. What is Maximum Inner Product Search?")    INFO:langchain.retrievers.re_phraser:Re-phrased question: Ahoy matey! What be Maximum Inner Product Search, ye scurvy dog?PreviousPubMedNextSEC filingExampleSetting upUsing the default promptCustom promptCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.