Example/Support for Cloudflare Workers Runtime
🚀 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
Objectprototype, 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 Thanks for raising this issue and pointing it out. Adding this to roadmap and will be available in the future releases.
I also faced this issue while adding support for vectorize
issue was - Native SQLite bindings throw runtime errors in Workers
Hi, can I take this up as part of hacktoberfest?
Feel free to work on it!
Hi @parshvadaftari , I addressed the requirement in my PR. please review it once and suggest me the changes. Thanks :)
Hi @parshvadaftari , I addressed the requirement in my PR. please review it once and suggest me the changes. Thanks :)