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
npx @tiangong-ai/cli@0.0.19; users do not need a
preinstalled CLI. Set TIANGONG_AI_CLI or TIANGONG_AI_CLI_BIN only to
override the CLI entrypoint.
- Set the authentication environment variables expected by
tiangong-ai.
- 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. Loaded dotenv values only fill unset environment variables; explicit
JSON fields such as api_key, edu_api_key, and api_base_url are passed as
CLI flags and take precedence.
- 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 @tiangong-ai/cli@0.0.19 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, api_key, edu_api_key.
edu_url, region, timeout.
top_k, ext_k: only used in query mode.
1---2name: tiangong-kb-edu-search3description: 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---5
6# Tiangong KB Edu Search
7
8Use this skill for Tiangong general education-source retrieval. It is
9intentionally single-source: always search `edu`, never `all`, `course`, or
10`textbook`.
11
12## Prerequisites
13
14- The wrapper defaults to `npx @tiangong-ai/cli@0.0.19`; users do not need a
15 preinstalled CLI. Set `TIANGONG_AI_CLI` or `TIANGONG_AI_CLI_BIN` only to
16 override the CLI entrypoint.
17- Set the authentication environment variables expected by `tiangong-ai`.
18- When `request_file` / `input_file` is provided, the wrapper loads `.env` from
19 that file's directory by default. `env_file` can point to a different dotenv
20 file. Loaded dotenv values only fill unset environment variables; explicit
21 JSON fields such as `api_key`, `edu_api_key`, and `api_base_url` are passed as
22 CLI flags and take precedence.
23- Optionally set `TIANGONG_AI_API_BASE_URL`; the CLI accepts a Supabase project
24 root, `/functions/v1`, or `/rest/v1` and derives Functions URLs.
25
26## Search
27
28For normal searches, pass a query:
29
30```bash
31./scripts/edu_search.sh '{
32 "query": "education policy curriculum reform",
33 "top_k": 5
34}'
35```
36
37The script calls:
38
39```bash
40npx @tiangong-ai/cli@0.0.19 education search --query <query> --sources edu --json
41```
42
43For exact edge-function payloads, provide `request_file` or `input_file`:
44
45```bash
46./scripts/edu_search.sh '{
47 "request_file": "./edu-request.json",
48 "dry_run": true
49}'
50```
51
52## Raw Payload Filters
53
54Wrapper JSON can include inline raw `edu_search` fields; the wrapper will
55forward them through the CLI `--input` path. The same payload can also be put in
56`request_file` / `input_file`:
57
58```json
59{
60 "query": "water treatment filter backwashing",
61 "filter": {
62 "course": ["水处理工程"]
63 },
64 "topK": 5,
65 "extK": 1
66}
67```
68
69- Normal search currently uses only `filter.course` to narrow retrieval to one
70 or more course names; other metadata fields are not applied in the retrieval
71 path.
72- `edu_search` has a separate `{"action":"list_filter_options"}` mode for
73 discovering metadata values. In that mode, `fields` may include `course`,
74 `type`, `file_type`, `language`, `chapter_number`, and `name`; optional
75 `filter` narrows the listed options.
76- `topK`, `extK`: raw edge-function names for result count and adjacent chunk
77 expansion.
78- `datefilter` and `getMeta` are not supported by `edu_search`.
79
80## Input Fields
81
82- `query` or `input`: convenience query text.
83- `request_file` or `input_file`: JSON body forwarded unchanged.
84- `env_file`: optional dotenv file. Without it, `request_file` /
85 `input_file` causes the wrapper to load `.env` from that file's directory.
86- `filter`, `action`, `fields`, `topK`, `extK`: optional inline raw payload
87 fields for `edu_search`.
88- `sources`: optional compatibility field; only `edu` or `default` is accepted.
89- `dry_run`: true to return the exact request plan with masked credentials.
90- `api_base_url`, `api_key`, `edu_api_key`.
91- `edu_url`, `region`, `timeout`.
92- `top_k`, `ext_k`: only used in query mode.