Home Explore Blog Models CI



ragit

docs/commands/retrieve-chunks.txt
450132baf38c7a954f42561d5bc8974744563661aab1996a00000003000004cb
rag-retrieve-chunks(1)
==========

NAME
----
rag-retrieve-chunks - Retrive chunks that are relevant to a query

SYNOPSIS
--------
[verse]
'rag retrive-chunks' [--uid-only] [--max-retrieval <n>] [--abbrev <n=9>]
            [--max-summaries <n>] [--super-rerank] [--json | -j] <query>

DESCRIPTION
-----------
It runs step 2, 3 and 4 of ragit's pipeline. If you wanna know about the
pipeline, run `rag help pipeline`.

`--max-summaries` decides how many chunks are selected by tfidf-scores (step 3).
If it's not set, it uses the value in config.

`max-retrieval` decides how many chunks are selected by reranker (step 4).
If it's not, it uses the value in config. If `--no-rerank` is set, this
value is ignored.

If `--super-rerank` is set, it takes longer to run (and more expensive), but
is likely to give you a better result.

Instead of showing the full 64-byte uid, it shows the first `n` bytes of uid,
where `n` is set by `--abbrev` option. Unlike git, it doesn't use any
heuristics to guarantee that the abbreviated uid is unique.

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

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

Chunks
bc7a93ce (1st chunk of `docs/commands/retrieve-chunks.txt`)
Title: Rag Retrieve Chunks Command
Summary
The rag-retrieve-chunks command retrieves chunks relevant to a query, allowing for customization of retrieval and summary options, such as maximum retrieval, summaries, and output format, with additional features including super-rerank for improved results and configurable output formats like JSON.