Skip to content

Ragbits CLI#

Ragbits comes with a command-line interface (CLI) that provides several commands for working with the Ragbits platform. It can be accessed by running the ragbits command in your terminal.

Commands that operate on Ragbits components, such as ragbits vector-store, use the project's preferred component implementations if a component configuration is not explicitly provided. To learn how to set component preferences in your project, see the How-To: Set preferred components in Ragbits project guide.

ragbits#

Common CLI arguments for all ragbits commands.

Usage:

ragbits [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--output, -o choice (text | json) Set the output type (text or json) text
--verbose, -v boolean Print additional information False
--install-completion boolean Install completion for the current shell. None
--show-completion boolean Show completion for the current shell, to copy it or customize the installation. None
--help boolean Show this message and exit. False

Subcommands

  • document-search: Commands for interacting with the document search
  • evaluate: Commands for interacting with ragbits evaluate module
  • prompts: Commands for managing prompts
  • vector-store: Commands for managing vector stores

Commands for interacting with the document search

Usage:

ragbits document-search [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--factory-path text Python path to a function that creates a document search object, in a 'module.submodule:function' format None
--yaml-path path Path to a YAML configuration file for the document search None
--help boolean Show this message and exit. False

Subcommands

  • ingest: Ingest the elements from a given source to vector store.
  • search: Query the chosen vector store.

ragbits document-search ingest#

Ingest the elements from a given source to vector store.

Usage:

ragbits document-search ingest [OPTIONS] SOURCE

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Query the chosen vector store.

Usage:

ragbits document-search search [OPTIONS] QUERY

Options:

Name Type Description Default
--k integer Number of entries to retrieve 5
--columns text Comma-separated list of columns to display, available: id, element_type, key, location, text_representation, document_meta element_type,key
--help boolean Show this message and exit. False

ragbits evaluate#

Commands for interacting with ragbits evaluate module

Usage:

ragbits evaluate [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--target-cls text A path to target class to be evaluated in a format python.path:ModuleName _required
--dataloader-args text Comma separated arguments of dataloader _required
--dataloader-cls text Dataloader class path in a format python.path:ModuleName to override the default None
--target-factory-path text A path to a factory of the target class in format: python.path:function_name None
--target-yaml-path path A path to a YAML configuration file of the target class None
--metrics-factory-path text A path to metrics factory in format python.path:function_name None
--metrics-yaml-path path A path to metrics configuration None
--help boolean Show this message and exit. False

Subcommands

ragbits evaluate run-evaluation#

Evaluate the set-up pipeline.

Usage:

ragbits evaluate run-evaluation [OPTIONS]

Options:

Name Type Description Default
--help boolean Show this message and exit. False

ragbits prompts#

Commands for managing prompts

Usage:

ragbits prompts [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Subcommands

  • exec: Executes a prompt using the specified prompt class and LLM factory.
  • generate-promptfoo-configs: Generates the configuration files for the PromptFoo prompts.
  • lab: Launches the interactive application for listing, rendering, and testing prompts
  • render: Renders a prompt by loading a class from a module and initializing it with a given payload.

ragbits prompts exec#

Executes a prompt using the specified prompt class and LLM factory.

For an example of how to use this command, see the Quickstart guide.

Usage:

ragbits prompts exec [OPTIONS] PROMPT_PATH

Options:

Name Type Description Default
--payload text N/A None
--llm-factory text N/A ragbits.core.llms.factory:simple_litellm_factory
--help boolean Show this message and exit. False

ragbits prompts generate-promptfoo-configs#

Generates the configuration files for the PromptFoo prompts.

For more information, see the Promptfoo integration documentation.

Usage:

ragbits prompts generate-promptfoo-configs [OPTIONS]

Options:

Name Type Description Default
--file-pattern text N/A **/prompt_*.py
--root-path path N/A /__w/ragbits/ragbits
--target-path path N/A promptfooconfigs
--help boolean Show this message and exit. False

ragbits prompts lab#

Launches the interactive application for listing, rendering, and testing prompts defined within the current project.

For more information, see the Prompts Lab documentation.

Usage:

ragbits prompts lab [OPTIONS]

Options:

Name Type Description Default
--file-pattern text N/A **/prompt_*.py
--llm-factory text N/A ragbits.core.llms.factory:simple_litellm_factory
--help boolean Show this message and exit. False

ragbits prompts render#

Renders a prompt by loading a class from a module and initializing it with a given payload.

Usage:

ragbits prompts render [OPTIONS] PROMPT_PATH

Options:

Name Type Description Default
--payload text N/A None
--help boolean Show this message and exit. False

ragbits vector-store#

Commands for managing vector stores

Usage:

ragbits vector-store [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--factory-path text Python path to a function that creates a vector store, in a 'module.submodule:function' format None
--yaml-path path Path to a YAML configuration file for the vector store None
--help boolean Show this message and exit. False

Subcommands

  • list: List all objects in the chosen vector store.
  • query: Query the chosen vector store.
  • remove: Remove objects from the chosen vector store.

ragbits vector-store list#

List all objects in the chosen vector store.

Usage:

ragbits vector-store list [OPTIONS]

Options:

Name Type Description Default
--limit integer Maximum number of entries to list 10
--offset integer How many entries to skip 0
--columns text Comma-separated list of columns to display, aviailable: id, text, image_bytes, metadata id,text,metadata
--help boolean Show this message and exit. False

ragbits vector-store query#

Query the chosen vector store.

Usage:

ragbits vector-store query [OPTIONS] TEXT

Options:

Name Type Description Default
--k integer Number of entries to retrieve 5
--max-distance float Maximum distance to the query vector None
--columns text Comma-separated list of columns to display, aviailable: score, entry.id, entry.text, entry.image_bytes, entry.metadata score,entry.id,entry.text,entry.metadata
--help boolean Show this message and exit. False

ragbits vector-store remove#

Remove objects from the chosen vector store.

Usage:

ragbits vector-store remove [OPTIONS] IDS...

Options:

Name Type Description Default
--help boolean Show this message and exit. False