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

Function projection

src/dashboard/memory_api.rs:357–363  ·  view source on GitHub ↗

`GET /api/plugins/holographic/projection` — 2D PCA of phase vectors, embedded as `[cos(p), sin(p)]` so wrapped phases compare correctly.

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

Source from the content-addressed store, hash-verified

355/// `GET /api/plugins/holographic/projection` — 2D PCA of phase vectors,
356/// embedded as `[cos(p), sin(p)]` so wrapped phases compare correctly.
357pub(crate) async fn projection(
358 State(state): State<DashboardState>,
359 JsonQuery(params): JsonQuery<ProjectionParams>,
360) -> Json<Value> {
361 let limit = coerce_limit(params.limit, 25, memory_service::projection_point_cap());
362 Json(memory_service::projection_payload(&state, &params.q, limit).await)
363}
364
365/// `GET /api/plugins/holographic/similarity` — pairwise phase-cosine
366/// similarity (`mean(cos(p_i − p_j))`) over all vectored facts.

Callers

nothing calls this directly

Calls 3

coerce_limitFunction · 0.85
projection_point_capFunction · 0.85
projection_payloadFunction · 0.85

Tested by

no test coverage detected