Added new spring-ai couchbase vector store tutorial#53
Conversation
There was a problem hiding this comment.
Hello @abhiraj2, 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!
Summary of Changes
This pull request adds a new tutorial on how to use Couchbase as a vector store with Spring AI. The tutorial provides a step-by-step guide on configuring and using Couchbase for vector search, including setting up the necessary components, loading data, and performing similarity searches. It also includes example source code and configuration details.
Highlights
- New Tutorial: Adds a new tutorial on using Couchbase as a Spring AI embedding storage.
- Example Code: Provides example source code for the tutorial, demonstrating how to integrate Couchbase with Spring AI.
- Configuration Details: Includes detailed configuration instructions and code snippets for setting up the Couchbase vector store.
- REST API Endpoints: Explains the REST API endpoints for loading data and performing similarity searches.
Changelog
- tutorial/markdown/java/spring-ai.md
- Added a new markdown file containing the tutorial content.
- Included sections on Spring AI introduction, Couchbase embedding store setup, project structure, and configuration.
- Provided code examples for configuring the Couchbase cluster, OpenAI embedding model, and Couchbase vector store.
- Explained the vector store integration and the use of FTS vector index.
- Documented the REST API endpoints for loading data and performing similarity searches.
- Added instructions on how to use the application, including loading data and performing searches.
- Included links to relevant resources such as Spring AI documentation, Couchbase Vector Search documentation, and OpenAI Embeddings documentation.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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.
In realms of AI, a quest we find,
With vectors stored, of a searching kind.
Couchbase and Spring,
A knowledge they bring,
To make AI insights aligned.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request adds a new tutorial on using Couchbase Vector Search with Spring AI. The tutorial provides a good overview of how to configure and use Couchbase as a Spring AI embedding storage. The example code is helpful and the instructions are clear. However, there are a few areas that could be improved for clarity and completeness.
Summary of Findings
- Completeness of Configuration Details: The tutorial mentions configuring the application in
application.propertiesbut doesn't explicitly state that the user needs to create this file if it doesn't exist. This could be confusing for new users. - Vector Index Configuration: The tutorial mentions that the store will attempt to create a new index with default configuration. It should emphasize the importance of reviewing and adjusting the index settings for specific use cases and provide more guidance on how to do this.
- Incomplete Code Snippets: The tutorial includes incomplete code snippets (e.g., in the Load functionality section). These snippets should be complete or clearly indicate what is being omitted.
Merge Readiness
The tutorial provides valuable information on using Couchbase Vector Search with Spring AI. However, addressing the identified issues would enhance its clarity and completeness. I am unable to approve this pull request, and recommend that another reviewer does so. I recommend that the pull request not be merged until the identified issues are addressed.
| embeddings. Filtering selected by vector search embeddings by their metadata was not supported at the moment of writing | ||
| this tutorial. |
| The application is configured in `application.properties`: | ||
|
|
| configuration based on the provided initialization settings. It is recommended to manually review the settings for the | ||
| created index and adjust them according to specific use cases. More information about vector search and FTS index | ||
| configuration can be found at [Couchbase Documentation](https://docs.couchbase.com/server/current/vector-search/vector-search.html). |
| ... | ||
| Document doc = new Document(String.format("%s", i + 1), j.getString("content"), Map.of("title", j.getString("title"))) | ||
| ... |
deniswsrosa
left a comment
There was a problem hiding this comment.
There are no instructions on how to run the app (always a good thing to add). Also, you need to include more links to documentation in general.
| --- | ||
|
|
||
| ## About This Tutorial | ||
| This tutorial will show how to use a Couchbase database cluster as a Spring AI embedding storage. |
There was a problem hiding this comment.
Would be nice to make this phrase a bit more engaging.
|
|
||
| ### What is Spring AI? | ||
|
|
||
| Spring AI is an extension of the Spring Framework that simplifies the integration of AI capabilities into Spring applications. It provides abstractions and integrations for working with various AI services and models, making it easier for developers to incorporate AI functionality without having to manage low-level implementation details. |
| ## Couchbase Embedding Store | ||
| Couchbase spring-ai integration stores each embedding in a separate document and uses an FTS vector index to perform | ||
| queries against stored vectors. Currently, it supports storing embeddings and their metadata, as well as removing | ||
| embeddings. |
There was a problem hiding this comment.
This last phrase sounds a bit awkward. Is the framework supposed to support more things? After reading it, feels like there is something missing that we haven't implemented yet.
|
|
||
| ### Prerequisites | ||
| - [Couchbase Capella](https://docs.couchbase.com/cloud/get-started/create-account.html) account or locally installed [Couchbase Server](/tutorial-couchbase-installation-options) | ||
| - Java 21 |
There was a problem hiding this comment.
Is java 21 a must? check the framework requirements. I think it has to be at least java 17.
| - [Couchbase Capella](https://docs.couchbase.com/cloud/get-started/create-account.html) account or locally installed [Couchbase Server](/tutorial-couchbase-installation-options) | ||
| - Java 21 | ||
| - Maven | ||
| - Couchbase Server running locally |
There was a problem hiding this comment.
You don't need couchbase server running locally. Just add "Couchbase Server"
|
|
||
| ### Vector Store Integration | ||
|
|
||
| The application uses `CouchbaseSearchVectorStore`, which: |
No description provided.