Duet AI Review: My Perception and Use Cases — Part 1

Rubens Zimbres
Google Cloud - Community
8 min readNov 8, 2023

This article is Part 1 of a two-part review on Duet AI (Part 2 here), presenting my perceptions about the use of the tool. Here, I will approach some use cases: the use of Duet AI to parse logs in Google Cloud Logging (Logs Explorer), how to easily create SQL queries in BigQuery with Duet AI, how Duet AI can help understanding Google Cloud documentation and extracting exactly what you need, its applications in the Google Workspace and finally how Generative AI via Duet AI can help monitor, identify and analyze cybersecurity incidents in the cloud.

Duet AI is a tool that uses Generative AI (LLMs) to provide a variety of features, including:

  • Real-time conversation: Duet AI can carry on real-time conversations with users, answering their questions and providing information in a comprehensive and informative way, considering code or Google Cloud infrastructure/documentation.
  • Information retrieval: Duet AI can access and retrieve information from a variety of sources, including the web, databases, and other knowledge sources. This makes it a powerful tool for research and learning. As it is also integrated with Google Workspace, it has applications in the daily corporate life, Marketing, Sales and also in Education.
  • Code companion: it helps translating code between languages, creating code, understanding code, creating unit tests and solving code vulnerabilities. In my specific case, I tested it in VS Code and Google Cloud.

Some Use Cases

Duet AI has a wide range of potential use cases, including:

  • Infrastructure management: Duet AI can help IT professionals manage infrastructure more efficiently by automating tasks and providing insights into performance and health. Probably the GKE (Google Kubernetes Engine) and Terraform scopes will be included in GA, I don’t know yet.
  • Security: Duet AI can help security professionals detect and respond to threats more quickly by providing insights into security data and suggesting remediation steps. It can analyze and parse logs, translate log data into Natural Language and even query a set of logs with Natural Language, instead of the specific syntax of Google Cloud Logging. Chronicle also offers this feature, what makes it much easier and faster to use than Splunk.
  • Customer service: Duet AI can help customer service representatives provide better customer support by answering customer questions more accurately and efficiently.
  • Education: Duet AI can help students learn more effectively by providing them with personalized learning experiences and answering their questions in a comprehensive and informative way.

Duet AI in the Workplace

Here are some specific examples of how Duet AI can be used in the workplace:

  • A Security Analyst can use Duet AI to help them investigate a potential security incident. They can provide Duet AI with the security data they have collected, and Duet AI will help them identify potential threats, CVEs affected and suggest remediation steps.
  • A Sales Engineer can use Duet AI to solve a customer’s question. They can simply ask Duet AI the customer’s question, and Duet AI will provide them with a comprehensive and informative answer.
  • Duet AI can also help marketers track the performance of their marketing campaigns. For example, Duet AI could generate a report showing the marketer which social media posts are getting the most engagement.

Parsing Logs

You can parse logs in Google Cloud Logging (Logs Explorer) and in Chronicle (SIEM tool). To use Duet AI to parse logs in Google Cloud Logging, you can follow these steps:

  1. Go to the Logs Explorer in the Google Cloud console.
  2. Select the log entries that you want to parse.
  3. Click the Explain this log entry button, at the top left of the log entry.
  4. Duet AI will generate a summary of the log entry.
  5. You can then use the summary to understand the log entry better, identify potential problems, ask for solutions and take corrective action. This way, Duet AI suggests remediations to a specific problem.

Here is an example of how to use Duet AI to parse a log entry in Google Cloud Logging:

Log entry:

2023-10-30 17:24:26 PST app/server.log:
[ERROR] Failed to connect to database: Connection refused

Duet AI summary:

“This log entry indicates that the application server was unable to connect to the database. This could be due to a number of reasons, such as a network problem, a database outage, or a problem with the database configuration.

To troubleshoot this issue, you can check the database connection settings in the application configuration file. You can also try restarting the database server. If you are still having problems, you can contact your database administrator for assistance.”

As you can see, Duet AI can provide valuable insights into log entries, even complex ones. This can help you to troubleshoot problems more quickly and efficiently.

In addition to the above, Duet AI is also under development to support more advanced log parsing tasks, such as:

  • Identifying patterns and trends in log data
  • Correlating log entries from different sources
  • Generating alerts for potential problems
Log understanding and troubleshooting using Duet AI

BigQuery

You can also generate SQL queries via text in BigQuery. As soon as you insert your prompt and click ENTER, a query will be generated:

# Get the top 10 products by sales for each day in the last 30 days

SELECT
product_name,
SUM(sales) AS total_sales,
DATE(order_date) AS order_date
FROM
`my-project.my-dataset.orders`
WHERE
order_date >= CURRENT_DATE() - INTERVAL 30 DAY
GROUP BY
product_name,
DATE(order_date)
ORDER BY
total_sales DESC
LIMIT
10;

Duet AI can also be used to generate more complex BigQuery queries, such as queries that involve filtering, joining, and aggregating data.

Duet AI in Google Cloud Documentation

Duet AI also helps finding specific topics in Google Cloud documentation. Instead of searching for content in multiple pages, you can easily ask in Natural Language in one place. This feature is still in development, but it has a semantic search inside Google Cloud documentation and extracts relevant information according to your prompt.

In Documentation, Duet AI has the following capabilities:

  • Providing guidance on best practices
  • Generating code
  • Creating applications

For example, you could ask Duet AI the following questions:

  • How do I create a new Compute Engine instance?
  • What are the best practices for using Cloud Storage?
  • Can you generate a Python script to read data from Cloud Bigtable?
  • Can you help me create a new web application using AppSheet?
  • How do I use KMS?

It can also search for content considering different documentation products, like:

  • How do I create a pipeline in Vertex AI with Kubeflow ?

Duet AI in Google Workspace

Duet AI can be used in Google Workspace in a number of ways, including:

  • Writing and editing documents: Duet AI can help you to write and edit documents by providing real-time suggestions and feedback.
  • Collaborating on documents: Duet AI makes it easier to share and discuss feedback.
  • Presenting information: Duet AI can generate visuals, such as charts and graphs, and by providing summaries of key points.
  • Answering questions and summarization: Duet AI can help you to answer questions more quickly and accurately by providing access to information from a variety of sources, including Google Search, Google Drive, Gmail, Maps, and other Google Workspace apps.

Here are some specific examples of how Duet AI can be used in Google Workspace:

  • A writer can use Duet AI to help them write a blog post. Duet AI can provide suggestions on topics, generate outlines, and edit the post for grammar and style.
  • A sales representative can use Duet AI to help them prepare for a presentation. Duet AI can generate slides, provide talking points, and suggest visuals.

In addition to the above, Duet AI is also under development to support more advanced Google Workspace features, such as:

  • Generating creative content, such as poems, code, scripts, and musical pieces, right within Google Workspace apps
  • Translating documents and presentations between languages
  • Identifying key concepts and insights from documents and presentations
  • Answering questions about documents and presentations in a comprehensive and informative way
Duet AI in action inside Google Workspace

Duet AI in Cybersecurity

Duet AI can be used in security in a number of ways, including:

  • Threat detection: Duet AI can help security teams to detect threats more quickly and efficiently by analyzing security data from a variety of sources, including security logs, network traffic, and endpoint data. This involves Google Cloud Logging, Firewall Insights and Chronicle.
  • Threat investigation: Duet AI can help security teams to investigate threats more effectively by providing them with insights into security data and suggesting remediation steps.
  • Threat response: Duet AI can help security teams to respond to threats more quickly by automating tasks and providing them with real-time assistance.

Duet AI is integrated with Chronicle Security Operations, which is a cloud-native Security Information and Event Management (SIEM) platform. It can be used to enhance the capabilities of Chronicle Security Operations in a number of ways, including:

  • Generating natural language queries: Like in Logging, Duet AI can generate natural language queries for Chronicle Security Operations, which can make it easier for security teams to search and analyze security data, without the need to learn a new syntax for the log queries, as it happens in Splunk. This feature eases the learning curve of a security analyst.
  • Summarizing cases: Duet AI can summarize cases in Chronicle Security Operations, which can help security teams to quickly understand the status of cases and identify the most important information.
  • Generating recommendations: Duet AI can generate recommendations for security teams based on the data in Chronicle Security Operations. For example, Duet AI can recommend remediation steps for specific threats.
Log parsing via Natural Language in Chronicle (Google Cloud SIEM tool)

Here are some specific examples of how Duet AI can be used in security:

  • A security analyst can use Duet AI to search for suspicious activity in their security logs. Duet AI can generate natural language queries that can be used to search for specific types of activity, such as login attempts from unusual locations, failed login attempts, unusual network traffic, or specific port/protocol codes.
  • A security analyst can use Duet AI to investigate a potential security incident. Duet AI can summarize the incident and provide recommendations for remediation steps.
  • A security analyst can use Duet AI to automate tasks such as responding to alerts and writing reports. This can free up the security analyst’s time to focus on more complex tasks.

Duet AI can also be used to identify potential LLM vulnerabilities in code by scanning the code for patterns and keywords that are associated with known vulnerabilities. It also generates remediation suggestions for identified LLM vulnerabilities. These remediation suggestions can be used to fix the vulnerabilities and make the code more secure.

Summary generation of findings in Chronicle

Wrapping up, Duet AI is an excellent tool with lots of potential use cases in Workspace, Google Cloud and is under development. I sincerely believe that it will help really A LOT when in GA (soon).

Check back next week for Part 2, covering Duet AI for coding, including VS Code features.

* Google ML Developer Programs team supported this work by providing Google Cloud Credits

--

--

Rubens Zimbres
Google Cloud - Community

I’m a Senior Data Scientist and Google Developer Expert in ML and GCP. I love studying NLP algos and Cloud Infra. CompTIA Security +. PhD. www.rubenszimbres.phd