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

Function overview

src/dashboard/memory_api.rs:258–298  ·  view source on GitHub ↗

`GET /api/plugins/holographic/` — overview + facts + entities + graph.

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

Source from the content-addressed store, hash-verified

256
257/// `GET /api/plugins/holographic/` — overview + facts + entities + graph.
258pub(crate) async fn overview(
259 State(state): State<DashboardState>,
260 JsonQuery(params): JsonQuery<OverviewParams>,
261) -> Json<Value> {
262 let limit = coerce_limit(params.limit, 25, 100);
263 let graph_limit = coerce_limit(params.graph_limit, limit, 1000);
264
265 let mut obj = Map::new();
266 obj.insert("path".into(), json!(state.mem_db_path));
267 obj.insert("exists".into(), json!(true));
268 obj.insert("overview".into(), Value::Null);
269 obj.insert("facts".into(), json!([]));
270 obj.insert("entities".into(), json!([]));
271 obj.insert("graph".into(), json!({ "nodes": [], "edges": [] }));
272 obj.insert("error".into(), json!(""));
273 match memory_service::overview_payload(&state).await {
274 Ok(payload) => {
275 obj.insert("overview".into(), payload);
276 }
277 Err(e) => {
278 obj.insert("error".into(), json!(e));
279 }
280 }
281 if let Ok(facts) = memory_service::fetch_facts(&state, &params.q, limit).await {
282 obj.insert("facts".into(), json!(facts));
283 }
284 if let Ok(entities) = memory_service::fetch_entities(&state, limit).await {
285 obj.insert("entities".into(), json!(entities));
286 }
287 if let Ok(graph) = memory_service::graph_payload(&state, &params.q, graph_limit).await {
288 obj.insert("graph".into(), graph);
289 }
290 let holographic = Value::Object(obj);
291
292 Json(json!({
293 "providers": memory_service::providers_payload(),
294 "query": params.q,
295 "limit": limit,
296 "holographic": holographic,
297 }))
298}
299
300/// `GET /api/plugins/holographic/status` — rich holographic-memory health
301/// derived from `TraceDecay::memory_status()` plus the largest-bank utilization

Callers

nothing calls this directly

Calls 6

coerce_limitFunction · 0.85
fetch_factsFunction · 0.85
fetch_entitiesFunction · 0.85
graph_payloadFunction · 0.85
insertMethod · 0.80
overview_payloadFunction · 0.70

Tested by

no test coverage detected