Tiangong KB ESG Search
Use this skill for Tiangong ESG disclosure retrieval. It is intentionally
single-source: always search the esg_search endpoint, never a broad or
multi-source preset.
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. Native ESG search requires
@tiangong-ai/cli@0.0.19 or later.
- Set
TIANGONG_ESG_APIKEY or TIANGONG_AI_APIKEY. The explicit JSON field
esg_api_key takes precedence over api_key, and both take precedence over
environment credentials.
- 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.
- Optionally set
TIANGONG_ESG_SEARCH_URL. The CLI otherwise derives the
esg_search endpoint from TIANGONG_RESEARCH_API_BASE_URL,
TIANGONG_AI_SEARCH_API_BASE_URL, or TIANGONG_AI_API_BASE_URL. The wrapper
also maps TIANGONG_ESG_API_BASE_URL to the CLI --api-base-url option.
Search
For normal searches, pass a query:
./scripts/esg_search.sh '{
"query": "scope 3 emissions reduction targets",
"top_k": 5
}'
The script calls:
npx @tiangong-ai/cli@0.0.19 research search --sources esg --query <query> --json
For exact edge-function payloads, provide request_file or input_file:
./scripts/esg_search.sh '{
"request_file": "./esg-request.json",
"dry_run": true
}'
Raw Payload Filters
Wrapper JSON can include inline raw esg_search fields; the wrapper forwards
them through the CLI --input path:
{
"query": "greenhouse gas emissions",
"filter": {
"country": ["China"]
},
"datefilter": {
"publication_date": {
"gte": 1672531200
}
},
"meta_contains": "annual sustainability report",
"topK": 5,
"extK": 1
}
filter.<field>: accept a string array for an indexed ESG metadata field.
The current public contract explicitly documents rec_id and country.
datefilter.<field>: accept gte and/or lte numeric bounds. The current
ESG date field is publication_date, expressed as a UNIX timestamp.
meta_contains: fuzzy-match ESG metadata. Use it only when the user
explicitly requests metadata-based narrowing.
topK, extK: raw edge-function names for result count and adjacent chunk
expansion.
- Inline
metaContains and dateFilter are accepted as convenience aliases
and normalized to the edge-function field names.
- Inline payloads enforce the edge function's dynamic filter shapes: term
filters must contain string arrays and range filters must contain numeric
gte / lte bounds. Exact payload files are forwarded unchanged, so keep
their field names in the edge-function form shown above.
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, datefilter, dateFilter, meta_contains, metaContains,
topK, extK: optional inline raw payload fields for esg_search.
sources: optional compatibility field; only esg or default is accepted.
dry_run: return the exact request plan with masked credentials.
api_base_url, api_key, esg_api_key, esg_url, region, timeout.
top_k, ext_k: only used in query mode.
1---2name: tiangong-kb-esg-search3description: Search Tiangong knowledge-base ESG disclosures through the Tiangong AI CLI. Use for environmental, social, and governance reports and disclosure evidence only. This skill searches only the ESG source.4---5
6# Tiangong KB ESG Search
7
8Use this skill for Tiangong ESG disclosure retrieval. It is intentionally
9single-source: always search the `esg_search` endpoint, never a broad or
10multi-source preset.
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. Native ESG search requires
17 `@tiangong-ai/cli@0.0.19` or later.
18- Set `TIANGONG_ESG_APIKEY` or `TIANGONG_AI_APIKEY`. The explicit JSON field
19 `esg_api_key` takes precedence over `api_key`, and both take precedence over
20 environment credentials.
21- When `request_file` / `input_file` is provided, the wrapper loads `.env` from
22 that file's directory by default. `env_file` can point to a different dotenv
23 file. Loaded dotenv values only fill unset environment variables.
24- Optionally set `TIANGONG_ESG_SEARCH_URL`. The CLI otherwise derives the
25 `esg_search` endpoint from `TIANGONG_RESEARCH_API_BASE_URL`,
26 `TIANGONG_AI_SEARCH_API_BASE_URL`, or `TIANGONG_AI_API_BASE_URL`. The wrapper
27 also maps `TIANGONG_ESG_API_BASE_URL` to the CLI `--api-base-url` option.
28
29## Search
30
31For normal searches, pass a query:
32
33```bash
34./scripts/esg_search.sh '{
35 "query": "scope 3 emissions reduction targets",
36 "top_k": 5
37}'
38```
39
40The script calls:
41
42```bash
43npx @tiangong-ai/cli@0.0.19 research search --sources esg --query <query> --json
44```
45
46For exact edge-function payloads, provide `request_file` or `input_file`:
47
48```bash
49./scripts/esg_search.sh '{
50 "request_file": "./esg-request.json",
51 "dry_run": true
52}'
53```
54
55## Raw Payload Filters
56
57Wrapper JSON can include inline raw `esg_search` fields; the wrapper forwards
58them through the CLI `--input` path:
59
60```json
61{
62 "query": "greenhouse gas emissions",
63 "filter": {
64 "country": ["China"]
65 },
66 "datefilter": {
67 "publication_date": {
68 "gte": 1672531200
69 }
70 },
71 "meta_contains": "annual sustainability report",
72 "topK": 5,
73 "extK": 1
74}
75```
76
77- `filter.<field>`: accept a string array for an indexed ESG metadata field.
78 The current public contract explicitly documents `rec_id` and `country`.
79- `datefilter.<field>`: accept `gte` and/or `lte` numeric bounds. The current
80 ESG date field is `publication_date`, expressed as a UNIX timestamp.
81- `meta_contains`: fuzzy-match ESG metadata. Use it only when the user
82 explicitly requests metadata-based narrowing.
83- `topK`, `extK`: raw edge-function names for result count and adjacent chunk
84 expansion.
85- Inline `metaContains` and `dateFilter` are accepted as convenience aliases
86 and normalized to the edge-function field names.
87- Inline payloads enforce the edge function's dynamic filter shapes: term
88 filters must contain string arrays and range filters must contain numeric
89 `gte` / `lte` bounds. Exact payload files are forwarded unchanged, so keep
90 their field names in the edge-function form shown above.
91
92## Input Fields
93
94- `query` or `input`: convenience query text.
95- `request_file` or `input_file`: JSON body forwarded unchanged.
96- `env_file`: optional dotenv file. Without it, `request_file` /
97 `input_file` causes the wrapper to load `.env` from that file's directory.
98- `filter`, `datefilter`, `dateFilter`, `meta_contains`, `metaContains`,
99 `topK`, `extK`: optional inline raw payload fields for `esg_search`.
100- `sources`: optional compatibility field; only `esg` or `default` is accepted.
101- `dry_run`: return the exact request plan with masked credentials.
102- `api_base_url`, `api_key`, `esg_api_key`, `esg_url`, `region`, `timeout`.
103- `top_k`, `ext_k`: only used in query mode.