userStore property

Future<KBMemoryStore?> get userStore

Lazily initializes the user-scope store + search engine.

Implementation

Future<KBMemoryStore?> get userStore async {
  if (_userRoot == null) return null;
  if (_userStore != null) return _userStore;
  _userStorage = ExecutionEnvKbStorage(_env, _resolvedUserPath());
  await _userStorage!.initialize();
  _userStore = KBMemoryStore(_userStorage!, provider: _llmProvider);
  _userSearch = KBSearchEngine(_userStorage!, provider: _llmProvider);
  return _userStore!;
}