-
-
Notifications
You must be signed in to change notification settings - Fork 455
Implement User Memory Feature for Enhanced Conversational Context #1818
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: 3.1.0-preview
Are you sure you want to change the base?
Conversation
- Removed user insights extraction and storage logic - Simplified UserMemoryManager to focus only on recent conversations - Updated memory design documentation to reflect current implementation - Maintains recent conversation tracking with 40-line rolling buffer - No breaking changes to public API
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 Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Status |
---|---|---|
Uncached system prompt with memory retrieval ▹ view | ||
Hardcoded memory configuration values ▹ view | ||
Repeated system prompt generation without caching ▹ view | ||
Prompt injection vulnerability in LLM calls ▹ view | ||
SRP violation in sendMessage method ▹ view | ✅ Fix detected | |
SRP violation: memory-analysis logic lives in UI tab ▹ view | ||
Hardcoded memory folder path may cause conflicts ▹ view | ||
Memory field not restricted to user messages ▹ view | ✅ Fix detected |
Files scanned
File Path | Reviewed |
---|---|
src/types/message.ts | ✅ |
src/settings/SettingsPage.tsx | ✅ |
src/settings/v2/components/CopilotPlusSettings.tsx | ✅ |
src/core/MessageRepository.ts | ✅ |
src/LLMProviders/chainManager.ts | ✅ |
src/core/ChatManager.ts | ✅ |
src/main.ts | ✅ |
src/settings/model.ts | ✅ |
src/components/Chat.tsx | ✅ |
src/LLMProviders/chainRunner/AutonomousAgentChainRunner.ts | ✅ |
src/constants.ts | ✅ |
src/LLMProviders/chainRunner/CopilotPlusChainRunner.ts | ✅ |
src/memory/UserMemoryManager.ts | ✅ |
src/LLMProviders/projectManager.ts | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
bugbot run |
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 Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Status |
---|---|---|
Missing validation criteria explanation ▹ view | ✅ Fix detected | |
Incorrect log level for error condition ▹ view | ✅ Fix detected | |
Incorrect log level for error condition ▹ view | ✅ Fix detected | |
Misleading async method naming ▹ view | ✅ Fix detected | |
Missing purpose explanation in condensed message documentation ▹ view | ✅ Fix detected | |
Unnecessary function binding in filter ▹ view | ✅ Fix detected | |
Inconsistent chain manager usage in memory operations ▹ view | ✅ Fix detected |
Files scanned
File Path | Reviewed |
---|---|
src/settings/model.ts | ✅ |
src/memory/UserMemoryManager.ts | ✅ |
src/core/ChatManager.ts | ✅ |
src/LLMProviders/chainRunner/AutonomousAgentChainRunner.ts | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
src/memory/UserMemoryManager.ts
Outdated
/** | ||
* Check if a message is a user message with valid condensed content | ||
*/ | ||
private hasValidCondensedUserMessage(message: ChatMessage): boolean { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
src/memory/UserMemoryManager.ts
Outdated
const conversationTitle = await this.extractConversationTitle(messages, chatModel); | ||
const timestamp = new Date().toISOString().split(".")[0] + "Z"; // Remove milliseconds but keep Z for UTC | ||
const userMessageTexts = messages | ||
.filter(this.hasValidCondensedUserMessage.bind(this)) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
src/core/ChatManager.ts
Outdated
const chainManager = this.plugin.projectManager.getCurrentChainManager(); | ||
const chatModel = chainManager.chatModelManager.getChatModel(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
src/core/ChatManager.ts
Outdated
} | ||
}) | ||
.catch((error) => { | ||
logInfo(`[ChatManager] Failed to create condensed message for ${messageId}:`, error); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
src/core/ChatManager.ts
Outdated
}); | ||
} | ||
} catch (error) { | ||
logInfo(`[ChatManager] Error setting up condensed message creation:`, error); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
bugbot run |
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 Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Status |
---|---|---|
Tight coupling to utility function ▹ view | ✅ Fix detected |
Files scanned
File Path | Reviewed |
---|---|
src/memory/UserMemoryManager.ts | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
const settings = getSettings(); | ||
const memoryFolderPath = settings.memoryFolderName; | ||
|
||
await ensureFolderExists(memoryFolderPath); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
bugbot run |
I ran codex on this diff, can you check if these are real issues @wenzhengjiang Key Findings and Potential Issues
Files/Areas Reviewed
Recommendations Summary
|
Most issues discovered by codex are valid 👍 |
bugbot run |
This PR introduces a User Memory feature to enhance the AI's contextual awareness and personalization. It includes two components: "Recent Conversations" for automatic, short-term context from chat history, and "Saved Memories" for long-term, user-directed information storage.
Key changes include the UserMemoryManager to handle memory operations, new settings for configuration, and seamless integration of memory context into the LLM system prompt.
See https://github.com/logancyang/obsidian-copilot/blob/3da77b4ddf247c2f0b659e1e5f912ebf4dd36d9a/src/memory/memory-design.md for implementation design details.