Data layerMemory
fileChatMemory
JSON-file-backed chat memory. Zero infra. Survives restarts.
import { fileChatMemory } from '@agentskit/memory'
const memory = fileChatMemory({ path: '.agentskit/chat.json' })Options
| Option | Type | Default |
|---|---|---|
path | string | required |
maxMessages | number | unlimited |
encoding | 'utf-8' | 'utf-8' |
Trade-offs
- Good for: CLIs, local dev, desktop apps.
- Bad for: multi-process writes (no locking), high-throughput web.
Related
- sqliteChatMemory — concurrent, indexed.
- redisChatMemory — distributed.
- Concepts → Memory