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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: trag-0.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 df0015ed996c63cb949a0aee8f34ede0d32a0c15a8cf83c6753e0415baa0b014
MD5 525ffe8c5dd6368c437c0c4536e84f7a
BLAKE2b-256 951717ae79281d5c54331cf2a56941578e1e9066ba5d4802897adadfad0d9881

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trag-0.0.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 032f2383ff1c8c98fd777177aec5b56b09ff52dd28900263d059d9ccc2bf481d
MD5 8928c2fcb51b9e5b5b28a67358e35e69
BLAKE2b-256 f23c6d0a7c455c6782a0a3d2262e15b9b2a06d4f4d54ddbd9c424ce1b3eac9ee

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