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

Uploaded Source

Built Distribution

trag-0.0.3-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trag-0.0.3.tar.gz
  • Upload date:
  • Size: 45.4 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.3.tar.gz
Algorithm Hash digest
SHA256 e789c1422e3e1de06608a2155bacfd1e5664b431b3ae66532c2acc39a9366a74
MD5 04ceffe0ad127dfbc4267cec7b6bbe88
BLAKE2b-256 8daefe144eb3545828ecd8f38fd295faed62edc25f07d3a2f485ad034e110c8c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trag-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 34.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8a2005d97c9090dc92afd830c472831fbedf58beb53c3e98ba0f102866cd0700
MD5 35f819c3f8d1876f46b06794ac62b7eb
BLAKE2b-256 a6ede64c33281c771daec443ebf0764f774968c7c7bbc157be71d3f9c5edadf3

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