Skip to content

fix(memory-core): make remote embeddings token-aware and resilient - #1184

Open
gavinlouuu-kpt wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
gavinlouuu-kpt:fix/cdb-247-embedding-resilience
Open

gavinlouuu-kpt wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
gavinlouuu-kpt:fix/cdb-247-embedding-resilience

Conversation

@gavinlouuu-kpt

Copy link
Copy Markdown

Summary

  • add token-aware remote embedding budgets with Unicode-safe truncation
  • retry only transient 429/5xx/network/timeout failures with bounded exponential backoff
  • validate vector count, dimension, finiteness, and magnitude before persistence
  • preserve per-item progress during deferred L0 embedding and retain failed source rows for replay
  • expose safe embedding failure counters plus separate L0/L1 source/vector coverage in /health

Verification

  • npm test: 5/5 passed
    • CJK + emoji + code against a smaller token budget
    • bounded 500/429 retries
    • bounded timeout retry
    • permanent 4xx no-retry and partial item progress
    • L0 durability across restart and idempotent vector backfill
  • npm run build:plugin
  • git diff --check

Tracks downstream CDB issue gavinlouuu-kpt/codex-discord-bridge#247.

@gavinlouuu-kpt

Copy link
Copy Markdown
Author

Live downstream staging validation passed with BGE-M3 at 1024 dimensions: eight isolated L0 writes embedded successfully, the extraction/recall pipeline completed, health stayed ready, and cleanup returned source/vector coverage to 1. Evidence SHA-256 f4d2e1de8fe430e3ec10fac87980abd0469339979fc5fa7c19bb37a0577f1215.

@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thank you so much for your attention and contribution! We will arrange an internal review for this PR shortly, and all feedback will be shared right here in the discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants