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: tutorial/markdown/python/bedrock-serverless-pdf-chat/bedrock-serverless-pdf-chat.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ description:
12
12
content_type: tutorial
13
13
filter: sdk
14
14
technology:
15
-
- fts
15
+
- vector search
16
16
- kv
17
17
- eventing
18
18
tags:
@@ -32,7 +32,7 @@ Welcome to this comprehensive guide on constructing an AI-enhanced Chat Applicat
32
32
33
33
This tutorial will demonstrate how to -
34
34
35
-
- Construct a [Couchbase Search Index](https://www.couchbase.com/products/vector-search/) for doing Vector Search.
35
+
- Construct a [Couchbase Vector Search Index](https://www.couchbase.com/products/vector-search/) for doing Vector Search.
36
36
- Use AWS Serverless Architecture with services like API Gateway, SQS, Lambdas, Bedrock.
37
37
- Chunk PDFs into Vectors with [LangChain](https://langchain.com/) and use [Couchbase Vector Store](https://python.langchain.com/docs/integrations/vectorstores/couchbase/) to store the vectors into Couchbase.
38
38
- Query large language models via the [RAG framework](https://aws.amazon.com/what-is/retrieval-augmented-generation/) for contextual insights. We will use [AWS Bedrock](https://aws.amazon.com/bedrock/) for generating Embeddings and LLM.
@@ -83,9 +83,9 @@ Specifically, you need to do the following:
83
83
- For the purpose of this tutorial, we will be using specific bucket, scope and collection. However, you may use any name of your choice but make sure to update names in all the steps.
84
84
- Create a bucket named `pdf-chat`. We will use the `shared` scope and `docs` collection of this bucket which needs to be created. [Read more](https://docs.couchbase.com/cloud/clusters/data-service/about-buckets-scopes-collections.html)
85
85
86
-
### Create the Search Index on Full Text Service
86
+
### Create the Vector Search Index on Search Service
87
87
88
-
We need to create the Search Index on the Full Text Service in Couchbase. For this demo, you can import the following index using the instructions.
88
+
We need to create the Vector Search Index on the Search Service in Couchbase. For this demo, you can import the following index using the instructions.
@@ -99,7 +99,7 @@ We need to create the Search Index on the Full Text Service in Couchbase. For th
99
99
- Copy the following Index definition in the Import screen.
100
100
- Click on Create Index to create the index.
101
101
102
-
You may also create a vector index using Search UI on both [Couchbase Capella](https://docs.couchbase.com/cloud/vector-search/create-vector-search-index-ui.html) and [Couchbase Self Managed Server](https://docs.couchbase.com/server/current/vector-search/create-vector-search-index-ui.html).
102
+
You may also create a vector search index using Search UI on both [Couchbase Capella](https://docs.couchbase.com/cloud/vector-search/create-vector-search-index-ui.html) and [Couchbase Self Managed Server](https://docs.couchbase.com/server/current/vector-search/create-vector-search-index-ui.html).
> The [connection string](https://docs.couchbase.com/python-sdk/current/howtos/managing-connections.html#connection-strings) expects the `couchbases://` or `couchbase://` part. In the end, the connection string must look something like this: `couchbases://capella.connection.string.com`.
@@ -268,7 +268,7 @@ After saving, Deploy the created function. Now our setup process is completed wi
268
268
269
269
### Running the Application
270
270
271
-
After starting Couchbase server, adding vector index and installing dependencies. Our Application is ready to run.
271
+
After starting Couchbase server, adding vector search index and installing dependencies. Our Application is ready to run.
272
272
273
273
In the projects root directory, run the following command
274
274
@@ -314,12 +314,12 @@ The PDF Chat app uses LangChain to convert the text from the PDF documents into
314
314
When a user asks a question or provides a prompt:
315
315
316
316
- The app converts the user's query into an embedding using LangChain's embedding models (e.g., OpenAI's embeddings).
317
-
-[Couchbase's Vector Search](https://docs.couchbase.com/python-sdk/current/howtos/full-text-searching-with-sdk.html#vector-search) capability is utilized, which supports search indexes. A dedicated search index is created for the PDF embeddings and their corresponding text content, configured with the necessary indexing parameters (bucket, scope, collection, index name).
318
-
- The app queries this search index using the user's query embedding. Couchbase's Vector Search calculates the [similarity](https://www.couchbase.com/blog/vector-similarity-search/) (e.g., dot product) between the query embedding and the indexed PDF embeddings, enabling fast retrieval of the nearest neighbor embeddings.
317
+
-[Couchbase's Vector Search](https://docs.couchbase.com/python-sdk/current/howtos/full-text-searching-with-sdk.html#vector-search) capability is utilized, which supports vector search indexes. A dedicated vector search index is created for the PDF embeddings and their corresponding text content, configured with the necessary indexing parameters (bucket, scope, collection, index name).
318
+
- The app queries this vector search index using the user's query embedding. Couchbase's Vector Search calculates the [similarity](https://www.couchbase.com/blog/vector-similarity-search/) (e.g., dot product) between the query embedding and the indexed PDF embeddings, enabling fast retrieval of the nearest neighbor embeddings.
319
319
- The nearest neighbor embeddings represent the most semantically similar passages or sections from the PDF documents compared to the user's query.
320
320
- The app retrieves the text content associated with these nearest neighbor embeddings, providing the necessary context for generating a relevant response.
321
321
- Couchbase's Vector Search supports advanced indexing techniques, such as [scoped indexes](https://docs.couchbase.com/python-sdk/current/howtos/full-text-searching-with-sdk.html#scoped-vs-global-indexes), [dynamic indexing](https://docs.couchbase.com/server/current/fts/fts-creating-index-from-REST-dynamic.html) and [hybrid search](https://docs.couchbase.com/python-sdk/current/howtos/full-text-searching-with-sdk.html#combining-fts-and-vector-queries), allowing for efficient management, better scaling of the vector store and multiple types of search supported.
322
-
- The search index facilitates fast and accurate retrieval, enabling the app to provide context-aware and relevant responses to the user's queries, even when the phrasing or terminology differs from the PDF content.
322
+
- The vector search index facilitates fast and accurate retrieval, enabling the app to provide context-aware and relevant responses to the user's queries, even when the phrasing or terminology differs from the PDF content.
323
323
- Couchbase's Vector Search integrates seamlessly with LangChain's [CouchbaseSearchVectorStore](https://python.langchain.com/docs/integrations/vectorstores/couchbase/) class, abstracting away the complexities of vector similarity calculations.
0 commit comments