byted-bytehouse-ai-query

byted-bytehouse-ai-query is a skill for Claude Code, Codex from bytedance/agentkit-samples. It costs 144 tokens per session (2,479 once invoked), scanned B, original, Apache-2.0.

A set of tools for working with ByteHouse, a cloud data warehouse for storing and querying large datasets. It turns plain-language questions into SQL, lists databases and tables, runs queries, and supports vector search across text, images, and video.

In plain words
What is it for?
Use it to find databases and tables, generate and execute read queries, and search stored multimodal data. It can return query results and supports text-to-SQL workflows.
Why use it?
It lets you inspect and query warehouse data without writing every SQL statement by hand. It also helps prevent accidental changes by protecting non-read-only operations by default.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one.

Good fit Use it to find databases and tables, generate and execute read queries, and search stored multimodal data. It can return query results and supports text-to-SQL workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bytedance/agentkit-samples/byted-bytehouse-ai-query
About the project

bytedance/agentkit-samples is a collection of examples and tutorials for Volcengine AgentKit, an AI-agent development platform for building, deploying, and operating agent applications. Developers use the samples to learn agent creation, multi-agent collaboration, memory, retrieval, MCP integrations, media generation, customer service, and other workflows. The catalogue skills provide agent workflows based on these examples.

bytedance/agentkit-samples · 450 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bytedance/agentkit-samples --skill byted-bytehouse-ai-query
Clone the repo
git clone --depth 1 https://github.com/bytedance/agentkit-samples

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for byted-bytehouse-ai-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/bytedance/agentkit-samples/byted-bytehouse-ai-query/github.svg)](https://agentmods.dev/skills/bytedance/agentkit-samples/byted-bytehouse-ai-query)
Your own site
<a href="https://agentmods.dev/skills/bytedance/agentkit-samples/byted-bytehouse-ai-query"><img src="https://agentmods.dev/badge/skills/bytedance/agentkit-samples/byted-bytehouse-ai-query/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for byted-bytehouse-ai-query

Your own site · 80×15
<a href="https://agentmods.dev/skills/bytedance/agentkit-samples/byted-bytehouse-ai-query"><img src="https://agentmods.dev/badge/skills/bytedance/agentkit-samples/byted-bytehouse-ai-query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 144 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,479 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Privilege Escalation · line 85
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00144 $0.02479
Opus 5 $0.00072 $0.01239
Sonnet 5 $0.00029 $0.00496
Haiku 4.5 $0.00014 $0.00248

Measured 9d ago against content hash 27769ac4a76b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

byted-bytehouse-ai-query scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (scripts/client.py, scripts/embedding.py, scripts/execute_sql.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- `jq`(`export_config.sh` 解析 JSON 需要,未安装时可 `brew install jq` 或 `sudo apt install jq`)

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

sql_result = subprocess.run(cmd, capture_output=True, text=True)
skills/byted-bytehouse-ai-query/SKILL.md · 221 lines

How it starts

The opening of the file, as written. The whole thing — 221 lines — stays where its author put it; the contents beside it link to each section on GitHub.

byted-bytehouse-ai-query

描述

ByteHouse AI Query Skill,提供以下核心能力:

  1. Text2SQL — 将自然语言查询需求转换为 ByteHouse SQL。
  2. List Tables — 列出目标数据库/实例下的所有库与表。
  3. Execute SQL — 执行 SQL 查询并返回结果,内置非 DQL 保护。
  4. 多模态向量化与检索 — 支持文本、图片、视频的向量化,以及向量/混合检索。

当以下情况时使用此 Skill:

  1. 用户希望通过自然语言查询 ByteHouse 中的数据("帮我查一下 xxx 表数据量"、"看看有哪些库和表" 等)。
  2. 用户明确要求把自然语言转成 SQL(Text2SQL),或需要在 ByteHouse 上执行 SQL。
  3. 用户希望在 ByteHouse 上进行文本/图片/视频的向量化存储与检索。
  4. 用户提到 ByteHouse、火山引擎云数仓、云原生数仓、数据仓库查询相关关键词。

🧭 智能体使用指引(重要)

Agent 在承接上述任务时,按以下流程调度本 Skill 内的脚本:

  1. 确保配置就绪:先执行 source scripts/export_config.sh,把 ~/.bytehouse_config.json 中的配置注入环境变量。
    • ~/.bytehouse_config.json 不存在或缺失 BYTEHOUSE_HOST / BYTEHOUSE_PASSWORD,主动引导用户提供,并把用户返回的连接信息写入该 JSON 文件后再 source
  2. 摸清数据全貌:若用户没有明确指定库表,先使用 scripts/list_tables.py 查询数据库/表列表,帮助用户/Agent 选定要查的表。
  3. 生成 SQL:需要把自然语言转成 SQL 时,使用 scripts/text2sql.py,将目标表以位置参数传入。
  4. 执行 SQL:拿到 SQL 后使用 scripts/execute_sql.py。默认只允许执行 DQL,非 DQL(INSERT/UPDATE/DROP 等)需要先向用户确认再附加 --force
  5. 多模态检索场景:使用 scripts/embedding.py + scripts/search_client.py 完成向量化与向量/混合检索。
  6. 展示结果:默认返回前 5 条结果,异常时展示完整报错。任何时候都要对密钥、密码等敏感字段做 Mask。

Agent 必须通过上述脚本发起查询/执行,不允许自行拼装 SQL 或直接连接 ByteHouse。

📁 文件说明

  • SKILL.md — 本文件,技能主文档。
  • requirements.txt — Python 依赖列表。
  • scripts/text2sql.py — Text2SQL 转换脚本。
  • scripts/list_tables.py — 列出数据库或指定库下的表。
  • scripts/execute_sql.py — 执行 SQL 查询脚本,内置 DQL 保护。
  • scripts/client.py — ByteHouse 连接客户端通用模块。
  • scripts/embedding.py — 多模态向量化脚本。
  • scripts/search_client.py — ByteHouse 向量检索客户端。
  • scripts/export_config.sh — 从 ~/.bytehouse_config.json 加载配置到环境变量(依赖 jq)。

配置说明

配置文件位于 ~/.bytehouse_config.json。如果文件存在且非空,直接使用文件中的配置;否则,向用户询问必填连接信息(可以把这份文档发给用户以便查阅 ByteHouse 连接信息获取指引),拿到后写入 JSON 文件,避免重复询问。当用户切换 ByteHouse 集群时,一并更新该文件。

{
   "BYTEHOUSE_HOST": "<ByteHouse-host>",
   "BYTEHOUSE_PORT": "8123",
   "BYTEHOUSE_USER": "bytehouse",
   "BYTEHOUSE_PASSWORD": "<ByteHouse-password>",
   "BH_ARK_API_KEY": "<火山引擎方舟 API 密钥>",
   "BH_ARK_BASE_URL": "https://ark.cn-beijing.volces.com/api/v3",
   "BH_EMBEDDING_MODEL": "doubao-embedding-vision-251215"
}

Read the full file on GitHub · 221 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 221 lines · 144 tokens per session scan B 27769ac4a76b

Subscribe to this mod's changes

byted-bytehouse-ai-query is a skill published in the GitHub repository bytedance/agentkit-samples (450 stars, last pushed 5d ago), licensed Apache-2.0. It adds 144 tokens to every session and 2,479 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

bigquery-ai-ml

Skill for BigQuery AI and Machine Learning queries using standard SQL and AI. functions (preferred over dedicated tools).

google/adk-python · 31 tokens

local-embedding

Run embedding on-device with ONNX Runtime. Build from source, model selection, offline mode. Use when setting up local embedding without an API key.

matrixorigin/memoria · 34 tokens

azure-horizondb

Expert knowledge for Azure Horizondb development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using azureai SQL/embeddings, pgvector tuning, Apache AGE graphs, hybrid…

MicrosoftDocs/Agent-Skills · 95 tokens

azure-documentdb

Expert knowledge for Azure DocumentDB development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using DocumentDB search (BM25/vector), Data API, MongoDB compatibility, change…

MicrosoftDocs/Agent-Skills · 120 tokens

chroma

Open-source embedding database for AI applications. Store embeddings and metadata, perform vector and full-text search, filter by metadata. Simple 4-function API. Scales from notebooks to production clusters. Use for semantic search, RAG applications, or document retrieval. Best for local development and open-source…

synthetic-sciences/openscience · 63 tokens

vector-db-ops

Use when vector database operations — Pinecone, Weaviate, Qdrant, ChromaDB. Indexing, querying, filtering, and managing vector embeddings for RAG and similarity search. Use when working with vector db ops.

oyi77/1ai-skills · 52 tokens