Portal Community

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

ColumnTypeConstraintsDescription
AgentIduniqueidentifierPK, NOT NULLGUID primary key. Generated server-side using NEWSEQUENTIALID() for index-friendly insertion order.
TenantIdintNOT NULL, IXTenant discriminator. Part of every compound index on this table.
Namenvarchar(200)NOT NULL, UNIQUE(TenantId, Name)Human-readable unique name within the tenant. Used in API calls and logs.
SystemPromptnvarchar(max)NULLThe instructional context injected as the first system message of every conversation. Can be multi-paragraph.
PluginRefsnvarchar(max)NULLJSON array of plugin identifiers: ["sql-server", "web-driver", "mcp-tools"]
Confignvarchar(max)NULLJSON object with model configuration. See Config JSON schema below.
VersionintNOT NULL, DEFAULT 1Incremented each time the agent definition is updated. Used for optimistic concurrency and cache invalidation.
Statusnvarchar(50)NOT NULLLifecycle status: Active, Inactive, Draft, Deprecated.
CreatedAtdatetime2NOT NULLUTC timestamp of initial registration.
UpdatedAtdatetime2NOT NULLUTC 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"
}
FieldTypeDefaultDescription
modelIdstringgpt-4oThe LLM model identifier passed to the AI provider
temperaturefloat0.7Controls response randomness (0 = deterministic, 2 = very random)
maxTokensint4096Maximum tokens in the model response
contextWindowLimitint32000Total token budget for the context window — older episodes are dropped when this limit is approached
memoryStrategyIdstringsliding-windowWhich 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

D

Draft

Agent is being configured — cannot accept conversations yet. Use this status while iterating on system prompts and plugin selection.

A

Active

Agent is live and accepting conversations. The framework will load this agent's config and allow session creation.

I

Inactive

Agent is temporarily paused. Existing sessions can complete but no new sessions can be started. Use for maintenance windows.

X

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';
Cache Invalidation via Version

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.