Skip to content

The classic agent ​

variant="classic" runs ragX's original agent. Instead of ranking passages, it works on whole files with a toolbelt of shell-style tools, and it is useful for code bases and document folders where exact search and section navigation matter more than multi-hop chains.

python
rag = RagX("./repo", variant="classic")

Tools ​

ActionWhat it does
SEARCH: <keywords>case-insensitive search with ripgrep (or a Python fallback); returns path:line snippets
RANK: <keywords>ranks whole files with BM25 over document frequencies
FUZZY: <phrase>spelling-tolerant search with ugrep, when installed
LIST [glob]lists files
OUTLINEthe corpus's heading outline
TOC <path>one file's headings
READ <path>:<start>-<end>exact lines
PEEK <path>:<line>a small window around a line
SEMANTIC: <phrase>embedding search, only with semantic_fallback=True and pyragx[semantic]
ANSWER: <answer>finish

Routes ​

route= chooses how the classic agent runs:

RouteBehaviour
agentic (default)the tool loop, then a compose over what it read and surfaced
adaptiveone ranked read and answer first; escalates to the loop when that answer is not grounded
deepthe loop, then a file-level slot chain
bothdeep, plus a second compose with the chain's notes; answer.confidence is 0.9 when the two agree and 0.5 when they do not

The classic agent's settings (max_steps, max_result_lines, max_read_chars, prerank, deep_hops, surf_cap, sandbox_observations and others) are listed in Configuration.

Released under the Apache 2.0 License.