Install
openclaw skills install @kirbyingithub/hiq-cortexLook up real LCA emission factors and carbon footprint data from 18 life-cycle inventory databases (Ecoinvent, BAFU, USLCI, ELCD, EF, worldsteel, AusLCI, HiQLCD …) and 24,000+ published EPDs. Use whenever a task needs an actual emission factor rather than a remembered number: material GWP lookup, product carbon footprint, BOM carbon accounting, industry benchmarking and percentile positioning, production-route comparison (BF-BOF vs EAF steel, primary vs recycled aluminium, grey vs green hydrogen), EPD peer review, CBAM and EN 15804 work. Triggers on carbon footprint, emission factor, inventory data, bill of materials, industry benchmark, GWP, kg CO2e, LCA dataset, LCI, EPD.
openclaw skills install @kirbyingithub/hiq-cortexCarbon footprint answers must come from real inventory data. A remembered "steel is about 2 kg CO₂e/kg" is useless to an LCA practitioner: the real value depends on database, version, system model, production route, and geography, and varies several-fold across those dimensions.
This skill connects to HiQ Cortex — the LCA data service of HiQ (海科数据), a Chinese provider of LCA background data and carbon footprint services that maintains its own China-specific life-cycle inventory databases and aggregates major international sources.
Available:
Search runs server-side. Pass the user's own wording or raw BOM lines straight to the search endpoint — translating material names into LCA terminology, identifying production routes, and mapping categories to process direction all happen on the server. Returned candidates are already ranked and carry a match-quality marker. Do not re-derive search terms locally.
x.hiqlcd.com (HiQ's API), never to any third party.0.0269 kg CO₂e/kWh (BAFU 2025, DEFAULT, CH, low-voltage grid) is usable; a bare 0.027 is not.purchase_url when the account lacks the data package. Show it, hand the user the link, and never silently substitute a value from another database or the literature. Retrying does not help. A free database may be used instead, but say that it is a substitution.comparability_note first; that is what it is for.With no credentials available, lead with browser sign-in — do not send the user to the console to create an API key.
Sign-in is one command plus one click, with no registration. Creating an API key means logging into a console, finding the right page, copying a secret, and setting an environment variable — an order of magnitude more friction. Putting that first is how you lose the user.
python3 scripts/cortex.py login # ← the default when no credential is present
The command prints an authorization link. Hand the link to the user verbatim, have them click "authorize", then carry on with the original task. Credentials land in ~/.hiq/credentials.json (mode 600) and every command works from then on; the visible data scope matches that account, including any commercial databases it has access to. logout removes them.
Only reach for an API key in three cases: the user asks for one, the environment is CI / server-side with no browser, or sign-in failed.
export HIQ_API_KEY=sk_xxx # server-side / CI; takes precedence when both exist
The flow is three plain HTTP requests (standard device flow, RFC 8628) — any agent that can run a shell can do it without the script:
curl -sX POST https://x.hiqlcd.com/api/cortex/oauth/device_authorization \
-H 'Content-Type: application/json' \
-d '{"agent_id":"my-agent","agent_name":"My Assistant","scope":"lca_data"}'
# hand the returned verification_uri_complete to the user → they approve
curl -sX POST https://x.hiqlcd.com/api/cortex/oauth/token \
-H 'Content-Type: application/json' -d '{"device_code":"..."}' # 428 = not yet approved, keep polling
Prefer MCP when the host supports it. If lookup_datasets, aggregate_datasets, epd_search are already available in this session, use them. Otherwise add this to the host's MCP config (WorkBuddy ~/.workbuddy/mcp.json, Claude Code ~/.claude.json, Cursor ~/.cursor/mcp.json) and restart the host:
{
"mcpServers": {
"cortex": {
"type": "http",
"url": "https://x.hiqlcd.com/api/cortex/mcp",
"headers": { "X-API-Key": "sk_xxx" }
}
}
}
Credentials from login work too — replace that line with "Authorization": "Bearer <credential>".
Never hard-code credentials into files generated for the user.
| Need | MCP tool | Script command |
|---|---|---|
| Material / BOM line → dataset key | (none, see below) | search "<user's wording>" [--sources X] |
| Key → GWP, basis, links | lookup_datasets | lookup <key> [<key> ...] |
| Cohort → GWP distribution, percentile positioning | aggregate_datasets | aggregate --source X [--target N] |
| Cohort → non-GWP LCIA indicators (AP/EP/ODP/WDP/ADP) | aggregate_indicators | indicators <keys> --indicator AP --source X |
| Single dataset → process-level hotspots | process_hotspot | hotspot <key> |
| Published EPD search | epd_search | epd "<query>" [--unit m3] |
| EPD peer distribution, outlier check | epd_peer_benchmark | epd-benchmark "<category>" --unit m3 |
Add --json to any script command for the raw payload.
Search has no MCP tool — it is a REST endpoint, wrapped by the script. Direct call:
curl -sN -X POST https://x.hiqlcd.com/api/cortex/search \
-H "X-API-Key: sk_xxx" -H "Content-Type: application/x-www-form-urlencoded" \
-d "query=304 stainless steel&sources=BAFU,Ecoinvent"
The response is SSE — parse the WorkflowCompleted event, then JSON-decode its content field. It takes 20–40 seconds (the server searches and verifies each hit). That is normal, not a hang; do not retry in parallel.
dataset_key is an opaque handle — pass it through unchanged, never construct or edit one.
| Field | Meaning | What to do |
|---|---|---|
status: found / partial / not_found | partial = results found, some restricted | Show them; handle restricted per hard rule 3 |
summary | The server's account of this search | Relay it; do not invent a competing explanation |
fit: high / medium / low | Server-assigned match quality | Confirm with the user before citing a low |
name / ref_product / location | Dataset name, reference flow, geography | Read before citing — "cold-rolled annealed coil" and "heavy plate" are different products |
restricted: true | No data package for that database | Give the purchase_url; a free-database alternative must be labelled as such |
missing_keys non-empty | Key came from an older catalogue version | Search again; do not hand-edit keys |
comparability_note | Cohort comparability caveats | Read before comparing |
entitlement | An empty aggregate is an entitlement issue, not a predicate issue | Do not retry with a different predicate |
Top to bottom, first match wins.
| Signal | What to do |
|---|---|
| User gives their own number and asks where it sits ("is my 2.5 high or low") | aggregate with a cohort predicate + --target → percentile positioning |
| A material or BOM to match against datasets | search → batch lookup |
| Comparing two production routes (BF-BOF vs EAF steel, primary vs recycled aluminium) | Search and aggregate each route separately, compare under one functional unit |
| "Is this EPD value reasonable" | epd-benchmark with an explicit --unit; cross-unit comparison is meaningless |
| Multi-indicator assessment (acidification, eutrophication …) | indicators, one indicator at a time; --source must match the cohort's database |
Search first, compare second, ask last. If there is anything searchable — a material name, product, process, or BOM line — search it and give results in the same turn. Do not ask for information already stated in the conversation.
"I'm not sure which one to use" is a decision-support signal, not a question: give the candidate list, compare under one convention, explain which dimension drives the difference, and give a conditional recommendation where the evidence supports one. A complete advisory answer can end there.
Only ask when a single dataset must be finalised and the remaining ambiguity would materially change the result. Options must correspond to candidates already shown — never invent them. Use the host's interaction facility if one exists, and do not duplicate the options as a text list. After the answer, complete the match on the existing results; do not re-run the same search.
| Tier | Content | Requirement |
|---|---|---|
| Catalogue | All 18 databases: inventory, versions, system models, LCIA coverage; dataset names, units, geographies | None |
| Free database values | GWP and aggregates for BAFU, USLCI, ELCD, EF, AusLCI, NEEDS, ozLCI, worldsteel, USDA, bioenergiedat, recycledplastics | Any valid credential |
| Commercial database values | GWP and aggregates for Ecoinvent, HiQLCD, HiQLCD-AL, CALCD (automotive), CarbonMinds, Agri-footprint | Matching data package |
Data packages and subscription plans are two separate systems — upgrading a plan does not unlock a database. When something is restricted, name the database, hand over the purchase_url, and offer a free-database path if one answers the same question, labelled as a substitution.
Write for LCA practitioners, like a knowledgeable peer.
| Symptom | Cause | Fix |
|---|---|---|
401 {"code":"INT-007"} | Used Bearer, or the key is invalid | Use X-API-Key |
CDN returns error 1010 | Default HTTP client User-Agent is blocked | The bundled script sets one; add a normal User-Agent on direct calls |
| Search takes 30 seconds | Normal — it searches and verifies | Wait; do not retry in parallel |
Aggregate status: "empty" with entitlement | Commercial database, no package | Not a predicate problem; do not retry |
Aggregate status: "empty" without entitlement | The predicate genuinely matched nothing | Broaden the predicate |
indicators returns empty | source must equal the cohort's actual database (method_id is not portable) | Pass the correct --source |
| Cohort values span orders of magnitude | Mixed functional units, not real dispersion | Narrow the predicate; read comparability_note first |
Authorization polling returns 428 | The user has not approved yet | Normal — keep polling at the returned interval |
| Still no commercial data after login | That account has no such data package | Login only changes credentials, not entitlements; show the purchase link |