Skip to main content

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. It is a simple tool meant to be integrated into your RAG workflow. You could even ask a local LLM (that you trust) to fetch RAG context by using the tool itself while a server is running.

Installation

Available on PyPI

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 <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

Upcoming features

  • update mode so that you can add or update documents and only scan the changes.

Metadata

Release files for ragstash 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ragstash 0.1.4
File Size Uploaded
ragstash-0.1.4.tar.gz 166.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ragstash 0.1.4
File Interpreter ABI Platform
ragstash-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 175.1 kB

Release files / ragstash-0.1.4.tar.gz

Download URL ragstash-0.1.4.tar.gz
Size 166.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b6199d7ce6541cd8be08bc8003da6a75e9a480e3b372b2252a4865e475841dbf
BLAKE2b-256 checksum
How to use checksums
061cee1b3fa0de18b513d991796abe490726a73ff8c51d923a2dcb503a39f198
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / ragstash-0.1.4-py3-none-any.whl

Download URL ragstash-0.1.4-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15239f2982d44776f5670b5174e4cd088b2c48e1ed20421b169b38d72b5b18c3
BLAKE2b-256 checksum
How to use checksums
914c2cbc3143db0ae1576b9498aba01ceef4f0c755ce10451fc5e2fb53ce4b2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page