Skip to content

Commit 72b540c

Browse files
Da-1335 update bedrock serverless pdf chat (#90)
* Update bedrock-serverless-pdf-chat.md * Update bedrock-serverless-pdf-chat.md * Update tutorial/markdown/python/bedrock-serverless-pdf-chat/bedrock-serverless-pdf-chat.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * addressed comments --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent ca9a692 commit 72b540c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tutorial/markdown/python/bedrock-serverless-pdf-chat/bedrock-serverless-pdf-chat.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description:
1212
content_type: tutorial
1313
filter: sdk
1414
technology:
15-
- fts
15+
- vector search
1616
- kv
1717
- eventing
1818
tags:
@@ -32,7 +32,7 @@ Welcome to this comprehensive guide on constructing an AI-enhanced Chat Applicat
3232

3333
This tutorial will demonstrate how to -
3434

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.
3636
- Use AWS Serverless Architecture with services like API Gateway, SQS, Lambdas, Bedrock.
3737
- 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.
3838
- 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:
8383
- 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.
8484
- 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)
8585

86-
### Create the Search Index on Full Text Service
86+
### Create the Vector Search Index on Search Service
8787

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.
8989

9090
- [Couchbase Capella](https://docs.couchbase.com/cloud/search/import-search-index.html)
9191

@@ -99,7 +99,7 @@ We need to create the Search Index on the Full Text Service in Couchbase. For th
9999
- Copy the following Index definition in the Import screen.
100100
- Click on Create Index to create the index.
101101

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).
103103

104104
#### Index Definition
105105

@@ -195,7 +195,7 @@ CB_PASSWORD=password_for_couchbase_cluster
195195
CB_BUCKET=name_of_bucket_to_store_documents
196196
CB_SCOPE=name_of_scope_to_store_documents
197197
CB_COLLECTION=name_of_collection_to_store_documents
198-
INDEX_NAME=name_of_fts_index_with_vector_support
198+
INDEX_NAME=name_of_search_vector_index
199199
```
200200

201201
> 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
268268

269269
### Running the Application
270270

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.
272272

273273
In the projects root directory, run the following command
274274

@@ -314,12 +314,12 @@ The PDF Chat app uses LangChain to convert the text from the PDF documents into
314314
When a user asks a question or provides a prompt:
315315

316316
- 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.
319319
- The nearest neighbor embeddings represent the most semantically similar passages or sections from the PDF documents compared to the user's query.
320320
- The app retrieves the text content associated with these nearest neighbor embeddings, providing the necessary context for generating a relevant response.
321321
- 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.
323323
- 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.
324324

325325
### LangChain

0 commit comments

Comments
 (0)