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.3.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: rag_cli-0.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 d8ac937b22fdf55b79acbf051ff2886123de932c9fe2e40d73ecf10f7a2b375e
MD5 421e7bc3200abaeac80e6007fb625eed
BLAKE2b-256 e8acad7e6c57b17a6c6ee2bddc027cca6291bf91b5007c5ca377aa2e689b0e95

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rag_cli-0.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 72ed7dc9cc0ee53dfe56c53fce3b419fa03dbaf7f5973b71343d05276117323e
MD5 6c61d95e757e7dde8b62da87bd317b78
BLAKE2b-256 e95ba10ea0026b0626eb750e29a6d71c59aef1e211d2ce3a55167230aaeee49e

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