M
Mastraโ€ข2mo ago
Saulved

Can we parallelize semantic recall at all

Hey Team, We noticed that when we turn on semantic recall, the time it takes for a response to come in client side increases ~80%. Can we parallelize this in anyway to speed this up? Here is the setup:
const memory = new Memory({
storage: new PostgresStore({
connectionString: process.env.DATABASE_URL!,
schemaName: "mastra",
}),
vector: new PgVector({
connectionString: process.env.DATABASE_URL!,
schemaName: "mastra",
}),
embedder: 'openai/text-embedding-3-small',
options: {
lastMessages: 10,
workingMemory: {
enabled: true,
scope: "resource",
schema: userContextSchema,
},
semanticRecall: {
topK: 3,
messageRange: 2,
indexConfig: {
type: "hnsw",
metric: "dotproduct",
},
},
},
});
const memory = new Memory({
storage: new PostgresStore({
connectionString: process.env.DATABASE_URL!,
schemaName: "mastra",
}),
vector: new PgVector({
connectionString: process.env.DATABASE_URL!,
schemaName: "mastra",
}),
embedder: 'openai/text-embedding-3-small',
options: {
lastMessages: 10,
workingMemory: {
enabled: true,
scope: "resource",
schema: userContextSchema,
},
semanticRecall: {
topK: 3,
messageRange: 2,
indexConfig: {
type: "hnsw",
metric: "dotproduct",
},
},
},
});
2 Replies
Mastra Triager
Mastra Triagerโ€ข2mo ago
๐Ÿ“ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/9719
GitHub
Can we parallelize semantic recall at all ยท Issue #9719 ยท mastra-...
This issue was created from Discord post 1435368650197434378: Hey Team, We noticed that when we turn on semantic recall, the time it takes for a response to come in client side increases ~80%. Can ...
_roamin_
_roamin_โ€ข2mo ago
Hey @Saulved ! I'm not really seeing this difference on my end, could you share a reproducible example with us? Thanks ๐Ÿ™

Did you find this page helpful?