Wine Archive
by @sidvorak
Store, recall, and manage personal wine tastings and labels using natural language queries with durable image storage in a local SQLite database.
clawhub install wine-archiveπ About This Skill
Wine Archive
Personal wine archive for tasting history, label storage, and natural-language recall. Stores wines in a local SQLite database with a normalized schema: stable wine identities plus individual tasting/purchase instances. Integrates with Telegram via the OpenClaw bridge.
Trigger phrases
Use this skill when the user says things like:
Setup (first time)
cd skills/wine-archive
zsh setup.sh
Or manually:
cd skills/wine-archive
npm install
npm run wine:init
cp .env.example .env # add ANTHROPIC_API_KEY for LLM features
Data is stored in data/wine/wine.sqlite3 and label images in data/wine/labels/.
Override the DB location with WINE_DB_PATH env var.
Core rules
MEDIA: text.Data model
Wine = stable identity
Wine instance = specific bottle / tasting event
Commands
Initialize DB:
npm run wine:init
Add from free text:
npm run wine:add -- --text "Had a Broadbent Vinho Verde from Minho. Bought at Nugget for $14. Rated 4/5."
Add structured:
npm run wine:add -- --wine_name "Broadbent Vinho Verde" --varietal "Loureiro" --region "Minho" \
--style "vino verde" --color "white" --price 14 --place_of_purchase "Nugget" --consumed_on 2026-03-29
Add from label text + image:
npm run wine:add -- --label-text $'Broadbent\nVinho Verde\n2024\nMinho Portugal\nLoureiro' \
--image data/wine/labels/broadbent.jpg
Parse label without inserting:
npm run wine:parse-label -- --label-text $'Broadbent\nVinho Verde\n2024\nMinho Portugal'
Query:
npm run wine:query -- --text "vinho verde"
npm run wine:query -- --varietal "Pinot Noir"
npm run wine:query -- --consumed_after 2026-03-24 --consumed_before 2026-03-31
Natural-language recall:
npm run wine:recall -- --text "show me wines from last week at Nugget"
npm run wine:recall -- --text "what pinot noir did I drink last month"
npm run wine:recall -- --text "find red wines rated at least 3"
Chat-facing flow (intent detection + dispatch):
npm run wine:chat -- --text "Remember this wine: Had a vinho verde last week. Rated 4/5."
npm run wine:chat -- --text "What was that vinho verde I had last week?"
npm run wine:chat -- --label-text $'Broadbent\nVinho Verde\n2024\nMinho' --image data/wine/labels/broadbent.jpg
List recent entries:
npm run wine:list -- --limit 10
Remove an entry:
npm run wine:remove -- --id 42
Export archive:
npm run wine:export -- --out my-wines.json # paths only
npm run wine:export -- --out my-wines.json --include-images # embed label images as base64
Import archive:
npm run wine:import -- --in my-wines.json --dry-run # preview only
npm run wine:import -- --in my-wines.json # import
Telegram bridge (requires OpenClaw)
The bridge script resolves the wine chat request and outputs a structured JSON result.
When action === "send-media", the agent sends the media using the openclaw CLI.
npm run wine:telegram-bridge -- --text "Show me the Vinho Verde label"
Example output when a label is found:
{
"status": "ok",
"action": "send-media",
"reply": "Broadbent Vinho Verde label",
"mediaPath": "./data/wine/labels/broadbent-abc123.jpg",
"caption": "Vinho Verde label"
}
The agent then sends:
openclaw message send --channel telegram \
--target --thread-id --reply-to \
--media --message
Shell helper (outputs JSON for the agent):
zsh scripts/wine-send-label-telegram.sh Vinho Verde
Response templates
Add / save confirmation
Added as a new wine instance:
Broadbent Vinho Verde Β· 2024
Nugget, $14.00 Β· consumed 2026-03-29
rated 4/5
Update confirmation
Updated β rating: 3.5/5, consumed_on: 2026-04-02
Show a wine (canonical entry)
Broadbent β Vinho Verde
region: Minho
country: Portugal
style: vino verde
color: white
varietal: Loureiro
[label image]
Show wine instances
Broadbent β Vinho Verde (2024)
consumed: 2026-03-29
rated: 4/5
notes: crisp, slightly frizzante
Show a list of wines
- Vinho Verde
producer: Broadbent
year: 2024
varietal: Loureiro
style: vino verde
Recall by time window
Broadbent β Vinho Verde (2024)
consumed: 2026-03-29
rated: 4/5
Label response
Send the archived image with caption:Vinho Verde labelClarification (ambiguous intent)
Do you want me to update the existing instance or create a new tasting instance?
Environment variables
| Variable | Default | Description |
|---|---|---|
| ANTHROPIC_API_KEY | β | Required when using an Anthropic model for LLM intent classification |
| OPENAI_API_KEY | β | Required when using an OpenAI model for LLM intent classification |
| WINE_DB_PATH | data/wine/wine.sqlite3 | Override DB location |
| WINE_LLM_INTENT_CLASSIFIER | 0 | Set to 1 to enable LLM intent classification (off by default; skill works fully offline without it) |
| WINE_LLM_INTENT_MODEL | openai/gpt-4.1-mini | Model for intent classification β use claude-haiku-4 for Anthropic, openai/gpt-4.1-mini for OpenAI |
| WINE_LLM_INTENT_MIN_CONFIDENCE | 0.65 | Minimum confidence to use LLM over regex |
Platform notes
sips.lib/wine-store.js normalizeImageInPlace for cross-platform resizing).
node:sqlite built-in used in shared/interaction-store.js).