-
Notifications
You must be signed in to change notification settings - Fork 58
Add core memory and memory management features #159
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?
Conversation
- Introduced core memory functionality with create, update, append, prepend, and remove operations. - Implemented memory management with add, modify, remove, and list capabilities. - Enhanced search functionality for memories using embeddings. - Updated API definitions to include new core memory and memory methods. - Added tests for core memory and memory functionalities to ensure reliability. - Included a new utility script for renaming components and managing case variations. This commit lays the groundwork for improved memory handling in the application.
TODO:
Update:
|
- Removed the memories API and related functionality from the codebase, including add, get, list, modify, and remove operations. - Deleted associated tests and schema definitions for memories. - Updated the API definitions to reflect the removal of memory-related methods. - Introduced new files for memory handling and updated search functionality to exclude memories. This commit streamlines the codebase by eliminating unused memory features and focusing on core memory functionalities.
commit: |
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.
high level question: does this mean folks will have ~8 more tool calls on every agent LLM call (4 for each of short & long memory)? Or maybe one tool call with multiple options/params?
rename.mjs
Outdated
`Enter your npm package name [@convex-dev/${toKebabCase(componentName)}]: `, | ||
(answer) => { | ||
resolve(answer.trim() || `@convex-dev/${toKebabCase(componentName)}`); |
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.
If we're adding this back in, it likely shouldn't assume it's going to be a @convex-dev/*
package
} | ||
return String(error); | ||
} | ||
} |
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.
} | |
} |
}) | ||
: [ | ||
...search, | ||
...coreMemoryMessages, |
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.
what do you think about before/after search messages? was this intentional?
reminder: update any docs on contextHandler that mention the default ordering
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.
i am still testing out various memory solutions, graph based, rag, notepad, namespaces, etc.
I initially thought to have this with the rag based memories but then saw better results with the message based overall. Will seperate core memories from the search.
src/component/coreMemories.ts
Outdated
.first(); | ||
assert(doc, `Core memory for user ${args.userId} not found`); | ||
const base = (doc[args.field] as string | undefined) ?? ""; | ||
await ctx.db.patch(doc._id, { [args.field]: args.text + base }); |
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.
maybe separate with newline?
src/component/messages.ts
Outdated
|
||
export const deleteByIds = mutation({ | ||
args: { messageIds: v.array(v.id("messages")) }, | ||
returns: v.array(v.id("messages")), |
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.
why?
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.
red squiggly lines
src/component/schema.ts
Outdated
persona: v.optional(v.string()), | ||
human: v.optional(v.string()), |
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.
drop a comment here about what these terms mean. not clear to me
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.
human is for user preferences and persona is for agent guidance, thinking of adding a namespace but don't want multiple notepad memories.
src/component/vector/index.ts
Outdated
]); | ||
} | ||
// Fallback to model+table only – this broadens search but avoids undefined values | ||
return q.eq("model_table_threadId", [args.model, args.table, ""]); |
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.
I don't think this will match anything, since "" isn't a valid threadId
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.
y?
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.
i had to change git origins and had to check if it was syncing to the fork instead of the private unforked repo real quick, i didn't know what to change so i added this.
direction looks promising |
- Introduced core memory functionalities including get, create, update, append, replace, and remove operations. - Added a new MemoryUI component for managing core memories through a user interface. - Updated API definitions to include new core memory methods and adjusted existing methods for consistency. - Enabled memory tools in the configuration to allow automatic inclusion of memory management features. - Enhanced tests for core memory operations to ensure reliability and prevent duplicates. This commit enhances the application's memory management capabilities, providing a comprehensive interface for users to interact with core memories.
- Updated the setup prompts to remove default prefixes for npm package and repository names, simplifying user input. - Introduced a new function to fetch core memory messages, improving the handling of user context in the application. - Refactored the search and context handling to incorporate core memory messages, ensuring they are included in the message processing order. - Added tests to validate the integration of core memory messages in the search functionality. This commit improves user experience by streamlining setup and enhances the application's context handling capabilities.
…nded text - Modified the append function to prepend a newline character before appending new text to the existing core memory field. This change improves the formatting of core memory entries, ensuring better readability and separation of entries. This commit enhances the user experience by improving the organization of core memory data.
…and document removal - Adjusted the expected value for the persona field to include newline characters for better formatting. - Updated the test for document removal to assert that the entire document is removed, rather than just a segment, ensuring accurate validation of the remove operation. This commit enhances the reliability of coreMemories tests by aligning them with the latest functionality changes.
This commit lays the groundwork for improved memory handling in the application.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.