Skip to content

What is ragX? ​

ragX is an open-source, training-free agentic retrieval framework. Point it at a folder of documents and ask a question: an agent ranks and reads passages, a chain of sub-questions resolves each hop of a multi-hop question, and one call composes the answer with exact path:line citations.

python
from ragx import RagX

rag = RagX("./docs")
answer = rag.ask("Who founded the university the author of Harbor Light attended?")
print(answer.text)      # Thomas Wren
print(answer.sources)   # ['ashford_university.md:1-5', 'thomas_wren.md:1-5']

Why ragX ​

Single-shot retrieval-augmented generation (RAG) sends the question itself as the search query. That retrieves what the question names. On a large corpus it misses the evidence the question does not name: in the example above, the question names Harbor Light but never the author or her university, and those are the documents that hold the answer.

ragX names that missing evidence through two separate routes:

  • The forage loop. An agent ranks the corpus and reads passages for up to ten turns. Because it writes each query after reading, a query can name an entity the question never mentioned.
  • The slot chain. The question is broken into sub-questions with #1, #2 slots, and each hop is retrieved with the earlier answers filled in.

One compose call then answers over everything both routes found. See How ragX works for the full pipeline.

Results in brief ​

On nested samples of Wikipedia from 240K to 21M passages, benchmarked with 27 language models on five QA datasets:

+8.1 F1over the strongest single-shot baseline on all of Wikipedia (21M passages, eight models)
+5.4 → +9.0 F1the lead over single-shot retrieval grows as the corpus grows from 240K to 21M passages
22× fewerprompt tokens than DCI-Agent-Lite, an agent that searches the raw corpus with shell tools
17 of 21open-weight models on which ragX leads single-shot retrieval (a ragX variant leads on 19)

With a plain BM25 index, ragX also beats every dense single-shot baseline at 21M passages. The paper with the full study is coming soon.

What you get ​

Seven variantsFrom BM25-only ragx-lexical to the full ragx with a dense index and backfill.
Any modelOpenAI, Anthropic, Google, Groq, Together, Cerebras, Fireworks, any vLLM server, or a local Hugging Face model.
Exact citationsEvery answer cites the passages that contain it, as path:start-end.
Fenced by defaultTool output is wrapped as untrusted data, so planted instructions are not followed.
Three interfacesA Python API, a command line with a live trace, and an OpenAI-compatible server.
Incremental ingestionText, Markdown, HTML, PDF, Word, CSV, JSON and source files; only changed files are re-processed.

Next steps ​

Released under the Apache 2.0 License.