Product documentation

Runtime engine

How Convoship executes assistant flows — node types, intent matching, knowledge fallback, and instruction agents.

The runtime is a stateless flow walker. Each turn loads the published ConversationFlow (or draft in simulator), walks nodes until awaiting input or session end, and returns bot messages plus debug metadata.

Intent matching order

  1. Welcome event on session start when enabled.
  2. Small talk topics — pattern score before intents.
  3. Substring match on training phrases.
  4. LLM match — full intent classifier when substring misses.
  5. Knowledge fallback — hybrid search when no intent matches.
  6. Fallback event / fallback intent.

Node types (assistant sub-flows)

TypeBehavior
start / endSession entry and termination
intentEntry node for matched intent sub-flow
messageBot text; {{ session.var }} templates; rich UI blocks
entitySlot capture with reprompt and max_attempts
decisionExpression branch on edges
routerMulti-way branch with priority-ordered edge conditions
serviceHTTP tool — real httpx call, JSONPath outputs
pythonSandboxed script — session read/write
setAssign session variable
handoffHuman agent transfer
fallbackDefault branch
subflowInvoke another flow graph
knowledgeHybrid retrieval + optional LLM synthesis from chunks

instruction_agent nodes (workflow graph)

Configured in workflow flow JSON with instructions, tools[], optional model, temperature, max_steps, greeting. Uses AgenticLoop with Claude (Anthropic). Memory persists under session variable _agent_memory_{nodeId}. ToolBridge executes workspace/agent tools registered on the node.

Knowledge nodes

  • Query from static template, last user message, and/or conversation summary.
  • Retriever — vector + keyword hybrid (pgvector + tsvector).
  • synthesize_answer — uses configured LLM provider for answer synthesis.
  • Respects knowledge_fallback_min_score when used as runtime fallback path.

Service nodes

  • Template URL, headers, body with {{ variables }}.
  • Workspace secrets resolved at runtime — never stored in flow JSON.
  • Retries, timeout, JSONPath mapping to session.*.
  • Response body stored on session for simulator trace.
  • Auto-stored at session.<service_id> for downstream access.

Python nodes

  • Sandboxed execution with session, user, workspace, and flow variable scopes.
  • Access to tool_response from the most recent service call in the same turn.
  • print() output appears in the simulator debug trace.
  • Wall-clock timeout enforced (default 2 seconds).

Safety limits

  • 64 steps per turn cycle guard.
  • Python node wall-clock timeout (default 2 seconds).
  • Monthly LLM spend cap per assistant — blocks enrichment and intent LLM matcher.

Agent-level orchestration

The agent runtime sits above the flow engine for multi-intent assistants: tracks the active intent, routes utterances to intent sub-flows, returns to root when a sub-flow completes, and handles welcome/fallback at agent scope.

Workflow graph runtime

Legacy workflows use a dedicated graph runtime (not the engine's intent matching). The simulator walks nodes from triggers/root_agent through agents, knowledge, router/decision branches, tool nodes, nested workflow handoffs, and end nodes.

  • Routing — select_workflow_successor_node evaluates edge condition.expr against last user text and variables.
  • Tool nodes — ToolBridge executes workspace tools; trace event workflow.tool.executed.
  • Sub-workflow — workflow nodes load the referenced graph and enter its first runnable node.
  • Publish validation — rejects script, datastore, set, human, parallel, wait; requires reachable agent/knowledge/end from entries.
  • Chain runtime — workflow_chain_runtime.py runs primitive chains (assistant, agent, webhook, human, decide, notify, schedule) with persisted WorkflowChainRun steps and outbound webhook URL safety checks.