Skip to content

Batch independent memory saves for faster imports - #4

Merged
zvadaadam merged 1 commit into
mainfrom
zvadaadam/memory-save-latency
Sep 29, 2026
Merged

zvadaadam merged 1 commit into
mainfrom
zvadaadam/memory-save-latency

Conversation

@zvadaadam

Copy link
Copy Markdown
Contributor

Legacy imports currently need a separate embedding operation and database transaction for every saved fact, making the first memory tool call slow. Add rememberMany for 1–20 independent saves: preserve each fact's source session and retry identity, batch embedding, and commit new records atomically with the existing revision guard.

The SDK, HTTP client and Worker expose the same method. Built-in stores accept processed-ID batches across sessions; custom Store implementations must handle the documented list form before using it. Corrections retain the single-save API. Prepare the sole public package @fluiddb/fluiddb@1.0.0-next.5.

Validation: bun run check, bun run test:runtime, bun run verify:packages, bun run release:check, ./ref-check, all 65 real SQLite/Postgres/Firestore adapter checks, and Firestore REST in workerd passed. Regression coverage includes mixed retries, forgotten IDs, provider failure, cancellation/erasure, HTTP authorization and persistence across Worker restart. No paid model calls.

The companion backend change reduced a synthetic first import page from 35.54 s to about 3 s at fixed artificial network delays; this is not a production measurement. The OpenAI adapter may split the batched invocation into concurrent HTTP requests. Independent correctness, security and API reviews completed; documented provider-call wording was corrected.

@zvadaadam
zvadaadam merged commit 88cdce5 into main Sep 29, 2026
4 checks passed
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