AI Agent1 input → 1 output
AI Memory (File)
Stores AI conversation memories persistently in a JSON file. Memories survive Node-RED restarts.
Inputs
Outputs
Details
File Memory persists conversation history to disk, allowing the AI to remember context across sessions.
Configuration
- Filename
- JSON file name (stored in Node-RED user directory). Default: ai-memories.json
Usage with AI Agent
Connect this node before AI Agent to provide conversation context:
[Input] → [Memory File] → [AI Agent] → [Output]
Operations
- Store (topic: "store")
- Saves the message to the file
- Search (topic: "search")
- Searches memories by content
- Count (topic: "count")
- Returns memory count
- Get All (no topic)
- Returns all stored memories
Examples
Store Memory:
msg.topic = "store";
msg.payload = {
content: "User prefers morning appointments",
type: "preference"
};
Best Practices
- Use for long-term conversation context
- Implement cleanup logic to prevent unbounded growth
- Consider privacy implications of stored data
- Back up memory files for production