Hello Alexandre,
Welcome to the conversational analytics journey! It is great to see you building on the Agent Development Kit (ADK) and the Conversational Analytics (CA) API. Moving beyond out-of-the-box UI implementations into an API-first, headless approach is exactly how you unlock enterprise-scale AI. However, you are absolutely right that moving to a programmatic architecture introduces some unique infrastructure and state-management challenges.
Letâs tackle your roadblocks one by one. Iâll actually start with your final question, as it ties perfectly into the semantic routing strategy I was just discussing with Ruth above.
1. Adding Custom Governance Parameters to LookML
This is a brilliant question. LookML is a strictly typed, validated language. If you try to invent arbitrary parameter keys at the root level (e.g., owner: "data_engineering" or data_tier: "gold"), the LookML compiler will throw a syntax error and refuse to save.
However, this brings us right back to the superpower of the tags parameter.
Because the tags parameter accepts an array of arbitrary strings, it is the perfect native vessel for injecting governance metadata without breaking validation. My go-to strategy here is to implement a strict Key:Value String Convention within the tags array at the Explore, View, or Measure level:
LookML
explore: enterprise_revenue {
label: "Enterprise Revenue"
# Injecting custom governance metadata via Key:Value tags
tags: [
"gov_owner:alexandre_mgn",
"gov_domain:finance",
"gov_tier:certified_gold",
"pii:false"
]
}
measure: total_net_revenue {
type: sum
sql: ${gross_revenue} - ${refunds} ;;
tags: ["gov_owner:finance_analytics", "dq_score:high"]
}
Why this is so powerful for your ADK setup: When your ADK middleware requests the LookML semantic layer via the API, those tags are exposed in the JSON metadata payload. You can write a lightweight parsing function in your orchestration layer to read the tags array, split the strings by the colon (:), and instantly reconstruct a JSON object containing your custom governance rules. You can then use this to render a âData Ownerâ or âGold Certifiedâ badge in your custom frontend UI, or restrict API routing based on the gov_tierâall while keeping LookML as your single source of truth.
2. Setting up Golden Queries via the API
In a UI-first paradigm, Golden Queries are managed via Lookerâs interface. In an API-first architecture, you donât save them to a UI config panel; you pass them dynamically as a structured JSON payload directly to the CA API.
Here is the pattern to execute this programmatically:
-
The Extraction: Build your perfect âgoldenâ query in the Looker UI. Grab the âshare slugâ from the URL, and use your ADK to make a GET /queries/slug/{slug} request to the Looker API. This returns the exact, deterministic query metadata (model, explore, fields, filters, etc.).
-
The Payload Schema: You then construct a Golden Query object that pairs a natural_language_questions array (the user prompts) with that looker_query metadata.
-
The Execution: When you invoke the CA API to start a conversation or ask a question, compile your list of Golden Query objects under the looker_golden_queries key in your context payload.
-
Architectural Tip: Donât pass your entire library of 50 golden queries on every API call (it wastes tokens). Have your ADK perform a quick semantic search to detect the userâs intent, and dynamically inject only the 3-5 most relevant golden queries into the payload.
3. Accessing Conversations made by a Service Account
This is a classic state-management hurdle in headless BI setups. When your ADK uses a Service Account (SA) to authenticate with the Looker API, Lookerâs backend binds the resulting conversation_id and history exclusively to that SAâs user_id.
-
For Retrieval / Auditing: You can retrieve the history natively by hitting the /conversations endpoint authenticated as that specific Service Account. Alternatively, you can query Lookerâs internal System Activity explores (filtering for the SAâs user ID) to monitor token usage and generated queries.
-
The Architectural Best Practice: Because the SA acts as a monolithic proxy, Looker natively loses the context of which actual end-user in your ADK is asking the question. In a headless setup, I strongly recommend decoupling conversation state management from Looker. Use your ADK middleware to log the userâs prompt, their real internal ID, the conversation_id, and Lookerâs API response into your own application database (like BigQuery or Postgresql). This gives you complete control over conversational memory, auditability, and telemetry without fighting proxy-authentication limitations.
You are building exactly the kind of next-generation data architecture we love to see. Keep pushing the envelope. LMK if you need any clarification on parsing those namespaced tags in your ADK!