Repository navigation
LocalBase — an on-device table database the agent can create, fill and edit #1563
CharlesMagicDev
started this conversation in
Skills
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
Skill Webhost Path
https://charlesmagicdev.github.io/ai-edge-gallery-sheetbase/skills/localbase
Skill Source Repository
https://github.com/CharlesMagicDev/ai-edge-gallery-sheetbase
What it is, in one paragraph
A skill that gives the model a notebook with tables, stored on the phone. You say "note ce client : Dupont, Montpellier, 06…" and the row is written. Close the app, open it next week, ask "quels clients j'ai à Montpellier ?" — the row is still there. No account, no API key, no backend, no sync, nothing leaving the device.
Most skills are read-only: they fetch something and the model narrates it. This one is the other half — the model can write, read back, correct and delete.
The idea in 30 seconds
An Agent Skill is just a web page the app loads in a hidden WebView and calls through one function:
A web page in a WebView has
localStorage— and in Gallery it is persistent (details below). So the page can hold a small database:clients,Nom,Ville,Téléphone)_id(#7)_id, never by position, so a deletion never shifts what it is about to edit.Use cases — what it is actually good for
Each of these is one sentence in the chat; the model turns it into calls.
1. Client / prospect book — "Ajoute Dupont à Montpellier, intéressé par un devis, à rappeler mardi."
Columns: Nom, Ville, Téléphone, Statut, Prochaine action. Then: "qui je dois rappeler cette semaine ?"
2. Job site tracking — "Ouvre un suivi de chantier : lot, date, avancement, réserve."
Then, day after day: "le lot 3 est à 60 %, deux réserves sur la façade." One table, no spreadsheet to open.
3. Quotes and invoices — "Note le devis 2026-014, client Martin, 4 250 €, envoyé le 12."
Then: "quels devis sont sans réponse depuis plus de 15 jours ?" — the follow-up list writes itself.
4. Equipment inventory — "Inventaire : nom, quantité, état, emplacement."
"Il reste combien de projecteurs en état ?" Useful when the same screwdriver exists in three vans.
5. Reading / idea log — "Note cette idée : base locale dans l'app, à creuser côté quota."
Then a weekly review: "montre-moi les idées non traitées."
6. Admin follow-up — "Démarche : DUNS, échéance 30/11, pièce manquante : justificatif d'adresse."
The kind of thing that lives in a note and gets lost.
None of these need a server. All of them need the data to still be there tomorrow — which is the whole point.
A conversation, turn by turn
You: "Crée une table clients avec Nom, Ville, Téléphone, et ajoute Dupont à Montpellier et Martin à Nîmes."
The model makes two calls (it is allowed one action per call):
{"action":"create","table":"clients","columns":["Nom","Ville","Téléphone"]}→
Table « clients » créée : colonnes Nom | Ville | Téléphone. 0 ligne.{"action":"insert","table":"clients","rows":[ {"Nom":"Dupont","Ville":"Montpellier","Téléphone":"0600000001"}, {"Nom":"Martin","Ville":"Nîmes","Téléphone":"0600000002"}]}→
2 ligne(s) ajoutée(s) dans « clients » (total 2).1. #1 · Nom = Dupont | Ville = Montpellier | Téléphone = 06000000012. #2 · Nom = Martin | Ville = Nîmes | Téléphone = 0600000002You (next week, new conversation): "Quels clients j'ai à Montpellier ?"
{"action":"query","table":"clients","keyword":"montpellier"}→
Recherche « montpellier » — 1 ligne(s).1. #1 · Nom = Dupont | Ville = Montpellier | Téléphone = 0600000001You: "Dupont a changé de numéro : 0700000009."
{"action":"update","table":"clients","id":1,"values":{"Téléphone":"0700000009"}}→
Ligne #1 mise à jour (Téléphone) : 1. #1 · Nom = Dupont | Ville = Montpellier | Téléphone = 0700000009That is the whole loop: create → fill → search → correct. Everything else (
delete,drop,export,import,reset) is the same shape.The actions
schemacreatetable,columns:[…]ifNotExists:truetolerates an existing one)inserttable,rows:[{…}]idsquerytable,keyword, optionalcolumns,limitupdatetable,id,values:{…}deletetable,iddroptable,confirm:trueexportimportjson,confirm:trueresetconfirm:trueWhy this works in Gallery — the platform detail worth sharing
GalleryWebView.ktsetssettings.domStorageEnabled = true.https://appassets.androidplatform.net/skills/….localStoragesurvives betweenrun_jscalls, across theabout:blankthe app loads between calls, and across app restarts.Verified end to end: create → insert → query → update → delete, then a full browser restart on the same profile — table, rows, edit and deletion all intact.
Design choices worth arguing about
_idper row, soupdate/deletenever depend on a position that shifts after a deletion.confirm:trueon destructive actions, so the model has to come back and ask before wiping a table.localStoragekey (localbase.v1) holding the whole database as JSON, rewritten on each write, guarded at 4 MB.1. #2 · Nom = Dupont | Ville = Montpellier; an empty keyword lists 10 rows instead of everything.Import it on your phone
SKILL.mdsuffix, so GitHub Pages servesindex.htmlastext/html:Honest limits
export/dropas the way out. Fine for tens of thousands of short rows, not for files.exportreturns the database as JSON andimportrestores it — round-trip tested.SKILL.mdis deliberately short and starts with "callschemafirst".Tested
Headless Chromium from the hosted URL, calling the function the way the app does: CRUD end to end, persistence across a browser restart on the same profile,
export→reset→importround-trip, plus the error paths (unknown column with the available columns listed, unknown id,dropwithoutconfirm, non-JSONdata) — all actionable messages, no JS exception.Feedback welcome — especially from iOS, since I could only verify the Android source, and from anyone who hits the storage ceiling first. Built by Charles Lepoittevin (independent developer).
All reactions