as the backbone of a retriever, but there are other types of retrievers as well.Retrievers implement the Runnable interface, the basic building block of the LangChain Expression Language (LCEL). This means they support invoke, ainvoke, stream, astream, batch, abatch, astream_log calls.Retrievers accept a string query as input and return a list of Document's as output.Get started‚ÄãIn this example we'll use a Chroma vector store-backed retriever. To get setup we'll need to run:pip install chromadbAnd download the state_of_the_union.txt file here.from langchain.embeddings import OpenAIEmbeddingsfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import Chromafull_text = open("state_of_the_union.txt", "r").read()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=100)texts = text_splitter.split_text(full_text)embeddings = OpenAIEmbeddings()db = Chroma.from_texts(texts, embeddings)retriever = db.as_retriever()retrieved_docs = retriever.invoke("What did the president say about Ketanji Brown Jackson?")print(retrieved_docs[0].page_content)    One of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court.         And I did that 4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation‚Äôs top legal minds, who will continue Justice Breyer‚Äôs legacy of excellence.         A former top litigator in private practice. A former federal public defender. And from a family of public school educators and police officers. A consensus builder. Since she‚Äôs been nominated, she‚Äôs received a broad range of support‚Äîfrom the Fraternal Order of Police to former judges appointed by Democrats and Republicans.         And if we are to advance liberty and justice, we need to secure the Border and fix the immigration system.         We can do both. At our border, we‚Äôve installed new technology like cutting-edge scanners
Head to Integrations for documentation on built-in retriever integrations with 3rd-party tools.
Head to Integrations for documentation on built-in retriever integrations with 3rd-party tools. ->: as the backbone of a retriever, but there are other types of retrievers as well.Retrievers implement the Runnable interface, the basic building block of the LangChain Expression Language (LCEL). This means they support invoke, ainvoke, stream, astream, batch, abatch, astream_log calls.Retrievers accept a string query as input and return a list of Document's as output.Get started‚ÄãIn this example we'll use a Chroma vector store-backed retriever. To get setup we'll need to run:pip install chromadbAnd download the state_of_the_union.txt file here.from langchain.embeddings import OpenAIEmbeddingsfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import Chromafull_text = open("state_of_the_union.txt", "r").read()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=100)texts = text_splitter.split_text(full_text)embeddings = OpenAIEmbeddings()db = Chroma.from_texts(texts, embeddings)retriever = db.as_retriever()retrieved_docs = retriever.invoke("What did the president say about Ketanji Brown Jackson?")print(retrieved_docs[0].page_content)    One of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court.         And I did that 4 days ago, when I nominated Circuit Court of Appeals Judge Ketanji Brown Jackson. One of our nation‚Äôs top legal minds, who will continue Justice Breyer‚Äôs legacy of excellence.         A former top litigator in private practice. A former federal public defender. And from a family of public school educators and police officers. A consensus builder. Since she‚Äôs been nominated, she‚Äôs received a broad range of support‚Äîfrom the Fraternal Order of Police to former judges appointed by Democrats and Republicans.         And if we are to advance liberty and justice, we need to secure the Border and fix the immigration system.         We can do both. At our border, we‚Äôve installed new technology like cutting-edge scanners