Repository navigation
[SheetBase RAG] Keyword retrieval over any public Google Sheet — on-device, no API key #1562
CharlesMagicDev
started this conversation in
Skills
Replies: 1 comment
|
Two fixes pushed after real-world use (a price list pasted as raw CSV into a single column):
Verified against the hosted URL: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Skill Webhost Path
https://charlesmagicdev.github.io/ai-edge-gallery-sheetbase/skills/sheetbase-rag
Skill Source Repository
https://github.com/CharlesMagicDev/ai-edge-gallery-sheetbase
Skill Description
SheetBase RAG — query a spreadsheet you already own, without leaving the chat.
Most on-device demos stop at the model. The data people actually need usually sits in a spreadsheet: a client list, a stock sheet, a roster, a price grid. SheetBase RAG lets Gemma read one directly — no API key, no OAuth consent screen, no backend, no vector database, no build step.
How it works
skills/sheetbase-rag/SKILL.md— strict YAML frontmatter (name,description) so the model can select it, then the instructions it follows: the exact JSON to send, the fields to read back, how to cite results, what to say when nothing matches.skills/sheetbase-rag/scripts/index.html— Vanilla JavaScript exposing the single contract the app calls:Nothing runs at load — the WebView is hidden, and only the call triggers work.
dataarrives as a JSON string (the script also tolerates an object or a bare URL), and the function always returns a JSON string, never an object.What happens on a call
sheetUrlis reduced to a spreadsheet key +gid(a published/d/e/…/pubhtmllink and a bare id also work).gviz/tq?tqx=out:csvfirst, thenexport?format=csv, then the published link. The gviz JSON wrapper (/*O_o*/ google.visualization…) and HTML error pages are rejected instead of being parsed into nonsense.Dùpontis found bydupont), over every column or only the ones you name.D14) plus the column name — so the model can say "change D14", not "somewhere in the middle".The result is a compact text summary sized for small context windows, plus structured
rowsfor programmatic use. Nothing is capped by default:limit,maxLength,columns,gidandtimeoutMsare opt-in, so a huge sheet does not silently lose rows.Import it on your phone
SKILL.mdsuffix, so GitHub Pages servesindex.htmlwith thetext/htmlMIME type the WebView needs:"In https://docs.google.com/spreadsheets/d/…/edit, find every row with Montpellier and give me the cell references."
Honest limits
Tested in headless Chromium against the hosted URL, calling the function exactly the way the app does: real public sheet (30 rows, range
A1:F31, cellA2returned for "alexandra"), accented matches, empty keyword,limit+maxLength, a private sheet (403 → actionable error message), and CSV edge cases"Dupont, Jean"/"Client ""fidèle""". No JS errors.Feedback very welcome — especially from anyone running it on iOS, and on which spreadsheet shapes break first. Built by Charles Lepoittevin (independent developer).
All reactions