Tiangong KB Edu Search
Use this skill for Tiangong general education-source retrieval. It is
intentionally single-source: always search edu, never all, course, or
textbook.
Prerequisites
- The wrapper defaults to the exact reviewed entrypoint
npx --yes --package "@tiangong-ai/cli@0.0.62" -- tiangong-ai; users do not need a
preinstalled CLI. Set TIANGONG_AI_CLI or TIANGONG_AI_CLI_BIN only to
override the CLI entrypoint intentionally.
- Set
TIANGONG_EDU_APIKEY or TIANGONG_AI_APIKEY. Credentials are never
accepted in wrapper JSON, request files, URLs, or CLI arguments.
- When
request_file / input_file is provided, the wrapper loads .env from
that file's directory by default. env_file can point to a different dotenv
file. It must be an owner-only regular non-symlink file (chmod 600), and
only documented Tiangong variables are loaded. Existing process variables win.
- Optionally set
TIANGONG_AI_API_BASE_URL; the CLI accepts a Supabase project
root, /functions/v1, or /rest/v1 and derives Functions URLs.
Search
For normal searches, pass a query:
./scripts/edu_search.sh '{
"query": "education policy curriculum reform",
"top_k": 5
}'
The script calls:
npx --yes --package "@tiangong-ai/cli@0.0.62" -- tiangong-ai education search --query <query> --sources edu --json
For exact edge-function payloads, provide request_file or input_file:
./scripts/edu_search.sh '{
"request_file": "./edu-request.json",
"dry_run": true
}'
Raw Payload Filters
Wrapper JSON can include inline raw edu_search fields; the wrapper will
forward them through the CLI --input path. The same payload can also be put in
request_file / input_file:
{
"query": "water treatment filter backwashing",
"filter": {
"course": ["水处理工程"]
},
"topK": 5,
"extK": 1
}
- Normal search currently uses only
filter.course to narrow retrieval to one
or more course names; other metadata fields are not applied in the retrieval
path.
edu_search has a separate {"action":"list_filter_options"} mode for
discovering metadata values. In that mode, fields may include course,
type, file_type, language, chapter_number, and name; optional
filter narrows the listed options.
topK, extK: raw edge-function names for result count and adjacent chunk
expansion.
datefilter and getMeta are not supported by edu_search.
Input Fields
query or input: convenience query text.
request_file or input_file: JSON body forwarded unchanged.
env_file: optional dotenv file. Without it, request_file /
input_file causes the wrapper to load .env from that file's directory.
filter, action, fields, topK, extK: optional inline raw payload
fields for edu_search.
sources: optional compatibility field; only edu or default is accepted.
dry_run: true to return the exact request plan with masked credentials.
api_base_url, edu_url, region, timeout as non-secret routing values.
top_k, ext_k: only used in query mode.
1---2name: tiangong-kb-edu-search-23description: Search Tiangong knowledge-base general education sources through the Tiangong AI CLI. Use for broad education knowledge sources only. This skill searches only the edu source, not course or textbook.4---56# Tiangong KB Edu Search78Use this skill for Tiangong general education-source retrieval. It is9intentionally single-source: always search `edu`, never `all`, `course`, or10`textbook`.1112## Prerequisites1314- The wrapper defaults to the exact reviewed entrypoint15 `npx --yes --package "@tiangong-ai/cli@0.0.62" -- tiangong-ai`; users do not need a16 preinstalled CLI. Set `TIANGONG_AI_CLI` or `TIANGONG_AI_CLI_BIN` only to17 override the CLI entrypoint intentionally.18- Set `TIANGONG_EDU_APIKEY` or `TIANGONG_AI_APIKEY`. Credentials are never19 accepted in wrapper JSON, request files, URLs, or CLI arguments.20- When `request_file` / `input_file` is provided, the wrapper loads `.env` from21 that file's directory by default. `env_file` can point to a different dotenv22 file. It must be an owner-only regular non-symlink file (`chmod 600`), and23 only documented Tiangong variables are loaded. Existing process variables win.24- Optionally set `TIANGONG_AI_API_BASE_URL`; the CLI accepts a Supabase project25 root, `/functions/v1`, or `/rest/v1` and derives Functions URLs.2627## Search2829For normal searches, pass a query:3031```bash32./scripts/edu_search.sh '{33 "query": "education policy curriculum reform",34 "top_k": 535}'36```3738The script calls:3940```bash41npx --yes --package "@tiangong-ai/cli@0.0.62" -- tiangong-ai education search --query <query> --sources edu --json42```4344For exact edge-function payloads, provide `request_file` or `input_file`:4546```bash47./scripts/edu_search.sh '{48 "request_file": "./edu-request.json",49 "dry_run": true50}'51```5253## Raw Payload Filters5455Wrapper JSON can include inline raw `edu_search` fields; the wrapper will56forward them through the CLI `--input` path. The same payload can also be put in57`request_file` / `input_file`:5859```json60{61 "query": "water treatment filter backwashing",62 "filter": {63 "course": ["水处理工程"]64 },65 "topK": 5,66 "extK": 167}68```6970- Normal search currently uses only `filter.course` to narrow retrieval to one71 or more course names; other metadata fields are not applied in the retrieval72 path.73- `edu_search` has a separate `{"action":"list_filter_options"}` mode for74 discovering metadata values. In that mode, `fields` may include `course`,75 `type`, `file_type`, `language`, `chapter_number`, and `name`; optional76 `filter` narrows the listed options.77- `topK`, `extK`: raw edge-function names for result count and adjacent chunk78 expansion.79- `datefilter` and `getMeta` are not supported by `edu_search`.8081## Input Fields8283- `query` or `input`: convenience query text.84- `request_file` or `input_file`: JSON body forwarded unchanged.85- `env_file`: optional dotenv file. Without it, `request_file` /86 `input_file` causes the wrapper to load `.env` from that file's directory.87- `filter`, `action`, `fields`, `topK`, `extK`: optional inline raw payload88 fields for `edu_search`.89- `sources`: optional compatibility field; only `edu` or `default` is accepted.90- `dry_run`: true to return the exact request plan with masked credentials.91- `api_base_url`, `edu_url`, `region`, `timeout` as non-secret routing values.92- `top_k`, `ext_k`: only used in query mode.