Octopus — The AI Agent Engine
Octopus is the enterprise AI Agent Engine for the BizFirstGO platform. It provides a complete framework for building, deploying, and orchestrating intelligent agents that can reason, remember, use tools, and participate in workflow automation.
What is Octopus?
Octopus is not a simple chatbot wrapper. It is an enterprise-grade AI agent framework built into the BizFirstGO platform. Octopus agents can maintain multi-session memory, call external tools via the Model Context Protocol (MCP), integrate with Flow Studio workflows, and collaborate with other agents to accomplish complex tasks.
Every Octopus agent is defined by three graph-structured composite objects that capture the agent's identity, the active conversation state, and the user interacting with it. This graph model allows the platform to hydrate a complete agent context from a database record with a single lookup.
Octopus agents persist their memory across sessions, respect tenant boundaries, integrate with your business workflows, and can be monitored in real time — enterprise concerns that most AI frameworks ignore.
The Three Composite Objects
AgentComposite
The complete definition of an AI agent: its LLM configuration, memory settings, tool registry, plugin list, system prompt, persona, and behavioral constraints. Agents are created once and reused across many conversations.
ConversationComposite
The stateful session object for one conversation. Contains the message history, working memory context, active tool call history, and references to the agent and user. Created when a session begins and closed when it ends.
UserComposite
The human (or system) interacting with the agent. Contains user identity, preferences, accessible agents, tenant membership, and links to conversation history. Users can have multiple concurrent conversations with different agents.
Four Memory Types
Octopus provides four distinct memory systems, each optimized for a different kind of recall:
| Memory Type | What It Stores | Storage | Lifetime |
|---|---|---|---|
| Working | Current conversation context window | In-process (RAM) | One session |
| Episodic | Past conversation history by session | SQL Server | Configurable TTL |
| Semantic | Knowledge embeddings (vector DB) | Qdrant / PGVector | Persistent |
| Procedural | Learned skill sequences and tool patterns | SQL Server | Persistent |
Five Built-In Plugins
Octopus is extended through plugins. Five plugins are built into the platform:
| Plugin | Adds | Required For |
|---|---|---|
| SqlServerStorage | SQL persistence for all memory types | Production deployments |
| SemanticKernel | Microsoft SK LLM routing and planner | SK-based LLM integration |
| WebDriver | Browser automation tools (Playwright) | Web scraping agents |
| ChatbotUI | Embeddable chat widget (SSE streaming) | End-user chat interfaces |
| Process | Flow Studio workflow integration | Agent-workflow collaboration |
Agent Reasoning Loop
Receive User Message
The agent receives a user message via the ChatbotUI plugin or direct API call. A ConversationComposite is created or resumed.
Assemble Working Memory
MemoryOrchestrator queries episodic memory (past turns), semantic memory (relevant knowledge), and procedural memory (matching procedures). Results are assembled into the context window.
Call LLM
The full context — system prompt + retrieved knowledge + message history + current message — is sent to the configured LLM provider via ILLMProvider.CompleteAsync().
Handle Tool Calls
If the LLM response contains tool call directives, Octopus executes each tool via the MCP tool registry. Results are appended to the message history and the LLM is called again.
Return Response
The final text response is streamed to the user via Server-Sent Events. The episode (user turn + assistant response) is persisted to episodic memory.
LLM Provider Abstraction
Octopus does not hard-code to any single AI provider. The ILLMProvider interface abstracts all LLM calls:
public interface ILLMProvider
{
Task<LLMResponse> CompleteAsync(
IReadOnlyList<LLMMessage> messages,
IReadOnlyList<ToolDefinition>? tools,
LLMOptions options,
CancellationToken cancellationToken = default);
Task StreamAsync(
IReadOnlyList<LLMMessage> messages,
IReadOnlyList<ToolDefinition>? tools,
LLMOptions options,
Func<LLMStreamChunk, Task> onChunk,
CancellationToken cancellationToken = default);
}
How Octopus Connects to Flow Studio
Octopus and Flow Studio are bidirectional partners:
- Agents → Workflows: An Octopus agent can call the
start_workflowMCP tool to trigger any Flow Studio process by name, passing input data and optionally waiting for the result. - Workflows → Agents: Flow Studio has a built-in AI Agent Node — a workflow node that calls an Octopus agent with a prompt and uses the agent's response as the node output.
- Agent as HIL Actor: An Octopus agent can claim and respond to Human-In-the-Loop (HIL) tasks in WorkDesk, acting as an automated approval or processing step.