We’re excited to announce the general availability of Capella iQ, our AI coding assistant for developers.

iQ allows developers to interact with the Couchbase database platform using natural language conversation, making database interactions more intuitive, efficient, and accessible. Developers can use Capella iQ within the Query Workbench in the Capella UI and within VS Code and JetBrains IDEs.

Capella iQ speeds up a variety of common tasks to accelerate the development cycle in natural language. Some examples are: 

    • Write SQL: iQ creates SQL++ queries to interact with data
    • Create test data: iQ accelerates development projects by creating sample data
    • Suggests indexes: iQ helps build the right indexes to reduce query times
    • Generate SDK-specific program: iQ assists in creating code for application development around the query.
      • Supporting: C, .NET, Go. Java, Kotlin, Node.js, PHP, Python, Ruby, Scala 
    • Data from queries can be visualized as JSON docs, tables, and charts to accelerate insights 

Why should developers use Capella iQ vs. generic Large Language Models (LLMs)?

While LLMs generally understand SQL, they do not know the schema of your Couchbase collections. The Capella workbench integrates query, index advisor, query path explanation, and visual profiling to complete the workflow from question to SQL optimization.

    • iQ automatically infers the schema of your collections, for customized prompts
      • That reduces common LLM trial and error scenarios
    • iQ only sends the structure and schema of the data in your collection. Never the data.

Watch this 2-minute overview of Capella iQ:

Sample queries on our travel-sample dataset

If you want to try Capella iQ quickly, use our preloaded “travel-sample” dataset. It is included in every free trial. 

    • In the Capella user interface, go to the Data Tools Query tab 
    • Click on the blue iQ button on the right-hand side to open the Capella iQ window
    • On the top of the iQ window:
      • Select Bucket=travel-sample, Scope=inventory, Collection=airline to provide the context. (You can select up to four collections)
      • iQ will suggest sample queries to get you started

Try clicking one of the suggested queries or ask your own by typing in the iQ prompt (e.g., Retrieve or insert data …). Ask any follow-up questions to improve the query and the output you may be looking for. It’s that simple.

Test on your own data

Now let’s create a new dataset in Capella by using iQ to build some queries.

As we will be working on a new dataset, let’s first reset Capella iQ.

    • Click on the Scope selector to select Select a Scope to reset Capella iQ context
    • Keep the Bucket value the same, as travel-sample

Click the suggested prompt:

“Create scope, collections and data for an inventory management app of an audio store:
categories: headphones and speakers (name and a short marketing description)
items: real-life branded headphones and speakers (name, description, category, price, number in stock), use UUIDs”

Run the query to see the new scope and collections get created. Sample documents are inserted into the new collection.

Use the iQ suggestion to set the context to the newly created scope and collection. Alternatively, on the top of the iQ window select the newly created scope and collections. In this case, we selected Scope=inventory and Collection=headphones, speakers as collections. This sets the context for iQ to help you provide better query suggestions. 

Let’s review the inserted documents by using the following prompt:

    • “Show me few documents from the collection headphones”

Try to run the query. Notice that since this collection is newly created and doesn’t have an index, Capella iQ suggests creating an index using Index Advice

    • Create the index as suggested in Index Advice and then rerun the query in iQ

Here are some additional sample query prompts for you to give it a try:

    • “Show me all items in the headphones collection that cost more $70”
    • “Show me all items in the headphones collection that are in stock”

As queries are run, Index Advice may suggest an appropriate index to speed up the query. To return to the iQ window, click on the blue iQ button on the right-hand side to open the Capella iQ AI assistant window.

Using Capella iQ in VS Code and JetBrains IDEs

Similar to iQ being used within the Capella UI, developers are now also able to use iQ within some of their favorite integrated development environments (IDE). Capella iQ is available within VS Code and JetBrains IDEs as an extension. 

Developers can start an iQ session within a separate side panel. Using iQ requires having Capella credentials. Users can set the context of their conversation by choosing their cluster, bucket, scopes and collections. 

Users of Capella iQ from within an IDE have a similar experience to within the Capella UI, with a few additional features. 

Similar features:

      • Write SQL: iQ creates SQL++ queries to interact with data
      • Create test data: iQ accelerates development projects by creating sample data
      • Suggests indexes: iQ helps build the right indexes to reduce query times
      • Generate SDK-specific program: iQ assists in creating code for application development around the query.
        • Supporting: C, .NET, Go. Java, Kotlin, Node.js, PHP, Python, Ruby Scala 
      • Data from queries can be visualized as JSON docs, tables and charts to accelerate insights 

Additional features:

      • Ask iQ about the SQL code written about correctness
      • Ask iQ about data structure like “What indexes do I have?”
      • Provide feedback on your interactions with iQ 
      • Connect and use iQ with Couchbase Server
        • Enterprise Edition
        • Community Edition 

Try Capella iQ

To try Capella iQ, begin your Capella trial today.

 

Author

Posted by Tim Rottach, Director of Product Line Marketing

Leave a reply