mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-11 22:51:05 +00:00
updated readme
This commit is contained in:
parent
250dae7200
commit
56ac4c656f
1 changed files with 0 additions and 32 deletions
|
|
@ -409,42 +409,10 @@ const addResult = await tools.addMemory({
|
|||
|
||||
### Mastra Usage
|
||||
|
||||
> **⚠️ Breaking Change in v2.0.0**: The Mastra integration API has been updated to use object-based parameters instead of positional parameters for better clarity. See the migration guide below.
|
||||
|
||||
Add persistent memory to [Mastra](https://mastra.ai) AI agents. The integration provides processors that:
|
||||
- **Input Processor**: Fetches relevant memories and injects them into the system prompt before LLM calls
|
||||
- **Output Processor**: Optionally saves conversations to Supermemory after responses
|
||||
|
||||
#### Migration from v1.x to v2.0.0
|
||||
|
||||
**v1.x (old API with positional parameters):**
|
||||
```typescript
|
||||
// Old API - DEPRECATED
|
||||
withSupermemory(config, "user-123", "conv-456", { mode: "full" })
|
||||
new SupermemoryInputProcessor("user-123", "conv-456", { mode: "full" })
|
||||
createSupermemoryProcessors("user-123", "conv-456", { mode: "full" })
|
||||
```
|
||||
|
||||
**v2.0.0 (new API with object parameters):**
|
||||
```typescript
|
||||
// New API - clearer with explicit key-value pairs
|
||||
withSupermemory(config, {
|
||||
containerTag: "user-123",
|
||||
customId: "conv-456",
|
||||
mode: "full"
|
||||
})
|
||||
new SupermemoryInputProcessor({
|
||||
containerTag: "user-123",
|
||||
customId: "conv-456",
|
||||
mode: "full"
|
||||
})
|
||||
createSupermemoryProcessors({
|
||||
containerTag: "user-123",
|
||||
customId: "conv-456",
|
||||
mode: "full"
|
||||
})
|
||||
```
|
||||
|
||||
#### Quick Start with `withSupermemory` Wrapper
|
||||
|
||||
The simplest way to add memory to a Mastra agent - wrap your config before creating the Agent:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue