You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/user_guide/large_language_model/retrieval.rst
+14-13Lines changed: 14 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
.. _vector_store:
2
2
3
3
#################################################
4
-
integration with OCI Generative AI and OpenSearch
4
+
Integration with OCI Generative AI and OpenSearch
5
5
#################################################
6
6
7
7
.. versionadded:: 2.9.1
@@ -91,12 +91,15 @@ Since the search result usually cannot be directly used to answer a specific que
91
91
)
92
92
qa.run("your question")
93
93
94
+
Retrieval QA with FAISS
95
+
=======================
96
+
94
97
FAISS as Vector DB
95
-
==================
98
+
------------------
96
99
97
100
A lot of the time, your documents are not that large and you dont have a OCI OpenSearch cluster set up. In that case, you can use ``FAISS`` as your in-memory vector store, which can also do similarty search very efficiently.
98
101
99
-
The following code snippet shows how to use ``FAISS`` as your vector store:
102
+
The following code snippet shows how to use ``FAISS`` along with OCI Embedding Model to do semantic search:
100
103
101
104
.. code-block:: python3
102
105
@@ -120,7 +123,7 @@ The following code snippet shows how to use ``FAISS`` as your vector store:
120
123
db = FAISS.from_embeddings(text_embedding_pairs, oci_embedings)
121
124
db.similarity_search("your query", k=2, size=2)
122
125
123
-
Retrieval QA Using FAISS Vector Store as a retriever
126
+
Retrieval QA Using FAISS Vector Store as a Retriever
Similarly, you can use FAISS Vector Store as a retriever to build a retrieval QA engine using langchain. The following code snippet shows how to use OCI OpenSearch as a retriever:
@@ -158,7 +161,7 @@ As of version 0.0.346, Langchain does not support serialization of any vector st
158
161
OpenSearchVectorSearch Serialization
159
162
------------------------------------
160
163
161
-
langchain does not automatically support serialization of ``OpenSearchVectorSearch``. However, ADS provides a way to serialize ``OpenSearchVectorSearch``. To serialize ``OpenSearchVectorSearch``, you need to use environment variables to pass in the credentials. The following variables can be passed in through the corresponding environment variables:
164
+
langchain does not automatically support serialization of ``OpenSearchVectorSearch``. However, ADS provides a way to serialize ``OpenSearchVectorSearch``. To serialize ``OpenSearchVectorSearch``, you need to use environment variables to store the credentials. The following variables can be passed in through the corresponding environment variables:
0 commit comments