docs: fix drift in Admin Operations - #275
Draft
jack-arturo wants to merge 1 commit into
Draft
Conversation
- error bodies use the global {status, code, message} envelope, not {error}
- /admin/reembed batch errors: embedding + Qdrant upsert share one try/except,
so any batch failure counts the whole batch in failed/failed_ids; empty
content is filtered silently during enumeration, not logged
- replace fabricated logger.exception(..., extra={batch_ids}) with the real
logger.error call
- document failed_ids_truncated and the short-circuit empty-result shape
- document /admin/sync batch_size max and its dry_run/already_synced responses
- repin automem/api/admin.py source note to 8ff266e
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EXhZREMSHTSqk3bhiNaX4k
Deploying automem-website with
|
| Latest commit: |
3ee6969
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://24474325.automem-website.pages.dev |
| Branch Preview URL: | https://docs-audit-reference-api-adm-in8m.automem-website.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docs-accuracy audit of
/docs/reference/api/admin(never previously reviewed). 5 proven discrepancies fixed. This page is largely accurate — most of the drift is in error-path documentation.{"error": "Unauthorized"},{"error": "Admin authorization required"},{"error": "Admin token not configured"}abort()raises anHTTPExceptionthat the global@app.errorhandler(Exception)converts to{"status": "error", "code": <n>, "message": <description>}. Noerrorkey is ever emitted.503rowautomem@8ff266e:app.py#L471,automem@8ff266e:automem/api/auth_helpers.py#L31logger.exception("Failed to generate embeddings for batch", extra={"batch_ids": ids})"logger.error(f"Failed to process batch starting at index {i}: {e}")— nologger.exception, noextra=, no ID list.automem@8ff266e:automem/api/admin.py#L196generate_real_embeddings_batch()andqdrant_client.upsert()are inside onetry, so a Qdrant write error is caught by the same handler that doesfailed += len(batch)and extendsfailed_ids— the batch is counted as failed, not silently skipped. Null/empty content is dropped by theif content:filter during enumeration with no log at all.trybehavior up frontautomem@8ff266e:automem/api/admin.py#L155,automem@8ff266e:automem/api/admin.py#L124/admin/reembedResponse Schema documents 7 fields and one examplefailed_ids_truncated(set when >10 IDs fail). The no-work path returns an entirely different, smaller object —{status, message, processed, total}with nofailed,batch_size, ormetadata_preserved.automem@8ff266e:automem/api/admin.py#L143,automem@8ff266e:automem/api/admin.py#L207/admin/syncbatch_sizedocumented as "Default:32" with no ceiling, and no response schemamin(int(payload.get("batch_size", 32)), 100)— same cap as/admin/reembed. Thedry_runandalready_syncedresponse shapes were undocumented.automem@8ff266e:automem/api/admin.py#L246,automem@8ff266e:automem/api/admin.py#L262Also repinned the
automem/api/admin.pysource note from0720da2to8ff266e(+13/−30 since the old pin).automem/api/enrichment.pyandautomem/api/backup.pyare byte-identical between the two commits, so those two links — including the#L29-L100anchor, which still spanscreate_backup_blueprint— were left alone.Verified correct and untouched: the dual-token auth model and both header/query forms; the auth mermaid diagram; the entire
GET /enrichment/statusresponse schema and field table; thePOST /enrichment/reprocessrequest/202 response and its processing flow;/admin/reembedbatch_sizedefault 32 / max 100,limit, andforcesemantics — including the subtle "force=truedrops theWHERE m.content IS NOT NULLfilter but the Pythonif content:check still excludes empty content"; the Phase 1 Cypher block;EMBEDDING_MODELdefaulttext-embedding-3-small; and the/backupadmin-only behavior and archive layout.Verified against: automem@8ff266e62e65cb2e81719a765b05f64a2361a127
Questions
~$0.06cost across all four batch sizes with wall-clock times from ~30 seconds to ~5 minutes. The flat cost is right (token count is batch-size independent), but the timings are unsourced estimates — left alone./enrichment/reprocessrequires the admin token and echoes back only the IDs the caller submitted, so it does not enumerate anything. This reads like it was written against an older handler — worth a maintainer decision on whether to drop the bullet.Unverified
text-embedding-3-smallis "1024-d, set byVECTOR_SIZE".EMBEDDING_MODEL's default is confirmed, but whether 1024 is the right worked example depends on deployment config, so the number was left as-is.Follow-ups
POST /enrichment/reprocessalso acceptsidsas a comma-separated string and as an?ids=query parameter, and de-duplicates via aset(which is why the response IDs come back sorted). The request schema documents only the JSON array form.?query=*, which is not a documented wildcard for/recall. Not verified either way; not touched.Generated by Claude Code