Skip to main content
Ragrails has three interfaces, and each one gets defaults from a different place. Keeping those scopes separate prevents most configuration surprises. See vector databases for supported provider / vector_db values.
SDK constructor defaults do not automatically become CLI defaults. CLI .ragrails.toml values do not automatically become REST defaults.

One Stack, Three Config Forms

This is the same local setup in each interface: Qdrant at http://localhost:6333, Voyage embeddings, and OpenAI chat.

SDK Defaults

Use constructor defaults when you are writing Python. Every call on that rag object can inherit the configured vector store, embedding model, LLM, and reranker.
Override one call by passing method arguments:
rag.llm() requires a model unless one was configured in RagRails(llm={...}).

CLI Defaults

Use .ragrails.toml when you run terminal commands. The CLI looks for .ragrails.toml in the current working directory. Run ragrails with no subcommand to open the setup wizard:
The wizard writes .ragrails.toml. After that, commands can be shorter:
Without .ragrails.toml, pass explicit flags:
Flags always win for that run. For example, this queries a different collection without editing .ragrails.toml:

REST API Defaults

REST requests are self-contained. Put provider and vector-store settings in the request body.
The REST API also exposes /docs and /v1/openapi.json, so generated clients can type these request bodies.

Secrets

Do not put API keys in .ragrails.toml. Store non-secret defaults in config and keep credentials in environment variables.
See environment variables for every provider key.

Complete .ragrails.toml

Keep only the sections you need.

Validate CLI Config

Run doctor from the same directory as .ragrails.toml:
Use --config to inspect a file somewhere else:

URL Ingestion Setup

Scrape Website needs the URL extra and a browser install. This is environment setup, not provider configuration.