mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

Example/Support for Cloudflare Workers Runtime

Open Mhidayah19 opened this issue 3 months ago • 6 comments

🚀 The feature

Description

Hi 👋 First of all, thanks for building and maintaining this project—it’s really exciting to see how mem0ai is evolving!

I’ve been experimenting with using mem0ai inside Cloudflare Workers, but ran into some compatibility issues with the Workers runtime. It looks like the current SDK relies on Node.js native bindings and certain prototype chains that don’t play nicely in edge environments.

Current Behavior

  • Native SQLite bindings throw runtime errors in Workers (C++ modules not supported).
  • File system and streaming APIs aren’t available in Workers.
  • Some exported objects’ prototype chains don’t resolve to the standard Object prototype, which Workers rejects.

Suggested Improvement

It would be amazing if mem0ai could support (or at least provide an example for) Cloudflare Workers by:

  • Offering a pure JavaScript / WebAssembly build that avoids native bindings.
  • Providing documentation or an example repo showing how to use mem0ai as an API client from Workers.

Motivation, pitch

I’m building a chat agent that runs on Cloudflare Workers for ultra-low-latency responses. The current mem0ai SDK relies on Node.js native modules (like SQLite) and file system APIs that aren’t compatible with edge environments. A Worker-compatible version or example would make it much easier to implement long-term memory and contextual reasoning for AI chat agents in serverless edge deployments.

Mhidayah19 avatar Sep 29 '25 18:09 Mhidayah19

@Mhidayah19 Thanks for raising this issue and pointing it out. Adding this to roadmap and will be available in the future releases.

parshvadaftari avatar Sep 30 '25 22:09 parshvadaftari

I also faced this issue while adding support for vectorize

issue was - Native SQLite bindings throw runtime errors in Workers

Mrinank-Bhowmick avatar Oct 03 '25 14:10 Mrinank-Bhowmick

Hi, can I take this up as part of hacktoberfest?

yashikabadaya avatar Oct 06 '25 04:10 yashikabadaya

Feel free to work on it!

parshvadaftari avatar Oct 06 '25 09:10 parshvadaftari

Hi @parshvadaftari , I addressed the requirement in my PR. please review it once and suggest me the changes. Thanks :)

sonianuj287 avatar Oct 13 '25 17:10 sonianuj287

Hi @parshvadaftari , I addressed the requirement in my PR. please review it once and suggest me the changes. Thanks :)

https://github.com/mem0ai/mem0/pull/3571

sonianuj287 avatar Oct 13 '25 17:10 sonianuj287