Platform · Knowledge Base (remote Wiki)
Purpose
Query the team Wiki knowledge base via the Knowledge Base Bridge HTTP API. Used by @Tester / @FrontendDev / @BackendDev / @Architect to look up entry paths, terminology, and historical context.
Integrated from the internal knowledge-base squad; script
scripts/kb_ask.py(stdlib only, cross-platform).
Architecture
Agent (local)
↓ kb_ask.py (HTTP)
Knowledge Base Bridge :3910
↓ Cursor SDK Agent + Skills
Team Wiki
/home/ubuntu/cursor-workspace/.cursor/skills/knowledge-base/wiki/
(The path lives on the knowledge-base service side; the local Agent only accesses it through the Bridge HTTP API.)
Agent execution rules (mandatory)
| Step | Action | Forbidden |
|---|---|---|
| 1 | python scripts/kb_ask.py --health |
SSH fallback, hand-written curl |
| 2 | python scripts/kb_ask.py "question" [system-code] |
Fabricating the source of a citation |
| 3 | Present the answer from stdout |
Expanding historical rules into current acceptance criteria |
Bridge identification rules
The script automatically satisfies the Wiki Q&A conditions (the Agent must not switch to another HTTP method to bypass it):
taskId >= 500000000(default generated by script)- prompt prefix
【Wiki 知识库问答】
When to use
- The local machine has no knowledge-base copy and you need to look up business Wikis such as CRM/MES/BOSS
- The user asks to query the team knowledge base remotely
- T1 Step 0.5b: retrieve entry paths / terminology / historical context by module keyword (acceptance still uses the current JIRA as source of truth)
When not needed
- A complete local knowledge-base copy already exists and Read/Grep hits the needed content directly
- The question is unrelated to the current requirement, or only verifying Bridge connectivity (use
--health)
Usage
python scripts/kb_ask.py --health
python scripts/kb_ask.py "Where is the CRM case-management entry?"
python scripts/kb_ask.py "MES work-order status" MES
python scripts/kb_ask.py "question" --json
Configuration
| Variable | Description |
|---|---|
KB_BRIDGE |
Bridge address, default in config.yaml |
KB_POLL_INTERVAL |
Poll interval seconds, default 2 |
KB_POLL_TIMEOUT |
Timeout seconds, default 600 |
Timeout / unavailable stop rule (mandatory)
Do not stall in "running" waiting for the knowledge base.
--healthfails, orkb_ask.pytimes out/errors → mark "team knowledge base unavailable/timeout"- End this round of waiting immediately, explain the block and options (retry / skip KB / check Bridge)
- The caller (e.g. T1 Step 0.5) may annotate and continue, but must not poll repeatedly until the user perceives a hang
- Do not fabricate business rules or citation sources because of unavailability
Troubleshooting
| Symptom | Handling |
|---|---|
| Cannot reach Bridge | VPN/intranet; python scripts/kb_ask.py --health |
| Timeout | Follow the stop rule above; only raise KB_POLL_TIMEOUT when the user explicitly asks |
| status=error | Add --json to inspect error |
Relationship to the test flow
- T1 functional cases (
multica-test-t1-design): before generation, Step 0.5 queries the KB for entry/terminology; acceptance still uses current JIRA/PRD as source of truth - Interface scenario supplement (
multica-platform-apifox): query historical auth/data-seeding for the same module - Frontend/backend implementation: query module conventions, error codes, permission semantics
Why it works
The knowledge base was extracted from a test-only squad into a platform skill, mounted by role on demand, avoiding hardcoding the Bridge address or SSH path in role prompts.