Skip to main content
Mastra v1 is coming in January 2026. Get ahead by starting new projects with the beta or upgrade your existing project today.

Conversation History

Conversation history is the simplest kind of memory. It is a list of messages from the current conversation.

By default, each request includes the last 10 messages from the current memory thread, giving the agent short-term conversational context. This limit can be increased using the lastMessages parameter.

You can increase this limit by passing the lastMessages parameter to the Memory instance.

export const testAgent = new Agent({
// ...
memory: new Memory({
options: {
lastMessages: 20,
},
}),
});