MCPAgent provides flexible memory management options to control how conversation history is handled. You can choose between different memory strategies depending on your use case.Documentation Index
Fetch the complete documentation index at: https://docs.mcp-use.com/llms.txt
Use this file to discover all available pages before exploring further.
Memory Modes
1. Self-Managed Memory (memoryEnabled: true)
When memoryEnabled is set to true (the default), the agent automatically manages conversation history internally. This is the simplest option for most use cases.
2. No Memory (memoryEnabled: false)
When memoryEnabled is set to false, the agent has no internal memory and treats each interaction independently.
Memory Management Methods
The MCPAgent provides methods to inspect and control conversation history:getConversationHistory()
Returns a copy of the current conversation history as an array of messages.
clearConversationHistory()
Clears the internal conversation history. If memoryEnabled is true and a system message exists, it will be preserved.
Next Steps
Agent Configuration
Learn more about configuring agents
Structured Output
Generate type-safe responses with Zod schemas
Streaming
Stream agent responses in real-time