pxt.Document column takes a URL as readily as a local path. Insert the URL and Pixeltable
fetches and parses the page, so there is no separate scraping step to keep in sync with the table.
Insert the URL
Chunk it, two ways
The chunking strategy decides what a retrieval hit looks like, so it is worth seeing the difference before committing to one. A view per strategy, over the same table:paragraph follows the document’s own structure, so a chunk is a complete thought and a retrieval
hit reads as prose. Chunk length is whatever the author wrote, which on a page with one-line
paragraphs produces chunks too small to carry context. char_limit gives you predictable sizes and
predictable embedding cost, and cuts mid-sentence.
Valid separators are heading, paragraph, sentence, token_limit, char_limit, and page.
Combine them with a comma, most structural first:
Make it searchable
Declare an index on the chunk text and query it withsimilarity():
Notes
- Insert several URLs and every view and index below the table extends to them. There is no per-page bookkeeping.
sentence_transformerneedspip install sentence-transformers, and downloads the model on first use.pxt.create_table(),create_view(), andadd_embedding_index()are the notebook and test form. An application declares the tables and views on aTableModelinapp.py, puts the index in__indexes__, and creates them withpxt schema update.