Environment Variables
The agent reads configuration from environment variables with sensible defaults defined inagent.py:10-18.
Project and Dataset Configuration
The Google Cloud project ID containing the BigQuery datasets.
The target BigQuery dataset for agent queries.
The Google Cloud region for Vertex AI operations.
The organization name used in security rejection messages.
Model Configuration
Legacy model configuration variable (retained for compatibility).
The internal name identifier for the agent.
The Vertex AI model used by the agent. This is the active model configuration.
Model Configuration
The agent uses Gemini 2.5 Pro as the default language model.Supported Models
Whilegemini-2.5-pro is the default, you can configure any Vertex AI model by setting the LLM_1_MODELO environment variable:
Model Selection Criteria
When choosing a model, consider:
- Gemini 2.5 Pro: Best for complex SQL generation and reasoning
- Gemini 2.5 Flash: Faster responses, suitable for simpler queries
- Gemini 1.5 Pro: Balance of performance and cost
Tool Configuration
The agent’s BigQuery integration is configured with strict security controls.BigQueryToolConfig
Defined inagent.py:24-26:
Controls write access to BigQuery. Set to
WriteMode.BLOCKED to enforce read-only operations.WriteMode Options
TheWriteMode enum provides the following security levels:
| Mode | Description | Use Case |
|---|---|---|
WriteMode.BLOCKED | Prevents all write operations | Production analytics (current setting) |
WriteMode.ALLOWED | Permits write operations | Development/testing environments |
Tool Integration
The configured tool is passed to the agent:Customizing the Instruction Prompt
The agent’s behavior is primarily controlled by the instruction prompt. You can customize it by modifying thenew_instruction variable in agent.py:38-68.
Current Instruction Structure
Customization Examples
Add Industry-Specific Context
Add Industry-Specific Context
Modify Output Format
Modify Output Format
Configuration Best Practices
Use Environment Variables
Never hardcode configuration values. Always use environment variables for:
- Project IDs and dataset names
- Model selection
- Region configuration
- Organization names
Test Instruction Changes
When modifying the instruction prompt:
- Test with diverse query types
- Verify security guardrails still work
- Ensure output format remains consistent
- Check that tool usage is still correct
Example Configuration File
For deployment, create a.env file:
Load environment variables using
python-dotenv (already included in requirements.txt).