Home Explore Blog CI



ragit

docs/commands/tfidf.txt
269725e0a401cb936b2f24cd176c8a1c202835ce2729b551000000030000046f
rag-tfidf(1)
==========

NAME
----
rag-tfidf - Run full-text search using its tfidf engine

SYNOPSIS
--------
[verse]
'rag tfidf' [--uid-only] [--keyword | --query] [--limit <n=10>]
            [--json | -j] <keywords>

DESCRIPTION
-----------
This command is to test full-text search engine, not to retrieve chunks. If
you want to retrieve chunks, run `rag retrieve-chunks`.

You can run full-text search on your knowledge-base using this command. Be
careful that its argument is `<keywords>`, not `<query>`. Ragit goes through
an LLM prompt which extracts keywords from a query, but `rag tfidf` does not.
If you want such behavior, try `rag tfidf --query <your_query>`.

- `rag tfidf --query "How do I use ragit?"`
- `rag tfidf "ragit, usage, ragit instruction, ragit tutorial"`

In short, if you want to use it like a embedding-search engine, use
`rag tfidf --query`. If you want a keyword-based search engine, use `rag tfidf`.

If `--json` is set, it dumps a valid json to stdout. Its schema is,

- no flags: `[result: { score: float, source: string, summary: string, title: string, uid: string }]`
- `--uid-only`: `[uid: string]`

Chunks
35606de3 (1st chunk of `docs/commands/tfidf.txt`)
Title: Rag-TFIDF Command
Summary
The rag-tfidf command is used to perform full-text search using its TF-IDF engine, allowing users to search a knowledge base with either keywords or a query, and output results in various formats, including JSON.