import { BaseEntityStore } from "../../../schema/index.js"; export class InMemoryEntityStore extends BaseEntityStore { lc_namespace = ["langchain", "stores", "entity", "in_memory"]; private store: Record; constructor() { super(); this.store = Object.create(null); } async get( key: string, defaultValue: string | undefined ): Promise { return key in this.store ? this.store[key] : defaultValue; } async set(key: string, value: string | undefined): Promise { this.store[key] = value; } async delete(key: string): Promise { delete this.store[key]; } async exists(key: string): Promise { return key in this.store; } async clear(): Promise { this.store = Object.create(null); } }