Skip to main content

A project to show good CLI practices with a fully fledged RAG system.

Project description

RAG CLI

A project to show good CLI practices with a fully fledged RAG system.

Python version PyPI version GNU GPL

RAG CLI

Installation

pip install rag-cli

Commands

sudo apt-get update && sudo apt-get install parallel jq curl
mkdir -p data/articles data/embeddings

Get Wikipedia articles

parallel -n0 -j 10 '
curl -L -s "https://en.wikipedia.org/api/rest_v1/page/random/summary" | \
jq -r ".title, .description, .extract" | \
tee data/articles/$(cat /proc/sys/kernel/random/uuid).txt 1> /dev/null
' ::: {0..10}

Run embeder

parallel '
rag-cli embed --ollama-url http://localhost:11434 --file {1} 2>> output.log | \
jq ".embedding" | \
tee data/embeddings/$(basename {1} .txt) 1> /dev/null
' ::: $(find data/articles/*.txt)

Vector store

parallel rag-cli vector-store --qdrant-url http://localhost:6333 --collection-name nomic-embed-text-v1.5 2>> output.log ::: $(find data/embeddings/*)

Complete pipeline for single article

curl -L -s "https://en.wikipedia.org/api/rest_v1/page/random/summary" | \
jq -r ".title, .description, .extract" | \
rag-cli embed --ollama-url http://localhost:11434 2>> output.log | \
jq ".embedding" | \
rag-cli vector-store --qdrant-url http://localhost:6333 --collection-name nomic-embed-text-v1.5 2>> output.log

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

rag_cli-0.2.2.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

rag_cli-0.2.2-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file rag_cli-0.2.2.tar.gz.

File metadata

  • Download URL: rag_cli-0.2.2.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for rag_cli-0.2.2.tar.gz
Algorithm Hash digest
SHA256 0876b794b7090dd9406b68723581b610a352c213e71c264800dcd4db010ad358
MD5 ce0b3837852bc5188ed4a863874f28bd
BLAKE2b-256 c86046ca282fd568261290d173685f3977fe45e6f2cc71c990c83698e0bc7d2c

See more details on using hashes here.

File details

Details for the file rag_cli-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: rag_cli-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for rag_cli-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04d492e281b78acaba70f767e8f64b63a477e97736bd0e6bd2ca7404da3bd0bb
MD5 8a7feb68e1274678005b53b117800793
BLAKE2b-256 d8e6e71b811305e9f105fdab37e2a3305e7b2811b063e3b6db6c3e22e5f820fa

See more details on using hashes here.

Supported by

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