trending_labels
The pulse of your memory namespace. Returns labels that reflect what’s been discussed recently — not what’s been stored the most overall, but what’s been active within the time window you choose.
Parameters #
| Parameter | Type | Required | Description |
|---|---|---|---|
days | number | No | Time window for considering token activity (default: 30) |
limit | number | No | Maximum trending labels to return (default: 10) |
How It Works #
Trending uses a two-stage algorithm:
Token activity — label tokens are tracked with a synaptic decay model. Heavily-used topics stay relevant longer; rarely-used tokens fade quickly. This mirrors how neural pathways strengthen with use — the more a topic appears in recent memory activity, the stronger its signal.
Label resolution — hot tokens are fuzzy-matched against actual labels on current memories, returning the real labels rather than raw tokens.
Numbers and dates are intentionally excluded from trending — they score into the token table but never surface as results. Only semantic content trends.
The days window makes a significant difference — a 7-day window reflects very recent focus, while 30 days shows longer-running themes. Choose based on how “current” you want the signal to be.
Response #
Each result includes:
| Field | Description |
|---|---|
label | The full label as stored on memories |
count | Activity count within the time window |
top_token | The dominant token that matched this label |
Examples #
# Default — top 10 trending over 30 days
trending_labels()
# Recent focus — last 7 days only
trending_labels(days: 7, limit: 10)
# Broad view — top 20 over 90 days
trending_labels(days: 90, limit: 20)
Power Combinations #
L3 wake-up seed — extract top_token values from results, deduplicate, and use as label seeds for retrieve_memories. This surfaces thematically relevant recent memories without needing a semantic query:
trending_labels(days: 7, limit: 10)
→ top_tokens: ["memory", "plugin", "system", "management"]
→ retrieve_memories(labels: "memory,plugin,system,management", num_results: 5)
This is the foundation of the OpenClaw plugin’s L3 wake-up system.
Topic drift detection — compare trending_labels(days: 7) against trending_labels(days: 30). Topics in the 7-day window but absent from 30-day are newly emerging; topics in 30-day but absent from 7-day are fading.
Enrichment health check — if trending_labels returns few or no results, the label enrichment cron may be behind. Check memory_stats(labels: "nonce") to see the backlog size.