Skip to content

fix(providers): rate-limit resilience + non-fatal ingest failures - #57

Open
dkoosis wants to merge 2 commits into
supermemoryai:mainfrom
dkoosis:upstream-pr/provider-rate-limit
Open

fix(providers): rate-limit resilience + non-fatal ingest failures#57
dkoosis wants to merge 2 commits into
supermemoryai:mainfrom
dkoosis:upstream-pr/provider-rate-limit

Conversation

@dkoosis

@dkoosis dkoosis commented Aug 2, 2026

Copy link
Copy Markdown

Stacked on #56 — this branch includes #56's one-line commit so the two PRs don't conflict in search(). Merge #56 first and this PR reduces to the rate-limit work; merging this alone also lands #56's fix.

Motivation

Running a full 500-question LongMemEval ingest surfaced three ways the mem0/supermemory providers and the ingest phase abort an entire multi-hour run over transient or isolated failures.

Changes

1. mem0 + supermemory: 429 retry with backoff.
Both SDKs surface rate limits as thrown errors, so a burst above the per-key RPS cap kills the run. Each provider gets a withRetry wrapper (kept per-provider deliberately — the two APIs signal 429 differently: supermemory returns a retryAfterSeconds hint, which the retry honors; mem0 uses "too frequently"-style messages). Non-rate-limit errors still rethrow immediately.

2. Provider-default ingest concurrency lowered (supermemory 100→8, indexing 200→50; mem0 ingest 8, search 20).
The old defaults exceed the per-second caps on standard paid tiers, producing an immediate 429 storm at run start. These are only provider defaultscheckpoint.concurrency per-run overrides still take precedence (resolveConcurrency), so runs with higher-tier keys can keep the old throughput by passing their own values.

3. mem0: skip empty adds.
Abstention questions can carry empty haystacks; mem0 rejects empty message arrays. Filter empty-content messages and skip sessions with nothing usable instead of erroring.

4. Ingest phase: per-question failure no longer aborts the run.
Previously one failed question threw and killed the whole run. Now the checkpoint records status: "failed" and the run continues. This is safe because downstream already gates on checkpoint state: indexing only picks up questions whose ingest completed, and search gates on indexing — so failed questions are cleanly skipped, and resume (which filters on status !== "completed") retries exactly those questions under the same run ID.

Typechecks clean. No public API changes.

dkoosis added 2 commits August 2, 2026 11:18
…ng 30

search() hardcoded limit: 30, silently overriding whatever limit the caller
passed in SearchOptions — so a benchmark requesting a deeper retrieval pool
(e.g. limit 50) still capped at 30. Honor options.limit, keeping 30 as the
default. Flagged by @sohamd22 in PR supermemoryai#44 review.
Running a full 500-question LongMemEval ingest surfaced three ways the
mem0/supermemory providers and the ingest phase aborted whole runs:

- mem0 + supermemory: default ingest concurrency (50/100) blew past each
  paid tier's per-second cap, triggering an immediate 429 storm. Add
  exponential-backoff retry (supermemory honors server retryAfterSeconds)
  and lower the provider-default ingest concurrency to 8. Per-run
  overrides via checkpoint.concurrency still win over these defaults.
- mem0: skip sessions with no usable messages instead of erroring
  (abstention questions can carry empty haystacks; mem0 rejects empty adds).
- ingest phase: a single failed question no longer throws and kills the
  run. The checkpoint records the failure, downstream phases skip it, and
  resume retries it. One bad question in 500 must not abort a multi-hour
  benchmark.
@dkoosis
dkoosis force-pushed the upstream-pr/provider-rate-limit branch from cdfeab1 to da9c8fb Compare August 2, 2026 15:29
dkoosis added a commit to dkoosis/memorybench that referenced this pull request Aug 2, 2026
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.

1 participant