Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to create a diagnostic agent using Gemini a...

How to create a diagnostic agent using Gemini and osquery

Talk presented at Biznagafest (DevFest Malaga) in October 2025

Inspired by the "computer" in Star Trek, in this talk we are going to create a natural language diagnostic agent that can answer questions about your computer, from asking the number of cores and amount of memory installed to running a "Level 1 Diagnostic Procedure". This AI agent will be built step by step using Python, Vertex AI, Gemini and OSQuery. OSQuery is an open source tool originally developed by Facebook to expose operating system information using the SQL language. Its benefits include the ability to perform rapid diagnosis using queries instead of memorising command line tools and joining data manually. It's also possible to download query packs for the most common diagnostic procedures. As LLMs are really good at writing SQL, we are going to explore how this tool in the "hands" of an AI agent can enable advanced diagnostics using natural language, effectively mimicking the USS Enterprise engineering experience.

Avatar for Daniela Petruzalek

Daniela Petruzalek

October 27, 2025
Tweet

More Decks by Daniela Petruzalek

Other Decks in Technology

Transcript

  1. How to create a diagnostic agent using Gemini and osquery

    Daniela Petruzalek Developer Relations Engineer @ Google Cloud @danicat83
  2. Who am I? Developer Relations Engineer at Google UK Originally

    from Brazil 󰎙, but living in the UK 󰏅 since 2019. My background is in backend and data engineering.
  3. Space: The Final Frontier… “Hello computer” “Computer, execute a level

    1 diagnostic procedure” “Computer, run a simulation” “Computer, create a routine”
  4. OSQuery osquery is a monitoring, instrumentation and analysis tool for

    operating systems using the SQL language Available for Linux, macOS and Windows
  5. Agent Development Kit Agent Development Kit (ADK) is a framework

    for development and deployment of AI agents. While it is optimised for Gemini and Google products, ADK is model-agnostic and environment-agnostic https://google.github.io/adk-docs/
  6. Problems! osquery tables vary according to the host operating system

    Agent may produce “valid” but incorrect queries: SELECT * FROM process WHERE name = "malware" Hallucinations: models can generate fake information
  7. Context Engineering The model’s response can be only as good

    as the context it holds Improvement points: - System prompt - Tools (!!!) - Information retrieval: - Web Search - Retrieval Augmented Generation (RAG)
  8. V4: Schema Discovery Ideia: supply the list of tables and

    respective schemas using RAG Schemas: github.com/osquery/osquery/tree/master/specs Vertex AI RAG Engine: cloud.google.com/vertex-ai/generative-ai/docs/rag-engine/rag-overview
  9. Final Thoughts Developing agents can be challenging, but tools like

    ADK can ease some of the pain Developing clients as a backend engineer is still hard, but coding agents can help (e.g. Gemini CLI) Diagnosing a computer just with voice is not a reality yet, but it seems pretty close
  10. Useful Resources Code: github.com/danicat/biznagafest ADK: google.github.io/adk-docs ADK samples: github.com/google/adk-samples Models:

    ai.google.dev/gemini-api/docs/models Osquery: www.osquery.io Vertex AI RAG: cloud.google.com/vertex-ai/generative-ai/docs/rag-engine/rag-quickstart