Extensions
Extensions are optional capabilities you configure per-session at creation time. They control what the model can do beyond basic conversation — call tools, search documents, or access external providers.
What extensions are
When you create a session, pass a
customizations body with the agent and its extensions:
await fetch(`${BASE_URL}/v1/sessions`, {
method: "POST",
headers,
body: JSON.stringify({
customizations: {
product: "my-app",
agentId: "RfsAgent",
extensions: {
tools: { /* Record<string, ToolDefinition> */ },
rag: { /* document retrieval config */ },
mcpProviders: [ /* external provider names */ ],
},
},
}),
});Each extension is independently optional. Use only what your product needs — a simple chatbot might skip all of them, while a full agent might use all three.
Tools
Client-supplied tool definitions tell the model what functions it can call during the conversation. When the model decides to use a tool, your client is responsible for executing it and returning the result.
extensions: {
tools: {
getLocations: {
name: "getLocations",
description: "Retrieves warehouse locations",
requestArgs: {
properties: {
includeInactive: { type: "boolean" },
},
},
responseShape: {
properties: {
locations: { type: "array" },
},
},
},
},
}extensions.tools is a record keyed by tool name (the schema is
Record<string, ToolDefinition>), not an array.
See Concepts: Tools for the full schema and naming conventions.
Client-supplied tools are in addition to any tools loaded from MCP providers. Both sources are merged and presented to the model together.
RAG (retrieval-augmented generation)
RAG allows the model to search document indexes as part of generating a response. Configure it to ground the model's answers in specific documentation, knowledge bases, or content collections.
extensions: {
rag: {
indexes: ["platform-docs"],
prefetchEnabled: false,
maxResults: 10,
tagFilter: {
include: { productCode: ["ns"] },
exclude: { productCode: ["oc"] },
},
},
}Configuration
indexesstring[]requiredWhich vector indexes to search. Each index is a named collection of
embedded documents. Example: ["platform-docs", "release-notes"].
prefetchEnabledbooleanWhether to prefetch relevant documents when the session is created
(before the first message). Useful for contexts where you know what the
user will ask about. Default: false.
maxResultsnumberMaximum number of documents to retrieve per query. Higher values give the model more context at the cost of latency and token usage. Default varies by index.
tagFilterobjectFilter documents by metadata tags. Useful for scoping results to a specific product, version, or content category.
tagFilter.includeRecord<string, string[]>Only return documents whose tags match any of the specified values
for each key. Example: { productCode: ["ns", "common"] }.
tagFilter.excludeRecord<string, string[]>Exclude documents whose tags match any of the specified values. Exclusion takes priority over inclusion.
How RAG works at runtime
- User sends a message.
- The server embeds the query and searches the configured indexes.
- Matching documents (up to
maxResults) are injected into the model's context as grounding material. - The model generates a response informed by the retrieved documents.
Use tagFilter to avoid polluting results with irrelevant content. For
example, a NetSuite-focused agent should exclude Oracle Cloud docs.
MCP providers
MCP (Model Context Protocol) providers are tool sources brokered by the platform's MCP gateway. Enable them by name to give the model access to their tools without defining schemas yourself.
extensions: {
mcpProviders: ["netsuite"],
}When MCP providers are enabled:
- The inference server calls the platform's MCP gateway to load tool definitions for each provider.
- Those tools are added to the model's available tool set.
- When the model calls an MCP tool, the server routes the call through the gateway — your client doesn't handle execution.
The MCP gateway is RFS-operated. It has a pluggable provider registry, but today NetSuite is the only registered base provider. Additional providers can be added to the gateway but haven't been opened up for general use yet.
MCP provider tools are server-handled — heartbeats are emitted by the gateway, so these tools survive client disconnects. Client-supplied tools heartbeat from the device that picked up the call and stop if that device disconnects. See Concepts: Tools — Heartbeats.
Combining extensions
Extensions compose freely. A typical production session might use all three:
await fetch(`${BASE_URL}/v1/sessions`, {
method: "POST",
headers,
body: JSON.stringify({
customizations: {
product: "warehouse-agent",
agentId: "RfsAgent",
extensions: {
// Client handles these tools via heartbeat/response
tools: {
getLocations,
getBinContents,
createTransfer,
},
// Model can search docs for context
rag: {
indexes: ["platform-docs"],
maxResults: 10,
tagFilter: { include: { productCode: ["ns"] } },
},
// Server-handled tools brokered by the MCP gateway
mcpProviders: ["netsuite"],
},
},
}),
});The model sees all tools (client-supplied + MCP) and can use RAG alongside tool calls. The routing is transparent — your client only handles tools it defined.