Skip to content

Configuration ​

Every setting is a keyword argument of RagX (or a field of ragx.Settings):

python
RagX("./docs", variant="ragx", steps=8, backfill=24, embed_model="BAAI/bge-m3", device="cuda")

Models ​

SettingDefaultMeaning
modelfrom the environmentprovider:model; see Models and providers
scout_modelmodelmodel for the forage loop and the slot chain
answer_modelmodelmodel for the compose call
thinkthe variant's (ragx-think: on)thinking mode in every call
think_budget8192extra tokens a thinking call may spend
max_context_tokens32768 for vllm:/hf:, none otherwisethe reader's context; the evidence is trimmed to fit
temperature0.0sampling temperature
cacheFalsememoise identical model calls and tool results within the process

The method ​

SettingDefaultMeaning
variantragx-lexicalone of ragx, ragx-core, ragx-lexical, ragx-fused, ragx-rerank, ragx-fast, ragx-think, classic
retrieverthe variant'soverride the ranker: bm25, dense, fused, rerank
backfillthe variant's (48 or 0)the question's own top passages appended at compose
steps10forager turns
rank_k8passages listed per RANK
hop_k4passages retrieved per hop
max_hops4sub-questions at most
read_cap8read passages composed
extra_cap12extra passages composed (hop passages first)
tools["RANK", "READ"]forager tools; add "SEARCH" for line search
fenceTruefence tool output and evidence as untrusted data
compose_reasoningFalsea reasoning pass before the compose: True, or "auto" for number, date and comparison questions
typed_hintsTruethe answer-type hint in the compose prompt

Retrieval ​

SettingDefaultMeaning
embed_modelQwen/Qwen3-Embedding-0.6Bsentence-transformers embedder for dense ranking
rerank_modelBAAI/bge-reranker-v2-m3cross-encoder for rerank
rerank_depth100dense candidates the reranker (and fusion) consider
deviceautomatic"cpu", "cuda", ... for the embedder and reranker
passage_words120passage size when files are cut

Answers ​

SettingDefaultMeaning
verify_citationsTruecite only passages that contain the answer (grounding)
abstain_on_weak_evidenceFalseallow "I don't know" and replace ungrounded answers with a refusal

Ingestion ​

SettingDefaultMeaning
cache_dir<corpus>/.ragxwhere the mirror, index and embeddings live
include[] (everything supported)glob allowlist
exclude[".git/**", "node_modules/**", ".ragx/**"]glob blocklist

Classic agent ​

Used only with variant="classic"; see The classic agent.

SettingDefaultMeaning
routeagenticagentic, adaptive, deep or both
max_steps5tool-loop turns
auto_budgetTruefewer turns and extras for scouts of 2.5B parameters or less
max_result_lines40search lines shown per call
max_read_chars4000characters per read
prerankTrueseed the loop with a BM25 ranking of likely files
single_shot_reads4files the adaptive route reads first; files per hop in deep
deep_hops4sub-questions in deep
deep_surf_cap12surfaced files composed in deep
deep_chain_notesFalseinclude the resolved chain in the compose prompt
surf_cap16surfaced files composed in agentic
compose_surfacedTruecompose over surfaced files, not only reads
semantic_fallbackFalseoffer the SEMANTIC tool (pyragx[semantic])
fuzzyTrueoffer FUZZY when ugrep is installed
context_lines1lines of context around each search hit
sandbox_observationsFalsefence tool output as quoted data

Released under the Apache 2.0 License.