Example/Support for Cloudflare Workers Runtime #3571
+179
−0
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.
Description
Cloudflare Workers example and documentation demonstrating a safe, supported way to use mem0 from edge runtimes (API-client approach), plus a short roadmap for producing a worker/browser-friendly build.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
(Reasoning: This PR adds an example and documentation to demonstrate a Worker-compatible integration pattern; it does not change runtime behavior of core SDK code.)
Summary of changes
Added a Cloudflare Worker example and a minimal fetch-based client that avoids Node-only APIs and native bindings:
[mem0-worker-client.ts]— a minimal fetch-based mem0 client suitable for edge runtimes.
[worker.ts] — example Cloudflare Worker routing /create and /query to the mem0 HTTP API.
[README.md]— instructions and quick-start notes for using the example in Cloudflare Workers (Wrangler).
[BUILD_FOR_WORKERS.md] — a concrete proposal with steps to produce a true worker/browser-friendly SDK build (entrypoint, WASM SQLite, bundler guidance, conditional exports, CI test ideas).
Purpose: help users run mem0 in edge environments in a safe, supported way by using the SDK as an HTTP API instead of attempting to run native-dependent parts of the SDK directly in Workers. Also provides a clear roadmap to create a full browser/worker build if desired.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Please delete options that are not relevant.
Checklist:
Maintainer Checklist