Skip to main content

Simple templating and web-source retrieval utilities for RAG.

Project description

TRAG

trag is glue intended for use with (in particular) fvdb for retreival and hyjinx.llm for generation. But, it's abstract enough for other uses.

  • Get sources from a url, youtube, arxiv, wikipedia and produce markdown strings.
  • A very simple templating system, for when jinja is overkill.

trag does not specify or require any particular LLM or vector database solutions.

Templating

Example usage, uses standard summary.toml template:

(require trag.template [deftemplate])

(deftemplate summary)

(summary "bullet" :text "Here is some text. The main points involve a cat, a dog and an ambulance. The shop closed for lack of stock.")

;; and so on

Web sources

Example usage:

(import trag [web])

(web.arxiv "Retrieval-augmented generation" :n 3)
(web.youtube "dQw4w9WgXcQ")
(web.wikipedia "Retrieval-augmented generation")
(web.url "https://www.gutenberg.org/cache/epub/11/pg11.txt")

Command-line usage

Proceeds similarly,

$ trag --help

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

trag-0.0.2.tar.gz (45.2 kB view details)

Uploaded Source

Built Distribution

trag-0.0.2-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file trag-0.0.2.tar.gz.

File metadata

  • Download URL: trag-0.0.2.tar.gz
  • Upload date:
  • Size: 45.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for trag-0.0.2.tar.gz
Algorithm Hash digest
SHA256 fa04b7edeed28ee7ad458927565113be173b629f453b3e3c85e5a68f89202f13
MD5 d979d68f858535c609e5079925ccef17
BLAKE2b-256 617e985f3c312b8a43c3ebc7eae3d09b106aee9a470773c980bd9cb40f8c7dbc

See more details on using hashes here.

File details

Details for the file trag-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: trag-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 34.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for trag-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ae2c769b63b075a71974711643963accaf8d9c7fd725e8459b4fd2a32653603d
MD5 26a067a50d16988574a16749631852a6
BLAKE2b-256 2259166ae5a57aa59fbec992b4e236cd1655a432e86cbeccdf1a1c4047bc4147

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