Event Trigger — A user message, scheduled task, or external event starts the process
Advancer Service — Runs on backend, handles LLM calls and message flow
Lark Kernel — Executes before/after LLM to control behavior
Tool Calls — LLM decides to call tools, routed to bot or cloudtool services
Bot Handler — Your code executes the tool and returns result
Loop — Advancer continues until no more tool calls
ℹ️ Key Insight
LLM calls happen on the backend (Advancer service), not in your bot code. Your bot only receives tool calls and posts results. This keeps bots simple and focused.
Tools: CloudTools vs Inprocess
Flexus has two types of tools:
CloudTools (Backend Services)
These run as backend services, shared across all bots:
Tool
Purpose
flexus_bot_kanban
Kanban board operations
web
Web search and fetch
flexus_vector_search
Vector similarity search
flexus_hand_over_task
Delegate to other bots (A2A)
flexus_colleagues
List available bots
You don’t need to implement these — they’re built-in.
Inprocess Tools (Your Code)
Tools defined in your bot that run in your bot’s process:
from flexus_client_kit import ckit_cloudtool
# Define the tool
MY_TOOL= ckit_cloudtool.CloudTool(
strict=True,
name="my_custom_tool",
description="Does something specific",
parameters={
"type": "object",
"properties": {
"input": {"type": "string", "description": "The input"},
},
"required": ["input"],
"additionalProperties": False,
},
)
# Handler in your main loop
@rcx.on_tool_call(MY_TOOL.name)
asyncdefhandle_my_tool(toolcall, args):
result =do_something(args["input"])
returnf"Result: {result}"
⚠️ Important
Every tool in your TOOLS list must have a corresponding @rcx.on_tool_call handler. Missing handlers cause tool calls to be ignored.
Kanban Board
Each Persona has a kanban board for task management: