The five tools
| Tool | Purpose |
|---|---|
| track | Upsert one or many points on (metric, ts). Returns written (new timestamps) and replaced (updated timestamps). |
| forget | Delete a single ts, an inclusive from/to range (Unix seconds), or the whole metric with all: true plus confirm: true. metric is always required. |
| query | Terse stats (s.l, s.mn, s.tr, …) plus optional LTTB pts within token_budget. points: 0 | auto | N; also_chart omits pts for a follow-up chart. |
| insight | Plain-English trend, MAD anomalies, naive linear forecast for metric + range. |
| chart | 640×320 SVG on disk (or hosted share URL when synced). type, theme, labels set chart rendering; range filters data. share:false skips public /c/<id> link. |
When to track
Do track when
- The user will ask again about this number or series.
- The value is part of a time series (daily MRR, weight, fleet count).
- Fetching it is slow, rate-limited, or expensive.
- You already researched a public series once and want recall without repeating work.
Do not track when
- One-off values with no future chart intent.
- Secrets (API keys) or PII you would not write to a local debug log.
- User wants a live reading every time — track only after fetch if they also want history.
Naming: health.weight.lb, stripe.mrr.usd, geo.plano_tx.population. Use tags for dimensions, not the primary unit string.
Upsert and corrections
Storage enforces UNIQUE(metric, ts). Same metric + same ts again replaces value/tags and increments replaced.
| Action | Result |
|---|---|
| track with value only | Upsert at current Unix time (seconds) |
| track with points[] | Upsert per point; missing ts → current time |
| Same metric + same ts again | Replace value/tags; replaced += 1 |
| Response | written (new) + replaced (updated) |
forget
Deletions are permanent on local SQLite and on hosted storage after sync — there is no undo.
| Mode | Arguments |
|---|---|
| Single point | metric + ts |
| Range (inclusive) | metric + from + to (Unix seconds) |
| Entire metric | metric + all: true + confirm: true |
forget entire metric
{
"metric": "health.weight.lb",
"all": true,
"confirm": true
}query vs insight vs chart
Decision
Need numbers only, token-shaped? → query
Need spoken summary + anomalies? → insight
Need a file the human opens? → chartquery — default token_budget 500; points 0 | auto | N; also_chart omits pts before chart. chart defaults: type=line, theme=dark, labels=last. Efficient combo: query(..., also_chart: true) then chart(...).
Freshness
| Situation | Guidance |
|---|---|
| Historical analysis | Trust stored data |
| What is MRR right now? | Re-fetch source, then optionally track |
| Public series never tracked | One fetch + backfill track, then query/chart from store |
Token cost guidance
- Prefer query with points: 0 or also_chart over pasting large JSON in chat.
- Set token_budget to match spare context (200–300 for dashboard answers).
- chart returns metadata — local
pathor hostedurl/embed_svgwhen synced.
Compare approaches in benchmarks/token-benchmark/.
More reading
Source on GitHub: casahome2000/graphmyanything / agent-guide.md