AI Chat Assistant
Pilot includes a built-in AI chat assistant that can help you monitor, diagnose, plan, and operate your Kafka cluster through natural language conversations.
Overview
The chat assistant uses Anthropic, OpenAI, or compatible local models combined with Pilot’s full tool catalog to answer questions about your cluster, run diagnostics, and execute operations. You confirm every change before it runs.
The assistant panel stays open after a browser refresh and restores the active conversation.
Configuration
PILOT_CHAT_ENABLED=true
PILOT_CHAT_PROVIDER=anthropic # "anthropic" or "openai"
PILOT_CHAT_API_KEY=sk-ant-... # Required
PILOT_CHAT_MODEL=claude-haiku-4-5-20251001 # Model to useAnthropic models use the native Messages API.
Optional Settings
| Variable | Default | Description |
|---|---|---|
PILOT_CHAT_BASE_URL | "" | Override API endpoint (self-hosted models, Azure OpenAI) |
PILOT_CHAT_OPENAI_API | auto | OpenAI API selection: auto, responses, or chat_completions |
PILOT_CHAT_MAX_TOKENS | 4096 | Maximum response tokens |
PILOT_CHAT_MAX_CONTEXT_TOKENS | 30000 | Estimated context budget for history, tool catalog, and system prompt (min 4096) |
PILOT_CHAT_MAX_TOOL_RESULT_CHARS | 8000 | Maximum characters of a tool result kept in the conversation (min 1000) |
PILOT_CHAT_APPROVAL_TIMEOUT | 5m | Time window to approve/reject mutations |
PILOT_CHAT_RATE_LIMIT | 20 | Messages per minute per user |
PILOT_CHAT_MAX_CONVERSATIONS | 10 | Maximum conversations per user |
PILOT_CHAT_CONVERSATION_TTL | 24h | Conversation expiry |
Pilot does not expose a reasoning-effort setting. Responses and Anthropic requests use the selected model’s defaults.
OpenAI
Set PILOT_CHAT_PROVIDER=openai. The default PILOT_CHAT_OPENAI_API=auto uses Responses for GPT-5 and GPT-6 model names, including Astra, and Chat Completions for other models. Select responses or chat_completions explicitly when your endpoint requires it. This setting does not affect Anthropic.
PILOT_CHAT_ENABLED=true
PILOT_CHAT_PROVIDER=openai
PILOT_CHAT_API_KEY=<openai-api-key>
PILOT_CHAT_MODEL=gpt-6-astra
PILOT_CHAT_OPENAI_API=autoAzure OpenAI
Set PILOT_CHAT_PROVIDER=openai and point PILOT_CHAT_BASE_URL at your Azure resource with the trailing /openai path segment. Pilot appends /v1/responses or /v1/chat/completions according to the selected API:
PILOT_CHAT_PROVIDER=openai
PILOT_CHAT_BASE_URL=https://<resource>.openai.azure.com/openai
PILOT_CHAT_API_KEY=<azure-openai-api-key>
PILOT_CHAT_MODEL=<deployment-name> # Azure deployment name; must support tool calling
PILOT_CHAT_OPENAI_API=responses # For GPT-5/GPT-6 deployment aliasesThe deployment must support the selected API. Set responses explicitly for GPT-5/GPT-6 deployments with custom aliases to route directly to Responses.
See Environment Variables - Azure OpenAI for details, including corporate CA setup (SSL_CERT_FILE) for TLS-intercepting proxies.
Local and OpenAI-Compatible Models
Use the openai provider with a server and model that support streaming Chat Completions and function tools:
PILOT_CHAT_ENABLED=true
PILOT_CHAT_PROVIDER=openai
PILOT_CHAT_BASE_URL=http://localhost:11434
PILOT_CHAT_API_KEY=local # Replace if the server requires authentication
PILOT_CHAT_MODEL=<model-name>
PILOT_CHAT_OPENAI_API=chat_completionsUse an address reachable from Pilot and omit /v1 from the base URL; Pilot appends /v1/chat/completions. Pilot requires a non-empty API key, so use a placeholder such as local for servers without authentication. Compatibility depends on the server’s API and the model’s tool support.
Capabilities
Monitor & Diagnose
- “Show me the cluster health”
- “Which topics have under-replicated partitions?”
- “What’s the consumer lag for my-consumer-group?”
For “what is wrong?” and “is the cluster healthy?”, the assistant answers from the cluster conditions, the same list the REST API and MCP return.
Plan & Simulate
- “Generate a rebalancing proposal”
- “What would happen if broker 3 goes down?”
- “Analyze the blast radius of losing rack-a”
Operate & Manage (Requires Approval)
- “Update the retention for topic X to 7 days”
- “Apply the latest rebalancing proposal”
- “Put broker 3 into maintenance mode”
Audit & Control
- “Show me the last 10 audit events”
- “What changes were made today?”
Mutation Approval
Any operation that modifies cluster state requires explicit user approval:
- The assistant proposes an action
- The user sees the exact operation, for some changes also its effect, and can approve or reject
- If approved within the timeout window, the operation executes
- The result is reported back in the conversation
For topic configuration changes, ACL deletions, and consumer group offset resets and deletions, the confirmation shows the effect before you approve and marks changes that remove data, offsets or access as destructive:
| Change | Effect shown |
|---|---|
| Topic configuration change | Each value before and after. A lower retention.ms shows about how many records become eligible for deletion (Kafka deletes whole segments), a lower retention.bytes about how much data is deleted, and a cleanup.policy change what compaction or deletion removes |
| ACL deletion | The ACLs and principals the deletion removes |
| Consumer group offset reset | How far the reset moves the group. Forward skips records, backward reads them again |
| Consumer group deletion | The group’s state, members and committed offsets. Kafka refuses to delete a group that has members |
When Pilot cannot determine the effect, the confirmation says so and still offers the approval.
The assistant does not depend on PILOT_MCP_WRITE_ENABLED, which controls only external MCP clients.
Only the user who owns the conversation can approve or reject its pending actions. The audit log records that user as the approver, with method CHAT.
Pilot checks the license again when an action is approved. An action approved after the license expired is refused with the license error and not executed. A cancel (cancel_reassignment) needs no license and runs when approved.
Approved operations run independently of the chat connection and have no time limit: a reassignment runs until every planned move is done. Closing chat or changing pages does not cancel them; use the Execution view to cancel a running reassignment. After reconnecting, you can continue the same conversation and ask about the operation’s status.
While processing a message, Pilot shows a progress indicator.
If the stream disconnects or stops responding, Pilot shows an error. Chat requests and cluster operations are not automatically resubmitted. Check the conversation and operation status before repeating a mutation.
Data Sent to the Model Provider
The assistant is off by default. When it is on, Pilot sends the provider you configure a summary of the cluster state, your prompts, and the results of the tools the assistant calls. Tool results can hold message keys, values and headers (browse_messages, get_message), ACLs, and user IDs from the audit log. Calinora receives none of it.
- You choose the provider and conclude any agreement your data needs with it. A local or self-hosted model keeps the data in your network.
PILOT_CHAT_MAX_TOOL_RESULT_CHARScaps how much of each tool result the conversation keeps.
API Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/v1/chat/status | Check if chat is enabled |
POST | /api/v1/chat/conversations | Create a conversation |
GET | /api/v1/chat/conversations | List conversations |
GET | /api/v1/chat/conversations/{id} | Get conversation with messages |
DELETE | /api/v1/chat/conversations/{id} | Delete a conversation |
POST | /api/v1/chat/conversations/{id}/messages | Send message (SSE streaming) |
POST | /api/v1/chat/conversations/{id}/approve/{toolCallId} | Approve mutation |
POST | /api/v1/chat/conversations/{id}/reject/{toolCallId} | Reject mutation |
Responses are streamed via Server-Sent Events (SSE) for real-time output.