calibrate_threshold
Auto-calibrates vector search threshold by analyzing random memory pairs and setting a statistical cutoff, adapting to embedding model and corpus without requiring labeled data.
Instructions
Auto-calibrate vector search threshold using null distribution z-score. Samples random memory pairs, computes cosine distribution, sets threshold at mean + z*std. No labels used, purely statistical. Adapts to both embedding model and corpus characteristics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Agent ID whose memories to sample | |
| sample_size | No | Number of embeddings to sample (default: 200) | |
| z_factor | No | Z-score multiplier (default: 1.0, higher = stricter) |