Interface: IAIGatewayConfig
Defined in: types.ts:130
Everything the gateway needs: one config per child, settings and persistence seams only. No class instance is in it; the gateway creates and injects its children itself.
Written by the host application and passed to the AIGateway constructor; createGatewayDeps hands each member to the
child of the same name. A member that is optional has a runtime default of {}: the child runs with its own defaults.
Properties
aiProfileStore
aiProfileStore:
IAIProfileStoreConfig
Defined in: types.ts:134
Where the profiles live: the repository of the AIProfileStore.
contextAssembler
contextAssembler:
IContextAssemblerConfig
Defined in: types.ts:212
How the system prompt is assembled: the prompt-cache switches (promptCaching, sharePromptCacheAcrossTenants) and
the tokens reserved for the answer.
Example
{promptCaching: true, sharePromptCacheAcrossTenants: false} - the stable part of every call is cached, per tenant
defaultCheapModelId
defaultCheapModelId:
string
Defined in: types.ts:222
Platform-wide cheap model for the helper calls (memory, query rewrite, judge) when a profile names none.
embedder
embedder:
IEmbedderConfig
Defined in: types.ts:152
The embedding model, its dimensions and the batch size (Embedder).
fileStore
fileStore:
IFileStoreConfig
Defined in: types.ts:140
Where uploaded files live, the allowed MIME types and the size cap: the FileStore.
guardrails?
optionalguardrails?:IGuardrailsConfig
Defined in: types.ts:203
The application's input and output rules, their timeout and the prompt length cap (Guardrails).
Default
{} - the built-in checks only
humanGate
humanGate:
IHumanGateConfig
Defined in: types.ts:188
How long a pause waits for the human, and whether the model may ask the user a question (HumanGate).
kbIngestor?
optionalkbIngestor?:IKbIngestorConfig
Defined in: types.ts:220
How many documents are ingested at once (KbIngestor).
Default
{}
kbRetriever?
optionalkbRetriever?:IKbRetrieverConfig
Defined in: types.ts:162
How many chunks a knowledge-base search returns and the minimum score (KbRetriever).
Default
{}
llmClient
llmClient:
ILLMClientConfig
Defined in: types.ts:205
The provider credentials, the per-call timeout and the retries of a model call (LLMClient).
mdChunker?
optionalmdChunker?:IMdChunkerConfig
Defined in: types.ts:150
How a Markdown document is cut into chunks (MdChunker): the token bounds of a chunk and the overlap.
Default
{}
modelRegistry
modelRegistry:
IModelRegistryConfig
Defined in: types.ts:132
The models a profile may name, with their caps and prices: the repository of the ModelRegistry.
promptTemplateStore
promptTemplateStore:
IPromptTemplateStoreConfig
Defined in: types.ts:136
Where the prompt templates live, and the templates seeded on the first run: the PromptTemplateStore.
queryRewriter
queryRewriter:
IQueryRewriterConfig
Defined in: types.ts:156
Whether a question is rewritten before the knowledge-base search (QueryRewriter).
runStore
runStore:
IRunStoreConfig
Defined in: types.ts:186
Where paused runs live: the repository of the RunStore.
skillRegistry?
optionalskillRegistry?:ISkillRegistryConfig
Defined in: types.ts:184
What the gateway applies to the skills of every profile and call (D124): the caps maxSkills (default 50) and
maxBodyChars (default 50 000). The skills themselves are on the profile (IAIProfile.skills) and on the call
(IGatewayAskInput.skills), never here.
Default
{}
threadStore
threadStore:
IThreadStoreConfig
Defined in: types.ts:138
Where threads and turns live, and how long a call's lease on a thread holds: the ThreadStore.
toolPolicy?
optionaltoolPolicy?:IToolPolicyConfig
Defined in: types.ts:176
The rules the ToolPolicy applies to every run: which permission unlocks which tools, and the guarded workflows
(requires).
Default
{}
toolRegistry?
optionaltoolRegistry?:IToolRegistryConfig
Defined in: types.ts:169
The application's tools, the tool timeout, the output cap and the error report (ToolRegistry). The gateway adds its
built-in tools (the user-memory tools, dyna_aigw_ask_user_question) in front of them.
Default
{} - no tools of the application; the built-in ones are still there
trace
trace:
ITraceConfig
Defined in: types.ts:214
Where the trace entries live: the repository of the Trace.
usageGuard
usageGuard:
IUsageGuardConfig
Defined in: types.ts:197
The app's usage adapter, asked before every model call and told after it.
The gateway holds no token logic: who may spend what is the app's decision, made in
adapter.check; what was spent is reported toadapter.addUsage.
Example
{adapter: new InMemoryUsageAdapter()} - tests and the sandbox: approves everything, records every call
userMemoryStore
userMemoryStore:
IUserMemoryStoreConfig
Defined in: types.ts:144
The user memory: its switch, its repository, the caps of the facts and the extraction cadence (UserMemoryStore).
vectorStore
vectorStore:
IVectorStoreConfig
Defined in: types.ts:154
Where the chunks and their vectors live (VectorStore).
workingMemory
workingMemory:
IWorkingMemoryConfig
Defined in: types.ts:142
The thread memory: its switch and its strategy (WorkingMemory).