Skip to content

[DISCORD:1416569862234570754] Why does memory_messages always recreate the memory_messages_vector_idx? #7817

@wardpeet

Description

@wardpeet

This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1416569862234570754

We use Mastra with memory and it correctly creates the memory_messages table. However, there is no way to specify which index to use and always defaults to ivfflat with cosine distance, even though the vector code itself can take these options.

The main problem then stems from the fact that it calls the setupIndex regularly and tries to rebuild the index with different size. Unfortunately, we have so many messages that this times out and the chat regularly breaks down because of this issue. It would be great if we could configure which index the memory should use, so we could use hnsw and also inner product because OpenAI embeddings are normalized and performance would be better.

lists = Math.max(100, Math.min(4000, Math.floor(Math.sqrt(size) * 2)));

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions