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.
Best Results
Section titled “Best Results”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.
Environment Variables
Section titled “Environment Variables”# LLM — Anthropic Claude SonnetSQL_AGENT_LLM_PROVIDER=anthropicSQL_AGENT_LLM_MODEL=claude-sonnet-4-20250514SQL_AGENT_LLM_TEMPERATURE=0.3
# Search — pgvector semantic searchSQL_AGENT_SEARCH_DRIVER=pgvector
# Embeddings — OpenAI (used by pgvector driver)SQL_AGENT_EMBEDDINGS_CONNECTION=pgvectorSQL_AGENT_EMBEDDINGS_PROVIDER=openaiSQL_AGENT_EMBEDDINGS_MODEL=text-embedding-3-smallSQL_AGENT_EMBEDDINGS_DIMENSIONS=1536
# Agent — more iterations for self-correctionSQL_AGENT_MAX_ITERATIONS=15
# Learning — enabled with auto error captureSQL_AGENT_LEARNING_ENABLED=trueSQL_AGENT_AUTO_SAVE_ERRORS=truepgvector Database Connection
Section titled “pgvector Database Connection”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:
composer require pgvector/pgvectorphp artisan sql-agent:setup-pgvectorphp artisan sql-agent:generate-embeddingsBudget-Friendly
Section titled “Budget-Friendly”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.
Environment Variables
Section titled “Environment Variables”# LLM — Ollama local modelSQL_AGENT_LLM_PROVIDER=ollamaSQL_AGENT_LLM_MODEL=qwen3:8bSQL_AGENT_LLM_TEMPERATURE=0.3
# Search — database full-text search (no external services)SQL_AGENT_SEARCH_DRIVER=database
# Agent — default iterationsSQL_AGENT_MAX_ITERATIONS=10
# Learning — enabledSQL_AGENT_LEARNING_ENABLED=trueSQL_AGENT_AUTO_SAVE_ERRORS=trueNo embeddings configuration is needed since the database search driver uses native full-text search instead of vector embeddings.
Mixing and Matching
Section titled “Mixing and Matching”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.