feat: expose status field on POST /memory + persist_llm_candidates script

The API endpoint now passes the request's status field through to
create_memory() so external scripts can create candidate memories
directly without going through the extract endpoint. Default remains
'active' for backward compatibility.

persist_llm_candidates.py reads a saved extractor eval baseline
JSON (e.g. the Day 4 LLM run) and POSTs each candidate to Dalidou
with status=candidate. Safe to re-run — duplicate content returns
400 which the script counts as 'skipped'.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 05:51:31 -04:00
parent a29b5e22f2
commit 3a7e8ccba4
2 changed files with 91 additions and 0 deletions

View File

@@ -141,6 +141,7 @@ class MemoryCreateRequest(BaseModel):
content: str
project: str = ""
confidence: float = 1.0
status: str = "active"
class MemoryUpdateRequest(BaseModel):
@@ -344,6 +345,7 @@ def api_create_memory(req: MemoryCreateRequest) -> dict:
content=req.content,
project=req.project,
confidence=req.confidence,
status=req.status,
)
except ValueError as e:
raise HTTPException(status_code=400, detail=str(e))