Update app.py
Browse files
app.py
CHANGED
|
@@ -138,6 +138,14 @@ async def record_outcome(decision_id: str, success: bool):
|
|
| 138 |
return {"status": "ok", "decision_id": decision_id, "outcome": dec["outcome"]}
|
| 139 |
return {"error": "decision not found"}
|
| 140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
# ========================= GRADIO UI =========================
|
| 142 |
def get_risk_snapshot():
|
| 143 |
try:
|
|
|
|
| 138 |
return {"status": "ok", "decision_id": decision_id, "outcome": dec["outcome"]}
|
| 139 |
return {"error": "decision not found"}
|
| 140 |
|
| 141 |
+
# ========================= NEW MEMORY STATS ENDPOINT =========================
|
| 142 |
+
@fastapi_app.get("/v1/memory/stats")
|
| 143 |
+
async def get_memory_stats():
|
| 144 |
+
"""Return current memory graph statistics."""
|
| 145 |
+
if memory:
|
| 146 |
+
return memory.get_graph_stats()
|
| 147 |
+
return {"error": "Memory not initialized"}
|
| 148 |
+
|
| 149 |
# ========================= GRADIO UI =========================
|
| 150 |
def get_risk_snapshot():
|
| 151 |
try:
|