Class InMemoryStorageAdapter

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

InMemoryStorageAdapter

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

Methods