-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add user memory feature to SurfSense #722
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
Conversation
|
@manojag115 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Review by RecurseML
🔍 Review performed on 6e331c3..e3fe4b8
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (11)
• surfsense_backend/alembic/versions/73_add_user_memories_table.py
• surfsense_backend/app/agents/new_chat/chat_deepagent.py
• surfsense_backend/app/agents/new_chat/system_prompt.py
• surfsense_backend/app/agents/new_chat/tools/__init__.py
• surfsense_backend/app/agents/new_chat/tools/registry.py
• surfsense_backend/app/db.py
• surfsense_backend/app/routes/new_chat_routes.py
• surfsense_backend/app/tasks/chat/stream_new_chat.py
• surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx
• surfsense_web/components/tool-ui/index.ts
• surfsense_web/components/tool-ui/user-memory.tsx
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.
Review by RecurseML
🔍 Review performed on e3fe4b8..d640802
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (3)
• surfsense_backend/alembic/versions/73_add_user_memories_table.py
• surfsense_backend/app/agents/new_chat/tools/user_memory.py
• surfsense_web/components/tool-ui/user-memory.tsx
|
@manojag115 Looks good to me. |
This PR adds the ability to save and retreive user info from memory. Specifically:
Description
Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR implements a Claude-like memory feature that enables the AI assistant to remember user information across conversations. It adds two new MCP tools (
save_memoryandrecall_memory) that store user facts, preferences, instructions, and context as embeddings in a PostgreSQL table with vector similarity search support. The feature includes database migrations, tool implementations with semantic search capabilities, UI components for displaying memory operations, and integration into the chat agent with comprehensive system prompts for guiding when and how to use the memory tools.⏱️ Estimated Review Time: 1-3 hours
💡 Review Order Suggestion
surfsense_backend/alembic/versions/73_add_user_memories_table.pysurfsense_backend/app/db.pysurfsense_backend/app/agents/new_chat/tools/user_memory.pysurfsense_backend/app/agents/new_chat/tools/__init__.pysurfsense_backend/app/agents/new_chat/tools/registry.pysurfsense_backend/app/agents/new_chat/system_prompt.pysurfsense_backend/app/agents/new_chat/chat_deepagent.pysurfsense_backend/app/tasks/chat/stream_new_chat.pysurfsense_backend/app/routes/new_chat_routes.pysurfsense_web/components/tool-ui/user-memory.tsxsurfsense_web/components/tool-ui/index.tssurfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx