@chat-adapter/state-memory
v4.8.0
Published
In-memory state adapter for chat (development/testing)
Readme
@chat-adapter/state-memory
In-memory state adapter for the chat SDK.
Note: This adapter is intended for development and testing only. For production, use @chat-adapter/state-redis or @chat-adapter/state-ioredis.
Installation
npm install chat @chat-adapter/state-memoryUsage
import { Chat } from "chat";
import { createMemoryState } from "@chat-adapter/state-memory";
const chat = new Chat({
userName: "mybot",
adapters: { /* ... */ },
state: createMemoryState(),
});Features
- Thread subscriptions (in-memory storage)
- Distributed locking (single-process only)
- Zero configuration required
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 process restarts
When to Use
- Local development
- Unit testing
- Single-instance deployments (not recommended for production)
License
MIT
