DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • GenAI Implementation Isn't Magic — It’s a Lifecycle
  • Design Patterns for GenAI Creative Systems in Advertising
  • AI Paradigm Shift: Analytics Without SQL
  • Beyond Partitioning and Z-Order: A Deep Dive into Liquid Clustering for Unity Catalog Managed Tables

Trending

  • Ujorm3: A New Lightweight ORM for JavaBeans and Records
  • Detecting Bugs and Vulnerabilities in Java With SonarQube
  • When Snowflake Lies to You: Understanding False Failures in dbt Pipelines
  • Using LLMs to Automate Data Cleaning and Transformation Pipelines
  1. DZone
  2. Data Engineering
  3. Databases
  4. Capella iQ: Couchbase’s First Step Into AI

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!

By 
Kamini Jagtiani user avatar
Kamini Jagtiani
·
Feb. 01, 24 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
3.3K Views

Join the DZone community and get the full member experience.

Join For Free

Couchbase'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:

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

capella

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. 

queries

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.

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.

query context

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.

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.

HTML
 
Find the latest 5 Science Fiction movies released.


insert queries

HTML
 
Get the average rating for each genre and list the top 5 genres with the highest average rating.


genre

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

results

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

SDK selectioniQ settings

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.

explain queriesconvert queries

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. 

Capella (engineering) sql generative AI

Opinions expressed by DZone contributors are their own.

Related

  • GenAI Implementation Isn't Magic — It’s a Lifecycle
  • Design Patterns for GenAI Creative Systems in Advertising
  • AI Paradigm Shift: Analytics Without SQL
  • Beyond Partitioning and Z-Order: A Deep Dive into Liquid Clustering for Unity Catalog Managed Tables

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook