Skip to content

Recommended Configurations

These are opinionated starting points designed to get you up and running quickly. Copy the preset that matches your goals, then tweak as needed.

This preset prioritizes SQL generation quality above all else. It pairs a top-tier cloud LLM with semantic vector search for the most accurate knowledge retrieval.

# LLM — Anthropic Claude Sonnet
SQL_AGENT_LLM_PROVIDER=anthropic
SQL_AGENT_LLM_MODEL=claude-sonnet-4-20250514
SQL_AGENT_LLM_TEMPERATURE=0.3
# Search — pgvector semantic search
SQL_AGENT_SEARCH_DRIVER=pgvector
# Embeddings — OpenAI (used by pgvector driver)
SQL_AGENT_EMBEDDINGS_CONNECTION=pgvector
SQL_AGENT_EMBEDDINGS_PROVIDER=openai
SQL_AGENT_EMBEDDINGS_MODEL=text-embedding-3-small
SQL_AGENT_EMBEDDINGS_DIMENSIONS=1536
# Agent — more iterations for self-correction
SQL_AGENT_MAX_ITERATIONS=15
# Learning — enabled with auto error capture
SQL_AGENT_LEARNING_ENABLED=true
SQL_AGENT_AUTO_SAVE_ERRORS=true

The pgvector search driver needs a dedicated PostgreSQL connection with the pgvector extension installed. Add this to your config/database.php connections array:

'pgvector' => [
'driver' => 'pgsql',
'host' => env('PGVECTOR_HOST', '127.0.0.1'),
'port' => env('PGVECTOR_PORT', '5432'),
'database' => env('PGVECTOR_DATABASE', 'forge'),
'username' => env('PGVECTOR_USERNAME', 'forge'),
'password' => env('PGVECTOR_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => 'prefer',
],

This preset requires the pgvector/pgvector package:

Terminal window
composer require pgvector/pgvector
php artisan sql-agent:setup-pgvector
php artisan sql-agent:generate-embeddings

This preset keeps everything local with zero API costs. Your data never leaves your machine, making it ideal for development, experimentation, or privacy-sensitive environments.

# LLM — Ollama local model
SQL_AGENT_LLM_PROVIDER=ollama
SQL_AGENT_LLM_MODEL=qwen3:8b
SQL_AGENT_LLM_TEMPERATURE=0.3
# Search — database full-text search (no external services)
SQL_AGENT_SEARCH_DRIVER=database
# Agent — default iterations
SQL_AGENT_MAX_ITERATIONS=10
# Learning — enabled
SQL_AGENT_LEARNING_ENABLED=true
SQL_AGENT_AUTO_SAVE_ERRORS=true

No embeddings configuration is needed since the database search driver uses native full-text search instead of vector embeddings.

The LLM provider and search driver are completely independent — you can freely combine any LLM with any search driver. For example, you could pair Ollama for local inference with pgvector for high-quality semantic search, or use Anthropic Claude with the simple database full-text driver if you don’t need vector embeddings. Pick the LLM that fits your quality and cost requirements, then choose the search driver that matches your infrastructure.

These presets are just starting points. See the full Configuration guide for every available option and the LLM & Search Drivers guide for all supported providers and search backends.