Ask AI

Questions about the estate answered by a language model you configure, through 14 fixed read-only tools with the asking user's permissions and scope.

On this page

Status. Tested: both providers' wire formats, the text and native tool protocols, every tool under scoped and unscoped principals, redaction, budgets and rate limits, streaming, stop and drain, against fake model servers in the product's package tests on PostgreSQL. Not yet run: against a real hosted model API or a real self-hosted model server.

Ask AI answers questions about the estate ("which hosts run OpenSSL 3.0.13?", "what changed on lnx-dc1-db-01.example.net last week?") with a language model that looks data up through fixed, read-only tools. It is off until you configure a model, and nothing else in Structam depends on it. No model is bundled.

Enabling it

Save the model on Integrations → Ask AI (integrations.manage), or set STRUCTAM_LLM_* (configuration reference); a saved setting replaces the environment.

ProviderSTRUCTAM_LLM_PROVIDERBase URLKey
Anthropic Messages APIanthropichttps://api.anthropic.com (default)required
Any OpenAI-compatible chat completions API, hosted or on your own hardwareopenaithe API root including its version path, for example http://192.0.2.5:8000/v1optional
STRUCTAM_LLM_PROVIDER=openai
STRUCTAM_LLM_BASE_URL=http://192.0.2.5:8000/v1
STRUCTAM_LLM_DEFAULT_MODEL=your-model

Set STRUCTAM_LLM_DEFAULT_MODEL, and STRUCTAM_LLM_MODELS to limit the choice. Test on the settings page checks the URL, the key and the model list. Users need the permission assistant.use (the built-in operator role has it). The model API is called over plain HTTPS from the server, through the outbound proxy settings; there is no vendor SDK.

Tool calling uses a text protocol that works with every server; STRUCTAM_LLM_NATIVE_TOOLS=on uses the provider's native tool calling instead. An answer takes at most STRUCTAM_LLM_MAX_STEPS (8) rounds of up to four tool calls.

What the model sees, and what leaves the installation

The model gets the question and the results of the tools it calls, nothing else. Data leaves the installation only to the configured model API: with a model on your own hardware nothing leaves; with a hosted model, the host names, addresses, software, change and audit data in those results do.

  • Tools are fixed read-only queries: search_hosts, get_host, list_host_applications, estate_applications, application_detail, find_by_hash, list_changes, get_change, config_history, config_diff, list_agents, netbox_drift, audit_search and licence_compliance. Each needs a permission and is hidden from the model and refused without it. Every tool runs in a read-only transaction with a 15 s statement timeout.
  • Scope: a tool sees a host only where the user holds the tool's permission and assistant.use, so a scoped assistant.use grant narrows the assistant below what the user may otherwise view.
  • Redaction: values that look like secrets are redacted before they go, and results are clipped (600 characters a value, 14 kB a result). Configuration diffs need configs.content and stay redacted unless the saved setting send_config_content is on. That switch has no environment variable: it can only be turned on in the setting, where every change is audited.

Note. The model is not trusted. It may be wrong, and text it reads (package descriptions, configuration files, audit messages) may try to instruct it. It can only call these tools, with the user's permissions and scope, so the worst a manipulated model can do is show the user data the user may already see, or spend their token budget.

Limits and audit

LimitDefaultSetting
Questions per user per minute (across nodes)6STRUCTAM_LLM_REQUESTS_PER_MINUTE
Tokens per user per UTC day2 000 000STRUCTAM_LLM_DAILY_TOKEN_BUDGET (0 = unlimited)
Tokens per conversation1 000 000STRUCTAM_LLM_CONVERSATION_TOKEN_BUDGET (0 = unlimited)
One model call180 sSTRUCTAM_LLM_TIMEOUT
Answers at once per node8

Budgets are reserved before each call, so several nodes cannot overspend them.

Every question writes one assistant.ask audit event (question, model, each tool with its arguments and outcome, token counts, duration), also when the answer fails or is stopped. Conversations belong to their user; API tokens cannot use Ask AI. An answer that drew on a host the user can no longer see is hidden when the conversation is opened again.

Answers stream as server-sent events (POST /api/v1/assistant/ask); the reverse proxy must not buffer them.

From the command line

structam assistant tools                                              # the tools and what they need
structam assistant tool get_host '{"host": "lnx-dc1-db-01.example.net"}'   # what the model would see
structam assistant ask -user alice "Which hosts run an end-of-life OS?"

Without -user the command reads the whole estate; with it, it uses that user's grants and budget. Every run is audited.

Questions the docs do not answer?

Ask the people who build Structam. Installation media and licences come from KazLabs.

Talk to us