Tiangong KB Patent Search
Use this skill for Tiangong patent-source retrieval. It is intentionally
single-source: always search patent, never all, sci, or report.
In Auto Research, a patent-source requirement must name the reviewed patent
capability in requiredCapabilityIds; Brave or SCI results cannot stand in for
it. If that capability is absent, stop at preflight and have the owner import,
configure, license, credential, lock, and smoke the exact patent capability.
The standalone wrapper never reads the workspace broker credential store.
Prerequisites
- The standalone wrapper defaults to its separately tested CLI version
0.0.30; this is not the Auto Research workspace runtime. Set
TIANGONG_AI_CLI or TIANGONG_AI_CLI_BIN only to intentionally override the
standalone entrypoint.
- Set
TIANGONG_PATENT_APIKEY or the common fallback
TIANGONG_AI_APIKEY. Credentials are rejected recursively in wrapper JSON,
request files, URL query parameters, and 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 owner-only, regular, and non-symlinked; only documented
Tiangong patent credential, endpoint, region, and timeout variables are
loaded, and existing environment values 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/patent_search.sh '{
"query": "mechanical recycling polymer purification patent",
"top_k": 5
}'
When the current directory is inside a managed workspace, this command is
blocked before credential loading or network. Only a user who explicitly asks
for one isolated query may add "execution_mode":"standalone"; the wrapper
then emits a non-secret audit event.
The script calls:
npx --yes @tiangong-ai/cli@0.0.30 research search --query <query> --sources patent --json
For exact edge-function payloads, provide request_file or input_file:
./scripts/patent_search.sh '{
"request_file": "./patent-request.json",
"dry_run": true
}'
Raw Payload Filters
Wrapper JSON can include inline raw patent_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": "battery recycling equipment",
"filter": {
"assignee": ["example company"]
},
"datefilter": {
"publication_date": { "gte": 1262304000 }
},
"topK": 5
}
filter: metadata term filters, shaped as { "field": ["value"] }.
datefilter: numeric range filters, shaped as
{ "field": { "gte"?: number, "lte"?: number } }, for indexed numeric/date
metadata fields.
topK: raw edge-function name for result count.
extK and getMeta are not supported by patent_search.
Input Fields
query, input, or claim: 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.
execution_mode: only standalone, and only after an explicit isolated
owner request when a managed workspace is detected.
filter, datefilter, topK: optional inline raw payload fields for patent
search.
sources: optional compatibility field; only patent or default is
accepted.
dry_run: true to return the exact request plan with masked credentials.
api_base_url; credentials must come from allowed owner environment
variables or an owner-only env file.
patent_url, region, timeout.
top_k: only used in query mode.
1---2name: tiangong-kb-patent-search3description: Perform one isolated owner-requested Tiangong patent search outside Auto Research, or provide patent-source method guidance for a separately reviewed locked broker capability. Searches only `patent`. If an ancestor contains `.tiangong-research` and the request is open-ended, multi-source, analytical, builds on prior outputs, or produces a conclusion/artifact, route to `tiangong-auto-research` and do not execute this standalone wrapper. Inside a managed workspace, standalone use requires the user's explicit isolated-query request and `execution_mode=standalone`.4---5
6# Tiangong KB Patent Search
7
8Use this skill for Tiangong patent-source retrieval. It is intentionally
9single-source: always search `patent`, never `all`, `sci`, or `report`.
10
11In Auto Research, a patent-source requirement must name the reviewed patent
12capability in `requiredCapabilityIds`; Brave or SCI results cannot stand in for
13it. If that capability is absent, stop at preflight and have the owner import,
14configure, license, credential, lock, and smoke the exact patent capability.
15The standalone wrapper never reads the workspace broker credential store.
16
17## Prerequisites
18
19- The standalone wrapper defaults to its separately tested CLI version
20 `0.0.30`; this is not the Auto Research workspace runtime. Set
21 `TIANGONG_AI_CLI` or `TIANGONG_AI_CLI_BIN` only to intentionally override the
22 standalone entrypoint.
23- Set `TIANGONG_PATENT_APIKEY` or the common fallback
24 `TIANGONG_AI_APIKEY`. Credentials are rejected recursively in wrapper JSON,
25 request files, URL query parameters, and CLI arguments.
26- When `request_file` / `input_file` is provided, the wrapper loads `.env` from
27 that file's directory by default. `env_file` can point to a different dotenv
28 file. It must be owner-only, regular, and non-symlinked; only documented
29 Tiangong patent credential, endpoint, region, and timeout variables are
30 loaded, and existing environment values win.
31- Optionally set `TIANGONG_AI_API_BASE_URL`; the CLI accepts a Supabase project
32 root, `/functions/v1`, or `/rest/v1` and derives Functions URLs.
33
34## Search
35
36For normal searches, pass a query:
37
38```bash
39./scripts/patent_search.sh '{
40 "query": "mechanical recycling polymer purification patent",
41 "top_k": 5
42}'
43```
44
45When the current directory is inside a managed workspace, this command is
46blocked before credential loading or network. Only a user who explicitly asks
47for one isolated query may add `"execution_mode":"standalone"`; the wrapper
48then emits a non-secret audit event.
49
50The script calls:
51
52```bash
53npx --yes @tiangong-ai/cli@0.0.30 research search --query <query> --sources patent --json
54```
55
56For exact edge-function payloads, provide `request_file` or `input_file`:
57
58```bash
59./scripts/patent_search.sh '{
60 "request_file": "./patent-request.json",
61 "dry_run": true
62}'
63```
64
65## Raw Payload Filters
66
67Wrapper JSON can include inline raw `patent_search` fields; the wrapper will
68forward them through the CLI `--input` path. The same payload can also be put in
69`request_file` / `input_file`:
70
71```json
72{
73 "query": "battery recycling equipment",
74 "filter": {
75 "assignee": ["example company"]
76 },
77 "datefilter": {
78 "publication_date": { "gte": 1262304000 }
79 },
80 "topK": 5
81}
82```
83
84- `filter`: metadata term filters, shaped as `{ "field": ["value"] }`.
85- `datefilter`: numeric range filters, shaped as
86 `{ "field": { "gte"?: number, "lte"?: number } }`, for indexed numeric/date
87 metadata fields.
88- `topK`: raw edge-function name for result count.
89- `extK` and `getMeta` are not supported by `patent_search`.
90
91## Input Fields
92
93- `query`, `input`, or `claim`: convenience query text.
94- `request_file` or `input_file`: JSON body forwarded unchanged.
95- `env_file`: optional dotenv file. Without it, `request_file` /
96 `input_file` causes the wrapper to load `.env` from that file's directory.
97- `execution_mode`: only `standalone`, and only after an explicit isolated
98 owner request when a managed workspace is detected.
99- `filter`, `datefilter`, `topK`: optional inline raw payload fields for patent
100 search.
101- `sources`: optional compatibility field; only `patent` or `default` is
102 accepted.
103- `dry_run`: true to return the exact request plan with masked credentials.
104- `api_base_url`; credentials must come from allowed owner environment
105 variables or an owner-only env file.
106- `patent_url`, `region`, `timeout`.
107- `top_k`: only used in query mode.