Skip to main content
chat() is stateless, but each turn can use history, intent routing, query rewriting, reranking, and retrieval-quality gates. Tune these controls when the chatbot is too expensive, too eager to search, or too willing to answer from weak context.

Conversation controls

Persist result.history after each turn. Ragrails does not store sessions for you.

Retrieval quality

Retrieval quality filters weak chunks before generation and records confidence metadata in every chat result.

Low-confidence modes

Result fields to surface in a product UI:

Streaming tuned chat

The same controls work with chat_stream() and /v1/chat/stream. Streaming is useful for tuned chat because callers can see intent, retrieval, quality, generation, token, error, and final events.

Tuning recipes