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

Alternatives

If you like hippos, you might be interested in chonkie.

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

Uploaded Source

Built Distribution

trag-0.0.12-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for trag-0.0.12.tar.gz
Algorithm Hash digest
SHA256 147bb1c5bc75df2b9502ddc3f2e93ef1d7410f7fe57971a891a78e4a24a0f2af
MD5 6324d9e884c4ea7d83aa78db57852bff
BLAKE2b-256 ce68fda00a75da4a73bc33c8225e88d9ed37a0f50280498b11786733f246f378

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for trag-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 96406067a95d702010b594ce65c5bd24691bb5bb4502215cfd2d45f992818628
MD5 bbc272a2972a9a5067b85170e95eba96
BLAKE2b-256 043fcf9b43ecc7cb5fd6537ddb09f3388c5129d47a6d534b9f92f7ac7e41fb88

See more details on using hashes here.

Supported by

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