AI Assistant

The AI assistant operates within the browser interface and also provides a Command Line Interface (CLI) that can be accessed either from the host or within a space.

The Assistant’s Chat Interface
The assistant requires access to an external Large Language Model (LLM) that supports the OpenAI API.


Enabling the Chat Interface

To enable the chat interface, add the following configuration to the knot.toml file:

[server.chat]
enabled = true
type = "openai"                              # API protocol: openai, anthropic, google, ollama
provider = "ollama"                          # provider preset: openai, claude, gemini, ollama, mistral, zai
base_url = "http://localhost:8085/v1/"
api_key = ""
model = "Qwen3-4B-Thinking-2507-GGUF:Q4_0"
max_tokens = 4096
temperature = 0.7
reasoning_effort = "low"
ui_style = "avatar"
openai_endpoints = true

Configuration Options

  • enabled: Must be set to true to activate the web assistant.
  • type: The AI API protocol used to talk to the LLM — openai (default), anthropic, google, or ollama.
  • provider: A provider preset that fills in sensible defaults — openai, claude, gemini, ollama, mistral, or zai.
  • base_url: The address of the server hosting the LLM. (openai_base_url is a deprecated alias.)
  • api_key: The API key required to authenticate with the LLM server. (openai_api_key is a deprecated alias.)
  • model: The model to be used. The assistant’s performance depends on the selected model.
  • max_tokens: The maximum number of tokens the model may generate per response.
  • temperature: Sampling temperature (0–1).
  • system_prompt_file: Path to a file whose contents are used as the system prompt (see System Prompt).
  • reasoning_effort: Controls the level of effort applied by the model for reasoning, there’s no default. Options are:
    • none
    • low
    • medium
    • high
  • ui_style: Defines the style of the assistant’s chat icon. Options are:
    • avatar (default)
    • icon
  • openai_endpoints: If set to true, the Knot server will expose an OpenAI-compatible endpoint at the /v1/ path. This allows any client to connect to the Knot server, chat with the assistant, and use tools.

If you are using a non-thinking model then do not set reasoning_effort in the configuration as usually this will stop the model from working.


Tool Approvals

When the web assistant wants to run a write-capable tool, Knot pauses the tool call and shows a confirmation box at the bottom of the current chat message stream. The user can approve or deny the tool call before it executes.

Approvals are only used by the web chat flow. External MCP clients that connect to /mcp continue to use the normal MCP protocol and are not prompted by the browser approval UI.

Pending approvals are stored in memory on the Knot instance that started the tool call. In clustered deployments behind a load balancer, the approval request includes the originating instance ID. If the approval response reaches a different Knot instance, Knot forwards it to the origin over cluster gossip.


Supported Models

The assistant is confirmed to work with the following models:

  • gpt-oss 20B (via LM Studio)
  • Gemini 2.5 Flash