-
Notifications
You must be signed in to change notification settings - Fork 50
Implement Mem0-powered memory system for agent #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Implement Mem0-powered memory system for agent #68
Conversation
|
CLA Assistant Lite bot ✅ All contributors have signed the CLA. Thank you for helping make BrowserOS better! |
|
I have read the CLA Document and I hereby sign the CLA |
|
I started reviewing. But looking through the file changes, it looks like there are a number of linter/formatting fixes mixed in with the core logic for the memory system. To keep this PR focused purely on the new memory feature (which makes it much easier to review), would you mind reverting the linting changes for now? We can always tackle the code formatting in a separate, dedicated PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's a basic unit test for this file. You can look at unit tests for tools as reference.
The style guide we follow for unit test is -- have describe and within it the string should start with "tests...." to explain what it is testing. it("tests....)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the test files
|
Looks great, thanks for the contribution @keshav1sharma! I have few minor nits. Let's also add a global flag to enable/disable this feature add a small unit test to check that when it is disabled MemoryManager is not created. |
|
Hi @felarof99 I have added a global flag to enable/disable this feature and unit test files for it. Please take a look and let me know if any other changes required. |
…n, tools, and prompts - Added MemoryConfig interface and default configuration in config.ts - Implemented memory management functionalities in index.ts - Defined memory types and schemas in types.ts - Created memory tools including MemoryTool and MemoryAwarePlannerTool - Developed prompts for memory tool usage and system instructions
- Added memory system prompts to BrowserAgent for task continuity and learning. - Implemented memory tool registration in BrowserAgent. - Introduced memory management in NxtScape for improved task execution. - Updated ExecutionContext to support memory manager. - Enhanced tool result storage in memory based on tool type and importance. - Configured webpack to inject memory API key at build time.
…ations + prompt changes
…ory System and test scripts for it.
0c3191d to
16e7604
Compare
|
I rebased the PR, fixing merge conflicts. |
|
You’re right @felarof99 — storing planner/search results in mem0 would quickly add up and isn’t ideal for long-term memory. We can set custom expirations (e.g. 1 day) for temporary tool outputs if we really need to persist them, but I agree that it’s still costly. I’ll adjust the approach so mem0 is mainly used for longer-term preferences and context, while short-term task execution data will rely on chrome.local storage via the StorageTool. |
3403b8b to
4d94b11
Compare

🧠 Implement Memory System for BrowserOS Agent
Overview
This PR implements a comprehensive memory system that enables the BrowserOS agent to maintain context across browser sessions, learn from user interactions, and provide personalized experiences. The memory system uses Mem0 for cloud-based persistent storage and integrates seamlessly with the existing tool architecture.
🎯 What This Adds
🔧 Technical Implementation
Core Components Added
memory_tool: Core memory operations (add, search, get_context, store_result, get_preferences)Architecture Changes
Tool Integration
BrowserAgenttool registry🎬 Demo Video
Screen.Recording.2025-08-22.at.6.25.00.PM.mp4
🚀 Key Features
Memory Categories
search_result- Information found through searchesuser_preference- User's stated preferences and requirementstask_result- Intermediate results from task stepsinteraction_pattern- Successful UI interaction sequencesworkflow_pattern- Successful task completion patternserror_solution- Solutions to encountered problemsresearch_data- Collected research informationcontext_data- General contextual informationAutomatic Memory Triggers
The agent automatically uses memory when users say:
Example Usage
🔄 Changes Made
Files Added
src/lib/memory/- Complete memory system implementationsrc/lib/tools/memory/- Memory tools and promptsFiles Modified
src/lib/agent/BrowserAgent.ts- Added memory tool registrationsrc/lib/tools/index.ts- Export memory toolssrc/lib/runtime/ExecutionContext.ts- Memory manager integrationpackage.json- Addedmem0aianduuiddependenciesEnvironment Variables
MEM0_API_KEY- Required for cloud memory storage (optional, graceful fallback if not provided)🧪 Testing
🎨 Design Decisions
Tool-First Approach
Graceful Degradation
MEM0_API_KEYis not providedClean Architecture
🔮 Future Enhancements
This implementation transforms the BrowserOS agent from a stateless automation tool into an intelligent assistant that learns, remembers, and personalizes the browsing experience. The memory system enables true task continuity and creates a foundation for advanced AI assistant capabilities.
Ready for review and testing! 🚀