Queue AIops
Governed AI-ops for redis + rabbitmq. queue-aiops is for the team running their own cache and message broker — a redis that "suddenly eats memory", a rabbitmq whose queues quietly grow until publishers block — without an enterprise observability suite. It gives an AI agent (or a human at the CLI) a governed toolset over both: transparent root-cause analyses for memory pressure, latency, queue backlog, and connection churn, plus the handful of writes an operator actually needs (config set, client kill, purge/delete queue, policies) — every call audited, budgeted, risk-tiered, and undo-recorded by the built-in governance harness.
Disclaimer: Community-maintained open-source project, not affiliated with, endorsed by, or sponsored by the Redis or RabbitMQ projects or their respective owners. Redis and RabbitMQ are trademarks of their respective owners.
Verification: behaviour is covered by a mock-based test suite; not yet validated against live brokers. Both redis and rabbitmq are free/self-hostable (one lab container or package install each), so a lab check is easy —
queue-aiops doctoris the fastest live probe, and docs/VERIFICATION.md is the checklist.
Quick start
uv tool install queue-aiops
queue-aiops init # wizard: pick platform (redis/rabbitmq), host/port, encrypted secret
queue-aiops doctor # config + secret + connectivity check (PING / /api/overview)
queue-aiops overview # one-shot health summary for the default target
Then the interesting parts:
queue-aiops analyze memory # redis memory-pressure RCA (maxmemory, eviction, frag, big keys)
queue-aiops analyze latency # redis latency RCA (slowlog digest, fork/AOF stalls)
queue-aiops analyze backlog # rabbitmq queue-backlog RCA (consumers, unacked, watermarks)
queue-aiops analyze churn # connection churn, both platforms
queue-aiops redis bigkeys # SCAN-budgeted big-key sample (never KEYS *)
queue-aiops rabbitmq queues # deepest backlog first
Security: read-only mode
This tool is meant to be handed to an AI agent, so its safety story is enforced by the server rather than requested in a prompt:
export QUEUE_READ_ONLY=1
With that set, the 8 write tools are never registered. An MCP client lists 20 tools instead of 28 — the writes are not hidden, not gated behind a flag, and not merely refused when called. They are absent from the session. A model cannot invoke a tool it was never offered, and cannot be argued into one.
That distinction is the whole point. A tool that exists but refuses still invites retry loops and "I'll describe the call instead" behaviour from smaller models, and it leaves a reviewer trusting a promise. An absent tool is a fact you can check: connect, list the tools, and see that the writes are not there.
Enforcement is two layers deep, so the switch cannot be sidestepped by changing entry point:
| Layer | What it does | Covers |
|---|---|---|
@governed_tool harness |
refuses every non-read operation outright | MCP, CLI, and in-process callers |
| MCP registration | write tools are removed from list_tools() |
anything speaking MCP |
Read operations are unaffected, and every call is still audited to
~/.queue-aiops/audit.db.
The read/write split is derived from each tool's declared
risk_level, and a test asserts that this never disagrees with the[READ]/[WRITE]tag in the tool's own documentation — so a write can't quietly present itself as a read.
Running a smaller / local model? See agent-guardrails.md — it lists the guardrails this tool now enforces for you (so you don't spend prompt budget restating them) and gives a ready-made system prompt for what's left.
Support scope
| Platform | Protocol | Coverage |
|---|---|---|
redis (5.x–7.x wire protocol via redis Python client) |
RESP, password optional, TLS optional | INFO (server/memory/clients/stats/persistence/keyspace), SLOWLOG, CLIENT LIST/KILL, CONFIG GET/SET, MEMORY STATS/USAGE, SCAN-budgeted big-key sampling, DBSIZE, PING |
| rabbitmq (management plugin HTTP API) | HTTP(S), Basic auth | /api/overview, /api/queues (+ per-vhost, detail, purge, declare, delete), /api/connections, /api/channels, /api/consumers, /api/policies (get/set/delete), /api/nodes |
28 MCP tools — 20 reads (incl. 4 flagship RCAs) + 8 governed writes.
| Group | Tools | R/W |
|---|---|---|
| Overview | queue_overview | read |
| redis reads | redis_server_info, redis_memory_stats, redis_clients, redis_slowlog, redis_config_get, redis_keyspace, redis_big_keys | read |
| rabbitmq reads | rabbitmq_overview, list_queues, queue_detail, list_connections, list_channels, list_policies, node_health | read |
| Flagship RCAs | redis_memory_pressure_rca, redis_latency_rca, rabbitmq_queue_backlog_rca, connection_churn_analysis | read |
| Writes (medium) | redis_config_set, redis_kill_client, declare_queue, set_policy, delete_policy | write |
| Writes (high) | purge_queue, delete_queue | write |
| Undo | undo_list, undo_apply | read / write |
The four RCAs are transparent heuristics that report their numbers — thresholds
are named constants, every finding carries its evidence, never a black-box
verdict. Big-key sampling walks at most 10,000 keys with SCAN and sizes at most
200 with MEMORY USAGE — never KEYS * — and reports its coverage.
Governance
Every MCP tool runs through the bundled @governed_tool harness
(queue_aiops.governance — no external dependency):
- Audit — every call lands in
~/.queue-aiops/audit.db(relocatable viaQUEUE_AIOPS_HOME), secret-redacted. - Budget — call/time ceilings (
QUEUE_MAX_TOOL_CALLS,QUEUE_MAX_TOOL_SECONDS) + a runaway-loop breaker. - Risk tiers & approval — secure by default: with no
~/.queue-aiops/rules.yaml, high-risk writes (purge_queue,delete_queue) are denied unlessQUEUE_AUDIT_APPROVED_BYnames an approver (setQUEUE_AUDIT_RATIONALEtoo).queue-aiops initseeds a starter rules.yaml with that dual-control tier; an operator-authored rules file is honoured as-is. - Undo — reversible writes capture the real before-state first:
redis_config_setrecords the prior value from CONFIG GET;set_policy/delete_policyrecord the prior policy;delete_queuerecords the queue's definition and its undo re-declares it (the messages are not restored — the descriptor says so). Irreversible writes (purge_queue,redis_kill_client) record priorState only. - Dry-run + double-confirm — every write takes
dry_run=True(MCP) /--dry-run(CLI); CLI writes double-confirm and execute through the same governed twins, so they land in the audit log too. - Credentials live encrypted in
~/.queue-aiops/secrets.enc(Fernet + scrypt master password;QUEUE_AIOPS_MASTER_PASSWORDfor non-interactive use). Redis passwords are optional — an auth-less lab instance is a supported target.
MCP configuration
{
"mcpServers": {
"queue-aiops": {
"command": "uvx",
"args": ["--from", "queue-aiops", "queue-aiops-mcp"],
"env": {
"QUEUE_AIOPS_MASTER_PASSWORD": "your-master-password"
}
}
}
}
env-block caveat: MCP clients launch the server with a minimal environment — your shell profile is not sourced. Anything the server needs (
QUEUE_AIOPS_MASTER_PASSWORD, a relocatedQUEUE_AIOPS_HOME,QUEUE_AUDIT_APPROVED_BYfor high-risk writes) must be set in theenvblock above, not just in your terminal.
Or, with the package installed: queue-aiops mcp.
CLI reference (short)
queue-aiops init | doctor | overview | mcp
queue-aiops secret set|list|migrate ...
queue-aiops redis info|memory|clients|slowlog|config-get|keyspace|bigkeys
queue-aiops redis config-set <param> <value> [--dry-run]
queue-aiops redis kill-client --id <id> | --addr <ip:port> [--dry-run]
queue-aiops rabbitmq overview|queues|queue|connections|channels|policies|nodes
queue-aiops rabbitmq purge|delete-queue|declare-queue <name> [--vhost /] [--dry-run]
queue-aiops rabbitmq set-policy|delete-policy <name> ... [--dry-run]
queue-aiops analyze memory|latency|backlog|churn
Verification status
Live-verified against Redis 7.4.9 and RabbitMQ 3.13.7 (2026-07-19/20).
Connectivity, every Redis read (cross-checked against redis-cli ground truth), all
four analyses, and the full governance loop (real redis_config_set → audit row →
undo restoring the prior value) were exercised against a real server. That run found
and fixed a real defect: integer quantities — key counts, client counts, byte totals —
were rendered as floats (202.0 keys), which equality assertions cannot catch.
The RabbitMQ group is now verified end-to-end too — reads cross-checked against
rabbitmqadmin, and set_policy → undo_apply closing on the live broker. Redis
cluster/sentinel topologies and AUTH/TLS connections remain unverified.
docs/VERIFICATION.md records exactly what was checked and what
is still open. queue-aiops doctor is the fastest live check.
Contributing
缺功能提 issue/PR 欢迎留言 — missing a read you need (streams/consumer groups, quorum-queue specifics, shovel/federation status), another broker platform, or a threshold that doesn't fit your fleet? Open an issue or PR at github.com/AIops-tools/Queue-AIops — platform registry entries are additive and small.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file queue_aiops-0.3.0.tar.gz.
File metadata
- Download URL: queue_aiops-0.3.0.tar.gz
- Upload date:
- Size: 223.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f4eca833eb2cd0f8c0c520a25728e33093c69176bb6a3c86ac2d11037d5c14f
|
|
| MD5 |
c070d9ba44df0a41e962d25ff46aad13
|
|
| BLAKE2b-256 |
ee574fc03a3c6b2bade7b59f1b64bb52839063b4468ee4bd4b11bc2df8d8f281
|
Provenance
The following attestation bundles were made for queue_aiops-0.3.0.tar.gz:
Publisher:
publish.yml on AIops-tools/Queue-AIops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
queue_aiops-0.3.0.tar.gz -
Subject digest:
9f4eca833eb2cd0f8c0c520a25728e33093c69176bb6a3c86ac2d11037d5c14f - Sigstore transparency entry: 2205548003
- Sigstore integration time:
-
Permalink:
AIops-tools/Queue-AIops@c5fa9c035a9a34beec3fc162fd2d71f79b305ec8 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/AIops-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c5fa9c035a9a34beec3fc162fd2d71f79b305ec8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file queue_aiops-0.3.0-py3-none-any.whl.
File metadata
- Download URL: queue_aiops-0.3.0-py3-none-any.whl
- Upload date:
- Size: 110.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aacab1aa444821050dba9bab5d7b4d3bc82057885cb970409d82215d75ac06b5
|
|
| MD5 |
c645e9aefdbabd5cc427946483a3f402
|
|
| BLAKE2b-256 |
e2f8ccf8ebc72c7fb0cb7f084ded7741ccdd0f32d701b14ee3abf777888b8af5
|
Provenance
The following attestation bundles were made for queue_aiops-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on AIops-tools/Queue-AIops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
queue_aiops-0.3.0-py3-none-any.whl -
Subject digest:
aacab1aa444821050dba9bab5d7b4d3bc82057885cb970409d82215d75ac06b5 - Sigstore transparency entry: 2205548007
- Sigstore integration time:
-
Permalink:
AIops-tools/Queue-AIops@c5fa9c035a9a34beec3fc162fd2d71f79b305ec8 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/AIops-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c5fa9c035a9a34beec3fc162fd2d71f79b305ec8 -
Trigger Event:
release
-
Statement type: