Add Vector Index Guide documentation - #104
Conversation
Summary of ChangesHello @teetangh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a comprehensive guide to Couchbase's vector indexing features, designed to help users understand and effectively utilize the different vector index types available. The new documentation clarifies the underlying services (Full Text Search and Global Secondary Index), details the unique characteristics of each vector index, and provides practical guidance through comparison tables and decision flowcharts. This addition aims to streamline the process of selecting and implementing vector search solutions within Couchbase for various AI-driven applications. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds a comprehensive and well-structured guide to Couchbase's vector indexes. The document is detailed, with helpful diagrams and examples that clarify the differences between the various index types. My review focuses on a couple of areas where technical accuracy and clarity could be improved to avoid user confusion. Specifically, I've pointed out an inconsistency in the description of the Search Vector Index filtering mechanism and a statement about folder naming conventions that doesn't align with the current repository structure. Addressing these points will make this excellent guide even more valuable.
| ```mermaid | ||
| flowchart LR | ||
| A[Query] --> B{Has Text/Geo?} | ||
| B -->|Yes| C[FTS Filter] | ||
| B -->|No| D[Vector Search] | ||
| C --> D | ||
| D --> E[Similarity Score] | ||
| E --> F[Ranked Results] | ||
| ``` |
There was a problem hiding this comment.
There's an inconsistency in how hybrid search is described for the Search Vector Index. This diagram suggests that the FTS filter is a pre-filter for the vector search. However, the comparison table on line 453 describes it as a 'Post-filter'. In reality, the underlying mechanism is more of a parallel execution where results are combined and then ranked.
To more accurately represent the hybrid search process, I'd suggest updating the diagram to show parallel execution paths for the FTS filter and the vector search, which then merge for ranking.
Here's a suggestion for the updated diagram:
flowchart LR
A[Query] --> B(FTS Filter)
A --> C(Vector Search)
B --> D{Combine & Rank}
C --> D
D --> E[Ranked Results]
| ```mermaid | |
| flowchart LR | |
| A[Query] --> B{Has Text/Geo?} | |
| B -->|Yes| C[FTS Filter] | |
| B -->|No| D[Vector Search] | |
| C --> D | |
| D --> E[Similarity Score] | |
| E --> F[Ranked Results] | |
| ``` | |
| flowchart LR | |
| A[Query] --> B(FTS Filter) | |
| A --> C(Vector Search) | |
| B --> D{Combine & Rank} | |
| C --> D | |
| D --> E[Ranked Results] |
| This cookbook uses folder naming conventions that map to vector index types: | ||
|
|
||
| | Folder Name | Index Type | LangChain/Framework Class | | ||
| |-------------|-----------|---------------------------| | ||
| | `search_based/` | Search Vector Index | `CouchbaseSearchVectorStore` | | ||
| | `query_based/` | Hyperscale or Composite Vector Index | `CouchbaseQueryVectorStore` | | ||
|
|
||
| ### Historical Context | ||
|
|
||
| The cookbook previously used different terminology: | ||
| - `fts/` (Full Text Search) → now `search_based/` | ||
| - `gsi/` (Global Secondary Index) → now `query_based/` | ||
|
|
||
| The new naming focuses on the *approach* (search-based vs query-based) rather than the underlying service, making it clearer for developers new to Couchbase. |
There was a problem hiding this comment.
This section states that the cookbook 'uses' the search_based/ and query_based/ folder naming conventions. However, based on the current repository structure, the folders are still named fts/ and gsi/. This could be confusing for users who are trying to navigate the cookbook based on this guide.
To avoid this confusion, I suggest rephrasing this section to clarify that this is a planned or ongoing transition. A table mapping old names to new names would be very helpful.
| This cookbook uses folder naming conventions that map to vector index types: | |
| | Folder Name | Index Type | LangChain/Framework Class | | |
| |-------------|-----------|---------------------------| | |
| | `search_based/` | Search Vector Index | `CouchbaseSearchVectorStore` | | |
| | `query_based/` | Hyperscale or Composite Vector Index | `CouchbaseQueryVectorStore` | | |
| ### Historical Context | |
| The cookbook previously used different terminology: | |
| - `fts/` (Full Text Search) → now `search_based/` | |
| - `gsi/` (Global Secondary Index) → now `query_based/` | |
| The new naming focuses on the *approach* (search-based vs query-based) rather than the underlying service, making it clearer for developers new to Couchbase. | |
| This cookbook is transitioning to new folder naming conventions to better reflect the underlying search approach. The mapping from the old to the new structure is as follows: | |
| | New Folder Name | Old Folder Name | Index Type | LangChain/Framework Class | | |
| |-----------------|-----------------|----------------------------------------|---------------------------------| | |
| | `search_based/` | `fts/` | Search Vector Index | `CouchbaseSearchVectorStore` | | |
| | `query_based/` | `gsi/` | Hyperscale or Composite Vector Index | `CouchbaseQueryVectorStore` | | |
| This change focuses on the *approach* (search-based vs. query-based) rather than the underlying service, making it clearer for developers new to Couchbase. |
Adds
VECTOR_INDEX_GUIDE.mdto the repository root.Covers:
search_based/vsquery_based/folders)