Looker Integration
Oxy integrates with Looker to enable agents and procedures to query Looker explores directly. The integration supports metadata synchronization, LLM-powered query generation, and procedure automation.Prerequisites
- A Looker instance with API access enabled
- API credentials (client ID and client secret) from your Looker admin panel
- Oxy CLI installed
Configuration
Add your Looker integration toconfig.yml:
Configuration Options
client_id_var- Name of the environment variable storing your Looker API client IDclient_secret_var- Name of the environment variable storing your Looker API client secretbase_url- Your Looker instance URL including the API port (typically:19999)explores- List of Looker explores to make availablemodel- The LookML model namename- The explore namedescription- Optional description for agent context
Authentication
Oxy authenticates with Looker using OAuth 2.0 client credentials. Store your credentials as environment variables:Create new API credentials
Click New API Key. Copy the Client ID and Client Secret — the secret is only shown once.
Metadata Synchronization
Before querying, you need to sync explore metadata from Looker. This downloads field definitions (dimensions, measures, views) so that agents have context for generating queries.Sync Commands
How Metadata Storage Works
Synced metadata is stored in two layers:- Base metadata (auto-generated, git-ignored):
~/.local/share/oxy/.looker/<integration>/<model>/<explore>.yml - Overlay metadata (user-managed, version-controlled):
looker/<integration>/<model>/<explore>.ymlin your project directory
Overlay Metadata Example
Using Looker in Agents
Add a Looker tool to your agent configuration to let the agent query Looker explores:Looker Filter Syntax
Looker uses its own filter syntax, not SQL expressions. When writing overlay hints for agents, include examples using native Looker filter syntax:| Filter Type | Example |
|---|---|
| Relative dates | "last 30 days", "yesterday", "this quarter" |
| Date ranges | "2024-01-01 to 2024-12-31" |
| String matching | "value", "%partial%" |
| Numeric comparisons | ">=100", "[10,20]" |
Using Looker in Agentic Workflows
An agentic workflow (.aw.yml) lets an LLM autonomously plan and execute Looker queries. Add a looker_query transition to wire up the Looker explore:
Using Looker in Procedures
Add a Looker query task to your procedure:Query Parameters
fields- List of dimension and measure names to include (use fullview.field_nameformat)filters- Map of field names to Looker filter expressionsfilter_expression- Optional filter expression for complex OR conditionssorts- List of sort objects, each withfieldanddirection(ascordesc, defaults toasc)limit- Maximum number of rows to return (use-1for unlimited)
CLI Commands
Test Connection
List Synced Explores
Troubleshooting
- Authentication errors - Verify your client ID and secret are correct and that the environment variables are exported. API credentials may expire if rotated in the Looker admin panel.
- Connection refused - Ensure the
base_urlincludes the correct port (Looker API typically runs on port19999). - Empty metadata after sync - Check that the explores listed in your configuration exist in Looker and that your API credentials have permission to access them.
- Query errors with filters - Looker uses its own filter syntax, not SQL. Use expressions like
"last 30 days"instead of SQL date functions.