Module System
Vorte's architecture is built around a modular plugin system. Every major feature — AI, auth, database, caching, queues — is a module that can be loaded, configured, and replaced independently.
Module Class
All modules inherit from BaseModule and declare metadata through ModuleMeta. The framework uses this metadata to resolve dependencies, determine load order, and report status.
ModuleMeta
ModuleMeta is a Pydantic model that describes a module to the framework. Every field is optional except name.
| Field | Type | Required | Description |
|---|---|---|---|
name | str | Yes | Unique module identifier used in config and CLI |
description | str | No | Human-readable description |
version | str | No | Semantic version string |
priority | ModulePriority | No | Load order priority, defaults to NORMAL |
dependencies | list[str] | No | Names of modules that must load first |
optional | bool | No | If True, load failure does not crash the app |
tags | list[str] | No | Categorization tags for filtering |
ModulePriority
Modules are loaded in priority order. Lower values load first. Core infrastructure modules load before application-level modules.
| Priority Level | Value | Typical Modules |
|---|---|---|
CRITICAL | 10 | Config, logging, error handling |
HIGH | 20 | Database, cache, serialization |
NORMAL | 30 | Auth, routing, DI container |
LOW | 40 | AI, agents, queue, storage |
DEFERRED | 50 | GraphQL, dashboard, metrics |
ModuleState
Each module transitions through a defined state machine during its lifecycle.
| State | Description |
|---|---|
UNLOADED | Module has been discovered but not yet loaded |
LOADING | Module is currently executing its on_load hook |
LOADED | Module has finished loading but is not yet active |
STARTING | Module is executing its on_start hook |
READY | Module is fully operational and accepting requests |
STOPPING | Module is gracefully shutting down |
STOPPED | Module has been stopped and is inactive |
ERROR | Module encountered an error during any transition |
Custom Module Example
Below is a complete example of a custom notification module with configuration, dependency injection, and lifecycle hooks.
Registering a Custom Module
Place your module in the modules/ directory of your project. Auto-discovery scans this directory and registers allBaseModule subclasses.
Alternatively, register a module programmatically when you need fine control over instantiation.
Built-in Modules
Vorte ships with 21 production-ready modules:
| Module | Priority | Dependencies |
|---|---|---|
ai | LOW | cache, serialization |
agents | LOW | ai, database |
auth | NORMAL | database, serialization |
cache | HIGH | serialization |
database | HIGH | serialization |
graphql | DEFERRED | routing, database |
queue | LOW | database, cache |
storage | LOW | serialization |