Octopus_Agents Table
The agent registry table — every AI agent that can run in the Octopus framework must have a record here. This table holds the agent's identity, system prompt, plugin access list, and runtime configuration.
Purpose of the Table
Before an Octopus agent can process a conversation, the framework looks up its configuration in Octopus_Agents. This table is the source of truth for agent identity and capability. A missing or inactive agent record means no conversations can start for that agent.
The table is read-heavy at runtime (agent config is cached in memory after the first load) and write-light (agents are registered and updated infrequently compared to episode writes).
Column Reference
| Column | Type | Constraints | Description |
|---|---|---|---|
AgentId | uniqueidentifier | PK, NOT NULL | GUID primary key. Generated server-side using NEWSEQUENTIALID() for index-friendly insertion order. |
TenantId | int | NOT NULL, IX | Tenant discriminator. Part of every compound index on this table. |
Name | nvarchar(200) | NOT NULL, UNIQUE(TenantId, Name) | Human-readable unique name within the tenant. Used in API calls and logs. |
SystemPrompt | nvarchar(max) | NULL | The instructional context injected as the first system message of every conversation. Can be multi-paragraph. |
PluginRefs | nvarchar(max) | NULL | JSON array of plugin identifiers: ["sql-server", "web-driver", "mcp-tools"] |
Config | nvarchar(max) | NULL | JSON object with model configuration. See Config JSON schema below. |
Version | int | NOT NULL, DEFAULT 1 | Incremented each time the agent definition is updated. Used for optimistic concurrency and cache invalidation. |
Status | nvarchar(50) | NOT NULL | Lifecycle status: Active, Inactive, Draft, Deprecated. |
CreatedAt | datetime2 | NOT NULL | UTC timestamp of initial registration. |
UpdatedAt | datetime2 | NOT NULL | UTC timestamp of last modification. Updated by EF Core on every save. |
Config JSON Schema
The Config column holds a JSON object that controls how the agent calls the underlying LLM:
{
"modelId": "gpt-4o",
"temperature": 0.7,
"maxTokens": 4096,
"topP": 1.0,
"frequencyPenalty": 0.0,
"presencePenalty": 0.0,
"contextWindowLimit": 32000,
"memoryStrategyId": "sliding-window",
"responseFormat": "text"
}
| Field | Type | Default | Description |
|---|---|---|---|
modelId | string | gpt-4o | The LLM model identifier passed to the AI provider |
temperature | float | 0.7 | Controls response randomness (0 = deterministic, 2 = very random) |
maxTokens | int | 4096 | Maximum tokens in the model response |
contextWindowLimit | int | 32000 | Total token budget for the context window — older episodes are dropped when this limit is approached |
memoryStrategyId | string | sliding-window | Which memory retrieval strategy to use: sliding-window, semantic-recall, full-history |
PluginRefs JSON Schema
The PluginRefs column is a JSON array of plugin identifiers. The Octopus framework resolves these identifiers to registered plugin implementations at agent initialization time:
["sql-server", "web-driver", "semantic-kernel", "mcp-brave-search"]
Only plugins in this list are available to the agent. If a plugin is listed but not registered in the plugin registry, initialization fails with a descriptive error.
Status Lifecycle
Draft
Agent is being configured — cannot accept conversations yet. Use this status while iterating on system prompts and plugin selection.
Active
Agent is live and accepting conversations. The framework will load this agent's config and allow session creation.
Inactive
Agent is temporarily paused. Existing sessions can complete but no new sessions can be started. Use for maintenance windows.
Deprecated
Agent has been superseded by a newer version. Historical records are preserved but no new sessions are permitted. Data is retained for audit purposes.
Common Queries
-- List all active agents for a tenant
SELECT AgentId, Name, Version, UpdatedAt
FROM Octopus_Agents
WHERE TenantId = @tenantId
AND Status = 'Active'
ORDER BY Name;
-- Find agents using a specific plugin
SELECT AgentId, Name
FROM Octopus_Agents
WHERE TenantId = @tenantId
AND JSON_QUERY(PluginRefs) LIKE '%sql-server%'
AND Status = 'Active';
-- Get full agent config for runtime initialization
SELECT AgentId, Name, SystemPrompt, PluginRefs, Config, Version
FROM Octopus_Agents
WHERE TenantId = @tenantId
AND AgentId = @agentId
AND Status = 'Active';
The Octopus runtime caches agent configuration in memory keyed by (TenantId, AgentId). When an agent record is updated, the Version column is incremented. The cache checks for version mismatches and reloads the config when a newer version is detected. Always let the application layer update agents — do not update directly in SQL, as the cache will not be notified.