Class: InMemoryStorageAdapter
Defined in: packages/agentos/src/core/storage/InMemoryStorageAdapter.ts:66
In-memory storage adapter for AgentOS.
Provides a complete implementation of IStorageAdapter without any persistence. All data is stored in JavaScript Map and Array structures.
Use Cases:
- Unit and integration testing
- Development environments
- Stateless sessions
- CI/CD pipelines
- Prototyping and demos
Characteristics:
- Zero setup (no database required)
- Extremely fast (no I/O)
- Non-persistent (data lost on process exit)
- Thread-safe in single-threaded environments
Implements
Example
// Perfect for testing
const storage = new InMemoryStorageAdapter();
await storage.initialize();
const conversation = await storage.createConversation({
id: 'test-conv',
userId: 'test-user',
createdAt: Date.now(),
lastActivity: Date.now()
});
// No cleanup needed for tests
await storage.close();
Implements
Constructors
Constructor
new InMemoryStorageAdapter():
InMemoryStorageAdapter
Defined in: packages/agentos/src/core/storage/InMemoryStorageAdapter.ts:82
Creates a new in-memory storage adapter.
No configuration needed since everything is in memory.
Returns
InMemoryStorageAdapter