Skip to content

Conversation

mantrakp04
Copy link

  • 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.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

- 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.
@mantrakp04
Copy link
Author

mantrakp04 commented Sep 16, 2025

TODO:

  • Update Search tests
  • Verify the flow manually
  • Create an example

Update:

  • Remove memories, only keep core memories
  • Create core memory related tool helpers
  • Allowing searching messages available as a tool
  • Create a new example

- 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.
Copy link

pkg-pr-new bot commented Sep 16, 2025

Open in StackBlitz

npm i https://pkg.pr.new/get-convex/agent/@convex-dev/agent@159
npm i https://pkg.pr.new/get-convex/agent/@convex-dev/agent-playground@159

commit: bc6f8ae

Copy link
Contributor

@ianmacartney ianmacartney left a 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
Comment on lines 154 to 156
`Enter your npm package name [@convex-dev/${toKebabCase(componentName)}]: `,
(answer) => {
resolve(answer.trim() || `@convex-dev/${toKebabCase(componentName)}`);
Copy link
Contributor

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);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

})
: [
...search,
...coreMemoryMessages,
Copy link
Contributor

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

Copy link
Author

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.

.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 });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe separate with newline?


export const deleteByIds = mutation({
args: { messageIds: v.array(v.id("messages")) },
returns: v.array(v.id("messages")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

red squiggly lines

Comment on lines 142 to 143
persona: v.optional(v.string()),
human: v.optional(v.string()),
Copy link
Contributor

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

Copy link
Author

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.

]);
}
// Fallback to model+table only – this broadens search but avoids undefined values
return q.eq("model_table_threadId", [args.model, args.table, ""]);
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y?

Copy link
Author

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.

@ianmacartney
Copy link
Contributor

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants