Skip to content

Commit 076d277

Browse files
authored
Merge pull request #58 from couchbaselabs/main
Add GSI vector search examples
2 parents ad7b557 + 96fac41 commit 076d277

File tree

68 files changed

+24301
-4268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+24301
-4268
lines changed

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This repository demonstrates how to build a powerful semantic search engine using Couchbase as the backend database, combined with various AI-powered embedding and language model providers such as OpenAI, Azure OpenAI, Anthropic (Claude), Cohere, Hugging Face, Jina AI, Mistral AI, and Voyage AI.
44

5+
Each example provides two distinct approaches:
6+
- **FTS (Full Text Search)**: Uses Couchbase's vector search capabilities with pre-created search indices
7+
- **GSI (Global Secondary Index)**: Leverages Couchbase's native SQL++ queries with vector similarity functions
8+
59
Semantic search goes beyond simple keyword matching by understanding the context and meaning behind the words in a query, making it essential for applications that require intelligent information retrieval.
610

711
## Features
@@ -27,10 +31,13 @@ Semantic search goes beyond simple keyword matching by understanding the context
2731
cd vector-search-cookbook
2832
```
2933

30-
### 2. Set up the Couchbase Vector Search Index:
34+
### 2. Choose Your Approach:
35+
36+
#### For FTS (Full Text Search) Examples:
37+
Use the provided `{model}_index.json` index definition file in each model's `fts/` directory to create a new vector search index in your Couchbase cluster.
3138

32-
Use the provided `{model}_index.json` index definition file in each model's directory to create a new index in your Couchbase cluster.
33-
The index supports separate properties for each embedding model.
39+
#### For GSI (Global Secondary Index) Examples:
40+
No additional setup required. GSI index will be created in each model's example.
3441

3542
### 3. Run the notebook file
3643

@@ -68,9 +75,9 @@ Each notebook implements a semantic search function that performs similarity sea
6875

6976
The system implements caching functionality using `CouchbaseCache` to improve performance for repeated queries.
7077

71-
## Couchbase Vector Search Index
78+
## Couchbase Vector Search Index (FTS Approach Only)
7279

73-
For more information on creating a vector search index, please follow the [instructions](https://docs.couchbase.com/cloud/vector-search/create-vector-search-index-ui.html). The following is an example for Azure OpenAI Model.
80+
For FTS examples, you'll need to create a vector search index using the provided JSON configuration files. For more information on creating a vector search index, please follow the [instructions](https://docs.couchbase.com/cloud/vector-search/create-vector-search-index-ui.html). The following is an example for Azure OpenAI Model.
7481

7582
```json
7683
{
@@ -146,12 +153,4 @@ For more information on creating a vector search index, please follow the [instr
146153
},
147154
"sourceParams": {}
148155
}
149-
```
150-
151-
## Contributing
152-
153-
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.
154-
155-
## License
156-
157-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
156+
```
File renamed without changes.

awsbedrock/RAG_with_Couchbase_and_Bedrock.ipynb renamed to awsbedrock/fts/RAG_with_Couchbase_and_Bedrock.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Introduction\n",
88
"\n",
9-
"In this guide, we will walk you through building a powerful semantic search engine using Couchbase as the backend database and [Amazon Bedrock](https://aws.amazon.com/bedrock/) as both the embedding and language model provider. Semantic search goes beyond simple keyword matching by understanding the context and meaning behind the words in a query, making it an essential tool for applications that require intelligent information retrieval. This tutorial is designed to be beginner-friendly, with clear, step-by-step instructions that will equip you with the knowledge to create a fully functional semantic search system from scratch."
9+
"In this guide, we will walk you through building a powerful semantic search engine using Couchbase as the backend database and [Amazon Bedrock](https://aws.amazon.com/bedrock/) as both the embedding and language model provider. Semantic search goes beyond simple keyword matching by understanding the context and meaning behind the words in a query, making it an essential tool for applications that require intelligent information retrieval. This tutorial is designed to be beginner-friendly, with clear, step-by-step instructions that will equip you with the knowledge to create a fully functional semantic search system using the FTS service from scratch. Alternatively if you want to perform semantic search using the GSI index, please take a look at [this.](https://developer.couchbase.com/tutorial-aws-bedrock-couchbase-rag-with-global-secondary-index/)"
1010
]
1111
},
1212
{

awsbedrock/frontmatter.md renamed to awsbedrock/fts/frontmatter.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
# frontmatter
3-
path: "/tutorial-aws-bedrock-couchbase-rag"
4-
title: Retrieval-Augmented Generation (RAG) with Couchbase and Amazon Bedrock
5-
short_title: RAG with Couchbase and Amazon Bedrock
3+
path: "/tutorial-aws-bedrock-couchbase-rag-with-fts"
4+
title: Retrieval-Augmented Generation (RAG) with Couchbase and Amazon Bedrock using FTS service
5+
short_title: RAG with Couchbase and Amazon Bedrock using FTS service
66
description:
7-
- Learn how to build a semantic search engine using Couchbase and Amazon Bedrock.
7+
- Learn how to build a semantic search engine using Couchbase and Amazon Bedrock using FTS service.
88
- This tutorial demonstrates how to integrate Couchbase's vector search capabilities with Amazon Bedrock's Titan embeddings and Claude language model.
99
- You'll understand how to perform Retrieval-Augmented Generation (RAG) using LangChain and Couchbase.
1010
content_type: tutorial

awsbedrock/gsi/.env.sample

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# AWS Credentials
2+
AWS_ACCESS_KEY_ID=
3+
AWS_SECRET_ACCESS_KEY=
4+
AWS_REGION=
5+
6+
# Couchbase Settings
7+
CB_HOST=
8+
CB_USERNAME=
9+
CB_PASSWORD=
10+
CB_BUCKET_NAME=
11+
12+
SCOPE_NAME=
13+
COLLECTION_NAME=
14+
CACHE_COLLECTION=

0 commit comments

Comments
 (0)