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 [retrieve])
(retrieve.arxiv "Retrieval-augmented generation" :n 3)
(retrieve.youtube "dQw4w9WgXcQ")
(retrieve.wikipedia "Retrieval-augmented generation")
(retrieve.url "https://www.gutenberg.org/cache/epub/11/pg11.txt")
Command-line usage
Proceeds similarly,
$ trag --help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trag-0.0.15.tar.gz.
File metadata
- Download URL: trag-0.0.15.tar.gz
- Upload date:
- Size: 45.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
206368bf04b7a6698cc15a52f9205a247f400f112db41d8b4ab87fc034e32ec2
|
|
| MD5 |
a047fed1d03c47e7699b9d655b5eb527
|
|
| BLAKE2b-256 |
573829e96e0b0b9389ea6ea462ef6c70e8f85f7b747af2ce97510162f5d78967
|
File details
Details for the file trag-0.0.15-py3-none-any.whl.
File metadata
- Download URL: trag-0.0.15-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e49ecb10264314d23d221e06a28fa4b10e03ac60528fab346c3d8ddc7168c7b5
|
|
| MD5 |
c070da26ac7fb487d8e9c777f44400be
|
|
| BLAKE2b-256 |
1d0628c1a51bdd43a2c3fb20514f3cf35e68b7b2928c1ab4cae01f0fee4c7bf0
|