@tplog/pi-zendy 0.2.17 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,120 +0,0 @@
1
- ---
2
- name: zendesk-kg
3
- description: "Search the Zendesk Knowledge Graph via the `zendesk-kg` CLI. Hybrid (vector + fulltext) retrieval over historical tickets — use for cross-ticket / semantic lookups that go beyond `zcli` single-ticket fetch."
4
- ---
5
-
6
- # zendesk-kg
7
-
8
- `zendesk-kg` is a CLI for the Zendesk Knowledge Graph retrieval API. It performs **hybrid search (vector + fulltext) with Reciprocal Rank Fusion** over an index of historical Dify Enterprise support tickets — each ticket pre-summarized into `quickSummary` / `issueSummary` / `solutionSummary`. Use it when you need to find **similar past issues, related conversations, or aggregated knowledge** that a single-ticket lookup can't surface.
9
-
10
- ## When to use this skill
11
-
12
- - The user is investigating a recurring symptom and you want to find **other tickets that show the same pattern**
13
- - You need cross-ticket evidence ("has anyone else hit this?") to support a hypothesis
14
- - You want to retrieve related KB-style ticket summaries before drafting a reply
15
-
16
- ## When NOT to use
17
-
18
- - The user gave you a specific ticket ID — use `zcli <id>` + `zcli comments <id>`. zendesk-kg returns curated *summaries*, not the raw ticket / comment thread.
19
- - The question is answerable from Helm chart values or source code — use `helm-watchdog` or `source-check` first.
20
-
21
- ## Quick start
22
-
23
- ```bash
24
- zendesk-kg --help
25
- zendesk-kg search --help # has the most options worth knowing
26
- ```
27
-
28
- ## Install (if missing)
29
-
30
- The standard `zendy` install handles this automatically. To install manually:
31
-
32
- ```bash
33
- curl -fsSL https://raw.githubusercontent.com/sorphwer/zendesk-kg-cli-release/main/install.sh | sh
34
- zendesk-kg init # paste your RETRIEVER_API_KEY
35
- ```
36
-
37
- Config lives in `~/.zendesk-kg/.env` (`RETRIEVER_API_KEY`, `RETRIEVER_API_URL`).
38
-
39
- ## Core commands
40
-
41
- | Command | Purpose |
42
- |---|---|
43
- | `zendesk-kg search "<query>" [flags]` | Hybrid search. Natural-language query. |
44
- | `zendesk-kg stats` | Show current index size / coverage. |
45
- | `zendesk-kg health` | Check API connectivity. **Currently unreliable — see Caveats below.** |
46
- | `zendesk-kg init` | Re-enter API key / URL. Setup only. |
47
- | `zendesk-kg set-env output json` | Set default output format. |
48
- | `zendesk-kg update` | Self-update the CLI binary. Don't run proactively. |
49
-
50
- ## `search` flags worth knowing
51
-
52
- ```
53
- -k, --top-k INTEGER Number of results to return (1-20, default 5)
54
- -s, --order-by TEXT rrfScore | createdAt | priority
55
- -o, --output FORMAT table | json | text
56
- --priority TEXT Filter: high / normal / low / urgent
57
- -v, --version TEXT Filter by Dify version mentioned in the ticket
58
- --created-after DATE
59
- --use-llm LLM-formatted summary instead of raw JSON
60
- ```
61
-
62
- For agent automation always use `-o json`. `table` is for humans, `text` is for terminal browsing.
63
-
64
- ## Output format (real shape, not pseudocode)
65
-
66
- `search -o json` returns:
67
-
68
- ```json
69
- {
70
- "results": [
71
- {
72
- "ticketId": "765",
73
- "subject": "<original ticket subject, often non-English>",
74
- "status": "closed | open | pending | ...",
75
- "priority": "low | normal | high | urgent",
76
- "quickSummary": "1-2 sentence summary in English",
77
- "issueSummary": "Multi-paragraph: Environment / Symptoms / User Questions / Timeline",
78
- "solutionSummary": "Multi-paragraph: Analysis / Actions / Recommendations / Resolution",
79
- "createdAt": "YYYY-MM-DD HH:MM:SS",
80
- "handledBy": ["agent_name", ...],
81
- "versions": ["3.8.0", ...],
82
- "keywords": ["sso", "oidc", ...],
83
- "referenceUrls": [...],
84
- "channels": { ... }
85
- },
86
- ...
87
- ]
88
- }
89
- ```
90
-
91
- **Always surface `ticketId`, `quickSummary`, and `solutionSummary`** when reporting back to the user. The FDE will follow up on the ticket via `zcli <ticketId>` for full context. Don't dump the whole JSON.
92
-
93
- ## Behavioral rules the agent must follow
94
-
95
- - **Use natural-language queries.** Describe the symptom in the user's words; the graph handles semantics. Don't manually OR a bunch of keywords.
96
- - **Cite ticket IDs.** When summarizing for the user, always include the ticket IDs the synthesis is drawn from — the FDE will want to read the originals.
97
- - **`search` returns curated summaries, not raw tickets.** For raw comment threads, follow up with `zcli <id>` + `zcli comments <id>`.
98
- - **Filter when you can.** If the user mentioned a Dify version (`-v 3.8.0`) or priority (`--priority high`), use the flag — don't filter post-hoc on the JSON.
99
- - **Don't assume coverage.** The KG is indexed over a snapshot, not live Zendesk. Empty result ≠ proof nothing exists. Fall back to `zcli search` for live data.
100
- - **Don't run `update` without explicit user request.** Self-update mutates the binary on disk.
101
-
102
- ## Typical retrieval flow
103
-
104
- ```bash
105
- # 1. Cast a wide semantic net for context (most-relevant first by default)
106
- zendesk-kg search "users intermittently logged out after SSO with MFA enabled" -k 5 -o json
107
-
108
- # 2. Inspect the most relevant ticket end-to-end via zcli
109
- zcli <ticketId>
110
- zcli comments <ticketId>
111
-
112
- # 3. Cross-check Helm config / source as needed
113
- # (helm-watchdog, source-check skills)
114
- ```
115
-
116
- ## Caveats
117
-
118
- - **`health` and `stats` may report `Redirecting...` / `unreachable` even when `search` works.** As of zendesk-kg 0.1.2 / retriever backend v0.1, those endpoints sit behind a 302 redirect to a login page while `/search` is API-key-authenticated directly. **Don't gate retries on `health`** — if `search` failed and you want to diagnose, retry `search` itself or surface the error verbatim to the user. Treat `health: ok` as a real signal, but `health: unreachable` as inconclusive.
119
- - **Errors come back in the JSON body, not via exit code.** All commands tend to exit 0 even when the API rejects the request. Always parse `stdout` for `"error"` / `"status": "unreachable"` instead of relying on `$?`.
120
- - **Index is a snapshot.** The catalog won't include tickets that opened today; for fresh tickets use `zcli search`.