Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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.

Each example provides two distinct approaches:
- **FTS (Full Text Search)**: Uses Couchbase's vector search capabilities with pre-created search indices
- **GSI (Global Secondary Index)**: Leverages Couchbase's native SQL++ queries with vector similarity functions

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.

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

### 2. Set up the Couchbase Vector Search Index:
### 2. Choose Your Approach:

#### For FTS (Full Text Search) Examples:
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.

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

### 3. Run the notebook file

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

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

## Couchbase Vector Search Index
## Couchbase Vector Search Index (FTS Approach Only)

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

```json
{
Expand Down Expand Up @@ -146,12 +153,4 @@ For more information on creating a vector search index, please follow the [instr
},
"sourceParams": {}
}
```

## Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
```
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"# Introduction\n",
"\n",
"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."
"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/)"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions awsbedrock/frontmatter.md → awsbedrock/fts/frontmatter.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
# frontmatter
path: "/tutorial-aws-bedrock-couchbase-rag"
title: Retrieval-Augmented Generation (RAG) with Couchbase and Amazon Bedrock
short_title: RAG with Couchbase and Amazon Bedrock
path: "/tutorial-aws-bedrock-couchbase-rag-with-fts"
title: Retrieval-Augmented Generation (RAG) with Couchbase and Amazon Bedrock using FTS service
short_title: RAG with Couchbase and Amazon Bedrock using FTS service
description:
- Learn how to build a semantic search engine using Couchbase and Amazon Bedrock.
- Learn how to build a semantic search engine using Couchbase and Amazon Bedrock using FTS service.
- This tutorial demonstrates how to integrate Couchbase's vector search capabilities with Amazon Bedrock's Titan embeddings and Claude language model.
- You'll understand how to perform Retrieval-Augmented Generation (RAG) using LangChain and Couchbase.
content_type: tutorial
Expand Down
14 changes: 14 additions & 0 deletions awsbedrock/gsi/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# AWS Credentials
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=

# Couchbase Settings
CB_HOST=
CB_USERNAME=
CB_PASSWORD=
CB_BUCKET_NAME=

SCOPE_NAME=
COLLECTION_NAME=
CACHE_COLLECTION=
Loading