Memory
In-memory state adapter for local development and testing.
An in-memory state adapter for development and testing. Zero configuration required.
Installation
pnpm add @chat-adapter/state-memoryUsage
import { Chat } from "chat";
import { createMemoryState } from "@chat-adapter/state-memory";
const bot = new Chat({
userName: "mybot",
adapters: { /* ... */ },
state: createMemoryState(),
});No configuration options are needed.
Features
- Thread subscriptions (in-memory)
- Locking (single-process only)
- Zero configuration
Limitations
- Not suitable for production — state is lost on restart
- Single process only — locks don't work across multiple instances
- No persistence — subscriptions reset when the process restarts
When to use
- Local development
- Unit testing
- Quick prototyping