KnowledgeSystem constructor

KnowledgeSystem({
  1. required KnowledgeConfig config,
  2. KnowledgePorts? ports,
  3. FactGraphRuntime? factGraph,
  4. SkillRuntime? skillRuntime,
  5. ProfileRuntime? profileRuntime,
  6. PhilosophyEngine? philosophyEngine,
  7. OpsRuntime? opsRuntime,
  8. KnowledgeEventBus? eventBus,
})

Create a new knowledge system.

L0 FactGraph is required. When factGraph is null, a default FactGraphRuntime.inMemory() is auto-wired so the system works with zero external adapters out of the box.

L1 Skill / L2 Profile / L3 Philosophy / Ops are opt-in. Pass only the runtimes for layers in scope. Inactive layer facades will throw StateError when invoked.

Implementation

KnowledgeSystem({
  required this.config,
  KnowledgePorts? ports,
  FactGraphRuntime? factGraph,
  this.skillRuntime,
  this.profileRuntime,
  this.philosophyEngine,
  this.opsRuntime,
  KnowledgeEventBus? eventBus,
})  : ports = ports ?? const KnowledgePorts(),
      factGraph = factGraph ?? FactGraphRuntime.inMemory(
        defaultWorkspaceId: config.workspaceId,
      ),
      eventBus = eventBus ?? KnowledgeEventBus() {
  _initialize();
}