find_invariants
Detect recurring assistant response patterns that persist across varied user prompts, revealing stable behaviors and invariant strategies in conversation history.
Instructions
Find recurring assistant-side patterns that survive prompt variance.
Algorithm:
Pull recent assistant messages from dialog_messages (with embeddings).
Greedy cluster by response embedding cosine ≥ response_cohesion.
For each cluster (size ≥ min_cluster_size), find each response's immediately-preceding user prompt in the same conversation.
Score = avg_response_similarity × (1 - avg_prompt_similarity). High = my response stays the same shape while prompts vary widely.
Returns top_n clusters with sample response, scores, and counts. Requires semantic embeddings (sentence-transformers) — without them returns ERR.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "find_invariants"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | ||
| window_days | No | ||
| max_messages | No | ||
| min_cluster_size | No | ||
| response_cohesion | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |