﻿# Tavily language preference and filter_by_language are separate controls

Choose Tavily language boosting or strict filtering explicitly, validating the dependent language value and keeping source language separate from answer translation.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-tavily-language-boost-filter/
Language: en

## Define the language requirement

A Russian support assistant may prefer Russian documentation while accepting an authoritative English specification. A language-learning exercise may require sources only in the target language. These are different retrieval policies. Decide which applies before setting a language field, and keep the answer's presentation language as a separate application choice.

## Distinguish boost from exclusion

The [Search reference](https://docs.tavily.com/documentation/api-reference/endpoint/search) defines `language` as a result-ranking boost by default. `filter_by_language` strictly excludes nonmatching results and requires a language value. Validate that dependency in the request builder. Do not represent the preference alone as a guarantee that every returned page uses the chosen language.

## Evaluate the missing-source tradeoff

[Search best practices](https://docs.tavily.com/documentation/best-practices/best-practices-search) explains that strict filtering can reduce coverage and recommends matching query language to the selected language. For a technical question, preserve identifiers during any translation. A translated description can help retrieval while a changed package name can send it toward an unrelated subject.

Suppose the only detailed error explanation is in an English vendor manual. A preference policy may retain that source; a strict Russian-only policy may remove it. Both can implement the selected policy correctly. The interface should explain the resulting evidence gap rather than invent a Russian source or silently weaken the filter.

## Verify the wrapper boundary

The [official Python client](https://github.com/tavily-ai/tavily-python/blob/master/tavily/tavily.py) exposes separate language and strict-filter arguments. Keep them separate in your own configuration too. A single locale control can conceal whether the application requested ranking preference, exclusion, or merely translation of the final answer. Store effective request values with the result record.

## Test eligibility before fluency

Use reviewed cases with a matching-language source, a useful foreign-language source, and no matching-language evidence. Check the returned URL set and source language before scoring the generated answer's readability. A fluent translation cannot demonstrate that retrieval obeyed a strict source-language rule.

The existing guides to [Russian identifier handling](/journal/russian-bm25-analyzer-exact-identifiers/) and [retrieval judgments](/journal/beir-qrels-unjudged-retrieval-evaluation/) support this separation. Report source eligibility, factual support, and answer language as distinct outcomes. That makes it possible to improve translation without obscuring a retrieval constraint or misclassifying a deliberate coverage reduction as an API failure.
