A QiForge oracle is oneDocumentation Index
Fetch the complete documentation index at: https://docs.ixo.world/llms.txt
Use this file to discover all available pages before exploring further.
main.ts that calls createOracleApp. The runtime boots a NestJS app, loads bundled + your plugins, validates env, builds the agent graph, and starts HTTP when you call listen().
Reference implementation: apps/qiforge-example/src/main.ts. Source: packages/oracle-runtime/src/bootstrap/create-oracle-app.ts.
Minimal main.ts
autoDetect(env) and the ones whose env is present load.
The recipe
Write your config
Put
OracleConfig in its own file so tests can import it without booting the runtime.entityDid is sourced from the ORACLE_ENTITY_DID env var — never put it in config. The prompt block is composed into the system prompt; absent fields fall back to runtime defaults. Source: plugin-api/types.ts (search OracleConfig).Add your plugins
Bundled plugins flow in automatically from The loader dedupes by
BUNDLED_PLUGINS — each runs its own autoDetect(env). Only list the ones you wrote yourself or bundled plugins that need constructor args:name, so an explicit instance overrides the bundled default of the same name. Source: bootstrap/plugin-loader.ts.Toggle bundled plugins with features
Override
Omitted keys are treated as
autoDetect:| Value | Meaning |
|---|---|
true | Force on. Skip autoDetect. |
false | Force off. Skip even if autoDetect would say yes. |
'auto' | Default. Run autoDetect(env). |
'auto'. Recipe: Enable bundled plugins.Mount your own Nest modules
Custom HTTP endpoints, event consumers, admin dashboards — anything that doesn’t fit the plugin model goes in
nestModules. Each gets full DI access to runtime services (Sessions, Messages, Secrets, UCAN, Auth, …).Exclude routes from auth
Every route defaults to going through Symmetric with each plugin’s
AuthHeaderMiddleware (requires x-ucan-delegation). Opt routes out via authExcludedRoutes:getAuthExcludedRoutes(). Both merge onto the runtime’s built-ins (/health, /docs). Recipe for the plugin side: Add HTTP endpoints.Customise the agent graph (optional)
hooks overrides the agent-build defaults. Every field is optional:| Hook | Default | What it overrides |
|---|---|---|
checkpointerForUser(did) | per-user SQLite synced to Matrix | Swap in your own BaseCheckpointSaver |
resolveModel(role, params) | ambient.llm.get(role) | LLM resolver |
getRoomTitle(roomId) | undefined | Page-context middleware lookup |
safetyModel | safety-guardrail default | Cheap classifier for the safety middleware |
validationSkipToolNames | [] | Tool names whose ToolMessage is stripped between turns |
operationalMode | runtime default | Operating-mode prompt block |
editorSection | populated by editor plugin | Editor prompt block |
composioContext | populated by composio plugin | Composio guidance block |
userSecretsContext | empty | Per-key secret bullet list |
degradedServicesBlock | empty | Degraded-services notice appended to system prompt |
graph/main-agent-types.ts (search MainAgentHooks).Run a beforeListen hook
Run setup that must complete before HTTP starts accepting:Hooks run sequentially in registration order.
Observe plugin lifecycle
onPluginStatusChange fires when Matrix transitions pending → loaded (or failed). onError catches Matrix init + lifecycle errors. plugins.status() returns the same shape qiforge inspect prints.All options at a glance
Full example
Where to read next
Write a plugin
End-to-end Weather plugin walkthrough.
Enable bundled plugins
The
features map in detail.createOracleApp reference
Flat reference table for every field.
Environment variables
Core + per-plugin env vars.