Capella iQ: Couchbase’s First Step Into AI
Capella iQ is a generative AI-powered coding assistant that helps developers become more productive faster. Continue Reading!
Join the DZone community and get the full member experience.
Join For FreeCouchbase's newest AI cloud service is GA on Jan 30! It is called Capella iQ. We did a private preview for it in September, and some of you were invited to try it out! Now, it is available to every Couchbase customer who would like to see firsthand how useful AI can be in a database environment and what a boost it can add to developer productivity!
Even if you are not an existing customer, you can create a free trial account and try it out!
What Is Capella iQ?
With the advent of Gen AI, we are seeing perhaps what's the biggest and the fastest reimagination and reinvention of enterprise apps in recent memory. Since at the heart of every application is actually an operational database, with the addition of Gen AI, we are not just advancing databases; we are empowering our customers.
Capella iQ is a generative AI-powered coding assistant that’s built into the Capella Query Workbench to help developers instantly become more productive. Developers can converse with the Capella iQ coding assistant in natural language to create synthetic datasets, compose SQL++ queries, suggest optimal indexes, write application-specific code, and build and run functional test cases. The, of course, knows Couchbase-specific context such as a bucket, scope, collection, and index definitions.
Capella iQ doesn’t just help the newbies. It also helps experienced developers who are very familiar with SQL++ suggest better, more optimal queries and even gives relevant suggestions when asked to do so! What's more? It can generate a chart in a single click, giving you insight into your data! As they say — a picture is worth 1,000 words! It can even help generate application code around the query in your favorite SDK, so you can get started with building the software application in a more standardized way.
Let's show and not just talk:
iQ is accessible under the “Query” tab of “Data Tools (because that's where you write SQL++!)
Imagine that you are new to Couchbase Capella, and you have no pre-existing data! This is how you start!
Once you accept our terms and conditions, you can start using iQ.
You can give your prompt as follows:
create scope,collection and data for netflix engagement ratings.The data should be realistic
and have fields like : Title,Release Data,Hours Viewed,Number of ratings,Ratings,Genre,Keywords
and Description.
And watch iQ come back with SQL++ queries for the above.
Once you click “Run,” they would be copied to the Query Editor, and a scope, collection, and data would be created.
You can iterate on the queries by asking it to make changes. For e.g., I asked it to use uuid()
to generate the key.
After enough data has been loaded, we are now ready to query the data. Like real-world scenarios, since we didn’t create the data, we don’t know everything about it.
So I will ask it to show me some documents.
It does give me the query, but on running the query, it tells us that we do not have an appropriate index. iQ detects that the query run has failed, debugs it for you, and gives you a suggestion to go to the Index Advice tab that will recommend an optimal index.
We could code it to create a primary index, but as database experts, you all know that with increasing datasets, you never want to scan using a primary index.
Index Advisor does recommend a primary index (because the query does not have a WHERE clause).
Once we click “Build Primary Index,” we go back to the iQ tab and rerun our query.
Now, based on five documents that we have seen, we have some idea of our data.
So we ask some more questions.
Find the latest 5 Science Fiction movies released.
Get the average rating for each genre and list the top 5 genres with the highest average rating.
List the top 5 movies with the most hours viewed
You can even see the results in the form of a chart by clicking on the “Chart” button.
Show 5 movies that include the keyword "family".
You could generate the SDK code for a query once it is generated in your favorite language by clicking on the SDK button” and then selecting your language of choice. Currently, this functionality is in preview. So I would suggest you take a very careful look before you use it in your application. Once you select the SDK, we remember your favorite language.
If you decide it is not your favorite language after all, you can change the SDK selection by going to “iQ Settings” and selecting your new favorite.
If the query generated is complex and you are curious what the query does at each level, you can head to “iQ Settings” and select “Explain Queries”. It is not enabled by default.
To summarize, Capella iQ can make your life easier (when working with Couchbase Capella only!) by helping you convert your thoughts to SQL++ queries, giving you insight into your data by charting it, even generating synthetic data and helping you get started with application code.
Try it out yourself! If you are not an existing Couchbase customer, you can create a free trial account.
Opinions expressed by DZone contributors are their own.
Comments