dsh-kb-rag
将本地文档和Zotero文献导入知识库,提供检索与带引用的问答。 适合需要整理研究资料、检索论文段落并追溯页码和引用来源的用户。支持文件夹导入及Zotero同步。
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Breeze136/dsh-kb-rag說明文件
閱讀完整 README ↗Configuration
| Variable | Default | Applies to | Description |
|---|---|---|---|
KB_EMBED_MODEL | BAAI/bge-small-zh-v1.5 | Engine | Embedding model; downloaded to the Hugging Face cache on first use |
KB_RERANK_MODEL | BAAI/bge-reranker-base | Engine | Reranking model |
KB_DEVICE | auto | Engine | auto uses the GPU whenever a CUDA build of torch finds a working device; cpu / cuda / cuda:1 / mps force a choice. Any device failure falls back to CPU automatically |
KB_GPU_PROBE | 1 | Engine | 0 skips the one-off "can this device actually compute?" probe (a tiny matmul) and goes straight to the model load — an escape hatch for unusual environments |
KB_EMBED_BATCH | GPU 128 / CPU 32 (tiered below 8 GB VRAM) | Engine | Embedding batch size for ingest and search. Raising it does not help on small models — measured throughput is flat from 32 to 256 |
KB_RERANK_BATCH | GPU 64 / CPU 16 (tiered below 8 GB VRAM) | Engine | Reranking batch size |
KB_MODEL_RETRY_SECS | 120 | Engine | How long a failed model load is remembered before retrying (0 = every call, negative = never retry) |
HF_ENDPOINT | none | Engine | Set to https://hf-mirror.com on restricted networks |
KB_AUTO_PIP | 0 | npm package | 1 installs missing Python dependencies at startup (fixed argv; by default only the command is printed). The dynamic plugin host reports but does not install |
KB_RAG_ROOT | DSH: session workspace .kb; MCP: ~/.kb-rag | MCP | Knowledge base directory; per-call override with kb_root |
KB_RAG_PYTHON | current interpreter | MCP | Interpreter used for the engine, to avoid a bare python resolving elsewhere |
KB_ASYNC_THRESHOLD | 25 | Engine | Pending file count above which kb_ingest forks a background job and returns a job_id (poll with kb_status) |
KB_SQLITE_WAL | off | Engine | 1 enables SQLite WAL; the default is safer when the .kb directory is synchronised |
UNPAYWALL_EMAIL | built-in placeholder | Engine | Contact address used by kb_fetch for Unpaywall queries; set your own |