0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00

Fix overly synchronous and blocking memory behaviour (#3015)

* Creating a thread in preExecute before hook and de-coupling that from
`saveMemory()` logic in `packages/core/src/agent/index.ts`
* `saveMemory()` is now called `fetchMemory` because it no longer saves
any messages, just fetches all the memory context required
* We no longer generate the thread title in a blocking way, we do that
in the `after` hook in parallel with saving all the user and llm output
messages
* Saving of new user messages is no longer a blocking operation in
`saveMemory` but rather happens in the `after` hook in parallel, no
longer blocking the actual LLM call.
This commit is contained in:
Tony Kovanen 2025-03-18 18:11:22 +02:00 • committed by GitHub
commit 3084e13f32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 105 additions and 89 deletions