MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / similarity

Function similarity

src/dashboard/memory_api.rs:371–381  ·  view source on GitHub ↗

`GET /api/plugins/holographic/similarity` — pairwise phase-cosine similarity (`mean(cos(p_i − p_j))`) over all vectored facts. `min_similarity` is the single floor parameter; the response still emits the same value under both the `min_similarity` and legacy `threshold` keys so the payload shape is unchanged.

(
    State(state): State<DashboardState>,
    JsonQuery(params): JsonQuery<SimilarityParams>,
)

Source from the content-addressed store, hash-verified

369/// the same value under both the `min_similarity` and legacy `threshold`
370/// keys so the payload shape is unchanged.
371pub(crate) async fn similarity(
372 State(state): State<DashboardState>,
373 JsonQuery(params): JsonQuery<SimilarityParams>,
374) -> Json<Value> {
375 let min_similarity = memory_service::coerce_similarity_score(
376 params.min_similarity,
377 SIMILARITY_DEFAULT_THRESHOLD,
378 );
379 let pair_cap = coerce_limit(params.limit, 25, SIMILARITY_PAIR_CAP) as usize;
380 Json(memory_service::similarity_payload(&state, min_similarity, pair_cap).await)
381}
382
383/// `GET /api/plugins/holographic/curation/status` — similarity-dedup curator status.
384pub(crate) async fn curation_status(State(state): State<DashboardState>) -> Json<Value> {

Callers

nothing calls this directly

Calls 3

coerce_similarity_scoreFunction · 0.85
coerce_limitFunction · 0.85
similarity_payloadFunction · 0.85

Tested by

no test coverage detected