Application Bootstrap¶
The ui.app module contains the dependency wiring for the full application. create_application() is the single function that assembles all services, registries, and the Qt window, then returns a ready-to-run application.
Wiring Diagram¶
graph TD
R["SqliteGraphRepository(:memory:)"]
E["GraphEngine(repository)"]
TR["TypeRegistry"]
MR["ModuleRegistry"]
ML["ModuleLoader"]
GS["GraphService(engine, type_registry)"]
WS["WorkspaceService()"]
EB["AppEventBus"]
MW["MainWindow(module_registry, graph_service, workspace_service, event_bus)"]
R --> E
E --> GS
TR --> GS
ML --> TR
ML --> MR
GS --> MW
WS --> MW
MR --> MW
EB --> MW
Runtime Module Loading¶
create_application() no longer imports concrete modules directly. It loads them through ModuleLoader, which reads modules.yaml and then registers loaded graph types into TypeRegistry and loaded descriptors into ModuleRegistry.
Lookup order:
KNOWLEDGE_PLATFORM_MODULES_FILE~/.knowledge_platform/modules.yaml- the packaged default config
Example:
Host Persistence Model¶
The bootstrap still creates an in-memory repository for the initial engine, but the running app switches GraphService over to the selected workspace repository when a workspace is created or opened. In practice, user graphs persist in the workspace SQLite file.
API Reference¶
knowledge_platform.ui.app.create_application ¶
Wire all services and return a ready-to-run application.
Returns:
| Type | Description |
|---|---|
QApplication
|
A tuple of (:class: |
MainWindow
|
|