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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: trag-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 d672840125d74704ee8fe595820a2b50f71d577865bd5f5cfebc5cf01c810495
MD5 55db307ec40d52b1b2758dbc01e7f7c9
BLAKE2b-256 234ca4fde83c0e54b4e677ea29aa005899aaa66b76c2d1d5999eaf926a52ce5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trag-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 36d0a54ed6eaf0b32139563229621b9879220a587217ac85c47ddc655105de54
MD5 baef48f30a82a9c8dafa41d52c319adf
BLAKE2b-256 c32a42ed631da0f9f1c2291c799e6ad89f3fd7f0a30027f277201822b0e9cbd3

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