Skip to main content

CLI tool to help retrieve RAG context from a corpus of documents.

Project description

RAG Stash

Perform RAG flexibly and easily with an LLM of your choice

About

Ragstash is a CLI utility to help retrieve RAG (Retrieval Augmented Generation) context from your documents which can then be fed into an LLM of your choice.

Installation

recommended:

pipx install ragstash or uv tool install ragstash

You should then have ragstash command available.

Usage

First, cd into your documents folder, then:

  1. Use ragstash init . to initialize (processes documents, generates embeddings, and saves vector db)
  2. Use ragstash serve . to start the server used for querying
  3. (In a separate terminal) Use ragstash get YOUR_QUERY to print out the RAG context. This output can be piped (|) into an LLM or saved in a file.

Example Usage

Simple:

> cd path/to/your/documents
> ragstash init .
> ragstash serve .

# In another terminal
> ragstash get "What do the leaked files say about the doings of Celebrity Celebface?" | claude

Advanced:

> cd path/to/your/documents
> ragstash init . \
  --sentence-transformer "sentence-transformers/all-MiniLM-L6-v2" \
  --chunk-size 1000 \
  --name "LargeChunks"
> ragstash serve . --name "LargeChunks"

# In another terminal
> ragstash get "What do the leaked files say about the doings of Celebrity Celebface?" \
  --retrieval-query "Things Celebrity Celebface has done" \
  --chunks 10 \
  --message "I am doing RAG, here are some chunks of info ^^" \
  | claude

Options

> init PTH
    --sentence-transformer  # model to use for embedding of chunks
    --chunk-size            # size of chunks (chars)
    --chunk-overlap         # overlap of chunks (chars)
    --redo                  # overwrite existing vault
    --name                  # name to give initialization (appended to folder name: ".rag_{NAME}")

> serve PTH
    --name                  # which initialization to use
    --unload-timeout        # time after which sentence transformer mode unloads (0 means never unloads)
    --port

> get YOUR_QUERY
    --chunks                # number of chunks to fetch
    --retrieval-query       # query to use when doing "dumb" retrieval of data (given to sentence transformer)
    --message               # message to give LLM
    --port                  # port to fetch
    --ip-addr               # default `localhost`
    --chunks-as-json        # instead of getting RAG formatted message, get retireved chunks as json
    --file                  # file where to save retrieved context

> update PTH
    --name                  # name of vault

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragstash-0.1.3.tar.gz (165.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragstash-0.1.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file ragstash-0.1.3.tar.gz.

File metadata

  • Download URL: ragstash-0.1.3.tar.gz
  • Upload date:
  • Size: 165.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ragstash-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7110702588cf0c0be1cdadbe55d46051d9df5c23218b7306ac67a83405b13e58
MD5 be5029756ef67d11d4ebef6fdc818913
BLAKE2b-256 20e7914c4e4cc466aa1e9dfc4719b3f87df7dc07b642bb1ead90e86728c3b991

See more details on using hashes here.

File details

Details for the file ragstash-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ragstash-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ragstash-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0beecee5b4cda2dd8a857f2e6583c74791f137acbc5a73e4bfd91b2ddb6fa638
MD5 842f4331e1143660911aaf11b057d6a4
BLAKE2b-256 e83fc7a15f87a59f56df06c895752b6c5de599a81c1cd6ae908cb28d349eb3d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page