random_memory
The serendipity tool. No query, no ranking, no recency bias — just a random memory from the pool, filtered however you like.
Parameters #
| Parameter | Type | Required | Description |
|---|---|---|---|
labels | string | No | Label filter (substring-matched, supports ! exclusion) |
source | string | No | Source filter (substring-matched, supports ! exclusion) |
With no parameters, returns a completely random memory from the entire namespace.
Examples #
# Completely random
random_memory()
# Random memory on a specific topic
random_memory(labels: "architecture")
# Random memory from a specific agent
random_memory(source: "agent:sonnet:main")
# Random memory NOT from a specific source
random_memory(source: "!agent:sonnet:main")
Power Combinations #
Explore the edges — filter OUT the dominant source to discover what others stored:
random_memory(source: "!claude,!cline")
Useful in multi-agent setups where one agent dominates the memory pool — this surfaces what the others contributed.
Tangent engine — include in an agent’s instructions to occasionally surface unexpected context. Pairs well with a low-probability trigger (“if the conversation feels stuck, call random_memory and see where it leads”).
Audit by exclusion — random sampling of memories from a specific label while excluding noise:
random_memory(labels: "milestone,!draft")