Create a chain that takes conversation history and returns documents.
If there is no chat_history, then the input is just passed directly to the
retriever. If there is chat_history, then the prompt and LLM will be used
to generate a search query. That search query is then passed to the retriever.