← 返回 Skills 市场
hata1234

ClawKB

作者 hata1234 · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ 安全检测通过
132
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install clawkb
功能描述
Operate ClawKB servers over HTTP to register agents, authenticate, upload images, create, update, search, read entries, and manage comments with Bearer token...
使用说明 (SKILL.md)

ClawKB

Overview

This skill is for operating ClawKB as an API client. Use it when the task is to register an agent account, authenticate with a Bearer token, upload images to MinIO through ClawKB, create or edit entries, or search and read stored knowledge.

Assume the server base URL is provided by the user. If not, ask for it. Prefer curl examples unless the user requests another client.

Quick Start

  1. Get a base URL, for example http://localhost:3500.
  2. If you do not already have a token, register an agent with POST /api/auth/register-agent.
  3. Store the returned apiToken.
  4. Send authenticated requests with Authorization: Bearer \x3Ctoken>.

Example:

BASE_URL="http://localhost:3500"

curl -sS "$BASE_URL/api/auth/register-agent" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "OpenClaw Recon Agent",
    "avatarUrl": "https://example.com/agent-avatar.png"
  }'

Successful response fields to retain:

  • user.id
  • user.username
  • apiToken
  • token.prefix
  • token.type

Authentication

Use Bearer token auth for API automation.

TOKEN="clawkb_..."

curl -sS "$BASE_URL/api/me" \
  -H "Authorization: Bearer $TOKEN"

If the response is 401, the token is invalid or revoked. If the response is 403, the token exists but the user does not have enough permission for that route.

Create Entries

Use POST /api/entries.

Required fields:

  • type
  • source
  • title

Common optional fields:

  • summary
  • content
  • status
  • url
  • tags
  • metadata
  • images

Example:

curl -sS "$BASE_URL/api/entries" \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "report",
    "source": "nightly-recon",
    "title": "GPU cluster pricing moved lower this week",
    "summary": "Spot market pricing softened across three vendors.",
    "content": "## Notes\
Observed lower prices in APAC and US regions.",
    "status": "new",
    "tags": ["gpu", "cloud-pricing"],
    "metadata": {
      "region": ["us", "apac"],
      "confidence": "medium"
    }
  }'

The response includes:

  • entry core fields
  • author
  • tags
  • images

Edit Entries

Use PATCH /api/entries/:id.

Editors can update their own entries. Admins can update any entry.

ENTRY_ID=123

curl -sS -X PATCH "$BASE_URL/api/entries/$ENTRY_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "summary": "Updated summary after analyst review.",
    "status": "interested",
    "tags": ["gpu", "cloud-pricing", "capacity"]
  }'

Delete uses DELETE /api/entries/:id and is typically admin-only.

Upload Images

Use POST /api/upload with multipart/form-data.

For entry images:

curl -sS "$BASE_URL/api/upload" \
  -H "Authorization: Bearer $TOKEN" \
  -F "kind=entry" \
  -F "file=@/path/to/image.png"

For avatar images:

curl -sS "$BASE_URL/api/upload" \
  -H "Authorization: Bearer $TOKEN" \
  -F "kind=avatar" \
  -F "file=@/path/to/avatar.png"

Upload response fields:

  • url
  • key
  • filename
  • mimeType
  • size

To attach uploaded images when creating or editing an entry, include:

{
  "images": [
    {
      "url": "https://minio.example/entries/user-7/...",
      "key": "entries/user-7/...",
      "filename": "image.png",
      "mimeType": "image/png",
      "size": 12345,
      "caption": "Optional caption"
    }
  ]
}

Search And Read

List or search entries with GET /api/entries.

Useful query params:

  • search
  • type
  • status
  • source
  • tag
  • page
  • limit
  • sort

Examples:

curl -sS "$BASE_URL/api/entries?search=gpu&limit=10" \
  -H "Authorization: Bearer $TOKEN"
curl -sS "$BASE_URL/api/entries?tag=cloud-pricing&status=interested" \
  -H "Authorization: Bearer $TOKEN"

Read one entry:

curl -sS "$BASE_URL/api/entries/$ENTRY_ID" \
  -H "Authorization: Bearer $TOKEN"

Entry detail may include pluginRender, which indicates plugin-provided UI or related blocks.

Comments

To comment on another user's entry, use:

curl -sS "$BASE_URL/api/entries/$ENTRY_ID/comments" \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"content":"Flagging this for follow-up next week."}'

List comments:

curl -sS "$BASE_URL/api/entries/$ENTRY_ID/comments" \
  -H "Authorization: Bearer $TOKEN"

API Reference

  • POST /api/auth/register-agent Registers an agent user and returns a new API token.
  • GET /api/me Returns the authenticated principal.
  • POST /api/upload Uploads an entry image or avatar.
  • GET /api/entries Lists and searches entries.
  • POST /api/entries Creates an entry.
  • GET /api/entries/:id Reads one entry.
  • PATCH /api/entries/:id Updates one entry.
  • DELETE /api/entries/:id Deletes one entry.
  • GET /api/entries/:id/comments Lists comments for an entry.
  • POST /api/entries/:id/comments Creates a comment.
  • GET /api/search Uses ClawKB search endpoints if the deployment exposes them.

Working Rules

  • Prefer Bearer token auth for agent automation.
  • Preserve returned key values from image upload responses; they are needed for image references.
  • When updating entries, send only the fields that should change.
  • If the server returns plugin-related data, keep it intact unless the user explicitly wants to strip or replace it.
  • If a request fails, surface the HTTP status and the JSON error field.

Auto-Recall Plugin (Optional)

By default this skill provides manual ClawKB access — the agent must explicitly call the API to search. For automatic knowledge recall on every conversation, install the companion OpenClaw gateway plugin:

openclaw plugins install @hata1234/clawkb-openclaw

What it does:

  • Hooks into before_prompt_build — automatically searches ClawKB before the agent sees each message
  • Injects relevant knowledge entries into the agent's system context
  • Supports multiple ClawKB instances in parallel (e.g. personal KB + company KB + public KB)
  • Per-sender token mapping — different users get different access levels, controlled entirely by ClawKB server-side ACL

After installing, configure in OpenClaw settings:

  1. Add your ClawKB instance URL
  2. Create API tokens in ClawKB (Settings → API Tokens)
  3. Map sender IDs to tokens in the plugin config

Don't want it? This is completely optional. The skill works fine without the plugin — you just search manually via the API.

Internal Links (Entry Mentions)

ClawKB supports internal links between entries using a wiki-style syntax:

[[entry:ID|Display Title]]

Examples:

See point 3 in [[entry:134|Gap Analysis]]
This issue is discussed in [[entry:143|Root Cause Report]] and [[entry:145|Mitigation Plan]]

Rules:

  • The syntax is [[entry:\x3Cnumeric_id>|\x3Cdisplay_text>]]
  • display_text is typically the entry title at time of writing
  • When rendered, these become clickable links to /entries/\x3Cid> with a distinctive pill-badge style
  • The search API supports numeric ID lookup: ?search=142 will match entry #142 directly
  • Do NOT use plain #123 for entry references — that syntax is not recognized and may conflict with other uses (e.g. order numbers)
  • When creating entries that reference other entries, always use the [[entry:ID|title]] format
  • In the web UI, users can type [[ in the content editor to trigger an autocomplete popup for selecting entries

Agent usage example (creating an entry with internal links):

curl -sS "$BASE_URL/api/entries" \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "knowledge",
    "source": "agent",
    "title": "Unified Root Cause Analysis",
    "content": "## Analysis\
\
Based on [[entry:143|Root Cause Report]], insufficient moisture retention was the primary factor.\
\
See [[entry:147|Mitigation Summary]] for action items.",
    "tags": ["quality", "analysis"]
  }'
安全使用建议
This skill is an instruction-only API client for a ClawKB server and appears coherent. Before installing or using it: (1) Make sure the ClawKB server base URL you provide is trustworthy; all API calls (including file uploads) go to that server. (2) Treat the returned apiToken/Bearer token as a secret — only provide it to servers you control or trust. (3) Be aware that uploading images will transmit the specified local files to the remote server; do not upload sensitive files inadvertently. (4) Confirm whether you want the optional Auto-Recall (automatic query/recall on each conversation) enabled — if turned on it may cause the agent to automatically send conversation context to the server. (5) Because this is instruction-only, no code is installed locally, but granting network access and tokens does expose data to the remote service. If any of these points are unacceptable, do not enable the skill or do not provide tokens/URLs to it.
功能分析
Type: OpenClaw Skill Name: clawkb Version: 1.0.2 The clawkb skill bundle provides a standard interface for an AI agent to interact with a ClawKB knowledge base server via HTTP. It includes instructions for authentication, CRUD operations on entries, and image uploads using curl, all of which align with its stated purpose. While it suggests an optional plugin installation (@hata1234/clawkb-openclaw) for automated knowledge recall, there is no evidence of malicious intent, obfuscation, or unauthorized data exfiltration in the provided files (SKILL.md, _meta.json).
能力评估
Purpose & Capability
The name/description match the SKILL.md: all endpoints and actions described (register agent, authenticate with a Bearer token, upload images, create/update/search/read entries, manage comments) are present and consistent. The skill does not request unrelated credentials, binaries, or config paths.
Instruction Scope
Instructions stay within the stated API-client scope and provide curl examples for register/auth/upload/create/edit/search/read/comment flows. Two notes: (1) examples use local file paths for uploads (e.g., /path/to/image.png); uploading local files will transmit that file to the remote server and requires user consent. (2) The SKILL.md contains a truncated 'Auto-Recall Plugin' section implying optional automatic recall on conversations — that could cause the agent to automatically query/submit data to the server if enabled. The auto-recall behavior is not fully specified here and should be confirmed before enabling.
Install Mechanism
No install spec and no code files beyond SKILL.md and a small agents metadata file. Instruction-only skills are low-risk from installation perspective because nothing is written to disk by the skill itself.
Credentials
The skill declares no required environment variables or credentials. It expects the user or agent to provide a server base URL and a Bearer token (apiToken) obtained from the server; that is appropriate and proportional to an API client. Note: the returned apiToken is sensitive and should be treated as a secret by the user/agent.
Persistence & Privilege
always: false and no install-time persistence. The skill allows normal autonomous invocation (disable-model-invocation: false) which is the platform default. There is no indication the skill modifies other skills or system-wide agent settings. If the optional Auto-Recall feature is enabled in the agent, that increases the skill's runtime activity and privacy surface — confirm its behavior before enabling.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install clawkb
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /clawkb 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
Fix: actually replace Chinese examples with English dummy data
v1.0.1
Replace Chinese examples with English dummy data
v1.0.0
Initial release: ClawKB API client skill for agents — CRUD, search, upload, comments, internal links. Includes auto-recall plugin guidance.
元数据
Slug clawkb
版本 1.0.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

ClawKB 是什么?

Operate ClawKB servers over HTTP to register agents, authenticate, upload images, create, update, search, read entries, and manage comments with Bearer token... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 132 次。

如何安装 ClawKB?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install clawkb」即可一键安装,无需额外配置。

ClawKB 是免费的吗?

是的,ClawKB 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

ClawKB 支持哪些平台?

ClawKB 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 ClawKB?

由 hata1234(@hata1234)开发并维护,当前版本 v1.0.2。

💬 留言讨论