Imported from tiangong-ai/agent-skills (
tiangong-kb-esg-search/SKILL.md). Install upstream withnpx skills add tiangong-ai/agent-skills --skill tiangong-kb-esg-search. Copyright stays with the author.
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 the exact reviewed entrypoint
npx --yes --package "@tiangong-ai/cli@0.0.62" -- tiangong-ai; users do not need a preinstalled CLI. SetTIANGONG_AI_CLIorTIANGONG_AI_CLI_BINonly to override the CLI entrypoint intentionally. - Set
TIANGONG_ESG_APIKEYorTIANGONG_AI_APIKEY. Credentials are never accepted in wrapper JSON, request files, URLs, or CLI arguments. - When
request_file/input_fileis provided, the wrapper loads.envfrom that file's directory by default.env_filecan 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_ESG_SEARCH_URL. The CLI otherwise derives theesg_searchendpoint fromTIANGONG_RESEARCH_API_BASE_URL,TIANGONG_AI_SEARCH_API_BASE_URL, orTIANGONG_AI_API_BASE_URL. The wrapper also mapsTIANGONG_ESG_API_BASE_URLto the CLI--api-base-urloption.
Search
For normal searches, pass a query:
./scripts/esg_search.sh '{
"query": "scope 3 emissions reduction targets",
"top_k": 5
}'
The script calls:
npx --yes --package "@tiangong-ai/cli@0.0.62" -- tiangong-ai 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 documentsrec_idandcountry.datefilter.<field>: acceptgteand/orltenumeric bounds. The current ESG date field ispublication_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
metaContainsanddateFilterare 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/ltebounds. Exact payload files are forwarded unchanged, so keep their field names in the edge-function form shown above.
Input Fields
queryorinput: convenience query text.request_fileorinput_file: JSON body forwarded unchanged.env_file: optional dotenv file. Without it,request_file/input_filecauses the wrapper to load.envfrom that file's directory.filter,datefilter,dateFilter,meta_contains,metaContains,topK,extK: optional inline raw payload fields foresg_search.sources: optional compatibility field; onlyesgordefaultis accepted.dry_run: return the exact request plan with masked credentials.api_base_url,esg_url,region,timeoutas non-secret routing values.top_k,ext_k: only used in query mode.