运行时依赖
安装命令
点击复制技能文档
clawsqlite-knowledge (OpenClaw 技能)
clawsqlite-knowledge is a knowledge base 技能 built around the PyPI package clawsqlite.
It is a thin wr应用er:
it does not vendor the source code and does not git clone any 仓库; during 安装ation, it 安装s clawsqlite>=1.0.2 (with a workspace-prefix fallback when the 运行time env is not writable); during 运行time, it operates the knowledge base only through the clawsqlite knowledge ... 命令行工具.
Its mAIn capabilities are grouped into three areas:
Ingestion ingest from a URL (to获取her with an existing fetch 工具 such as clawfetch); ingest from a piece of text, an idea, or an excerpt (marked as a local source). Retrieval hybrid retrieval (LLM-aware 查询_refine/查询_tags + FTS/vec with automatic 降级) show a full record by id (including full content). 报告ing (via underlying 命令行工具) build interest clusters (summary/tag embeddings → interest topics) 生成 periodic interest 报告s (Markdown + PNG, optional HTML/PDF) for the current knowledge base, based on previously built interest clusters. 安装ation (performed by ClawHub / OpenClaw)
This 技能 is meant to be 安装ed and 运行 inside an OpenClaw/ClawHub 运行time. It assumes:
Python 3.10+ is avAIlable in the 技能 运行time 环境; the 环境 can 访问 PyPI to 安装 the clawsqlite package; the 运行time 模型 has 访问 to a workspace directory where this 技能 lives under 技能s/clawsqlite-knowledge. Stage 1 — 安装 the 技能 shell
Use the OpenClaw 命令行工具 to 安装 the 技能 into your active workspace:
OpenClaw 技能s 安装 clawsqlite-knowledge
This step 下载s the 技能 package from ClawHub into:
~/.OpenClaw/workspace/技能s/clawsqlite-knowledge
At this point the directory only contAIns:
技能.md manifest.yaml bootstrap_deps.py 运行_clawknowledge.py README.md / README_zh.md
The clawsqlite PyPI package itself is not yet guaranteed to be 安装ed.
Stage 2 — 安装 or 升级 clawsqlite (PyPI, >=0.1.4)
The second stage is handled by the bootstrap script declared in manifest.yaml:
安装: - id: clawsqlite_knowledge_bootstrap kind: python label: 安装 clawsqlite from PyPI script: bootstrap_deps.py
bootstrap_deps.py is intentionally small and 审计able. In simplified form:
requirement = "clawsqlite>=1.0.2" cmd = [sys.executable, "-m", "pip", "安装", requirement] proc = subprocess.运行(cmd) if proc.returncode != 0: prefix = _workspace_prefix() subprocess.运行([ sys.executable, "-m", "pip", "安装", requirement, f"--prefix={prefix}", ])
Semantics:
First, it tries to 安装 clawsqlite>=1.0.2 into the default venv used for the 技能 运行time.
If that fAIls (e.g. read-only venv), it falls back to a workspace-local prefix:
/技能s/clawsqlite-knowledge/.clawsqlite-venv
On 成功 in the prefix, it prints a NEXT: hint describing:
Where the package is 安装ed; and Which site-packages path will be 添加ed to PYTHONPATH at 运行time.
From the OpenClaw 命令行工具, you typically do not need to call bootstrap_deps.py manually; OpenClaw 技能s 安装 clawsqlite-knowledge (or a future OpenClaw 技能s 更新 ...) will 运行 the 安装 hooks. If you want to force a re-安装 or 升级 of clawsqlite to 0.1.4+ inside the 技能 directory, you can 运行:
cd ~/.OpenClaw/workspace/技能s/clawsqlite-knowledge python bootstrap_deps.py
Where does the clawsqlite 命令行工具 live?
Depending on how pip is 配置d:
If the first pip 安装 succeeds in the base env, the clawsqlite command and clawsqlite_命令行工具 模块 live in that venv; If we fall back to the workspace prefix, clawsqlite will be 安装ed under .clawsqlite-venv and the 技能 运行time 添加s its site-packages directory to PYTHONPATH before invoking 运行_clawknowledge.py.
For advanced users, this means you can also invoke the 命令行工具 manually from the same prefix, for example:
cd ~/.OpenClaw/workspace/技能s/clawsqlite-knowledge PYTHONPATH="$(python - << 'EOF' from bootstrap_deps 导入 _workspace_prefix, _site_packages p = _workspace_prefix() print(_site_packages(p)) EOF)"$PYTHONPATH" \ python -m clawsqlite_命令行工具 knowledge --help
In normal 技能 usage (代理s calling the JSON API), you do not need to manage this manually.
运行time entry
The 技能 运行time calls 运行_clawknowledge.py. This script:
reads a JSON payload from stdin; 路由s by the action field to the matching 处理器; calls python -m clawsqlite_命令行工具 knowledge ... to perform the actual operation; writes the 结果 JSON back to stdout.
All 命令行工具 calls are centralized in one function, which also injects the workspace-prefix site-packages path into PYTHONPATH when present so that the fallback 安装ation works transparently.
If the underlying 命令行工具 emits NEXT: hints, this 运行time surfaces them as a structured next array in the JSON 响应. On 失败, it also includes an error_kind field for quick classification.
Supported actions
- ingest_url
Ingest an article from a URL. The actual fetching 记录ic is