🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

RagClaw Knowledge Base

by @emdzej

Local-first knowledge base to index, search, and manage documents and web pages offline using SQLite and local embedding models.

Versionv0.5.0
Downloads464
Installs1
Stars⭐ 1
TERMINAL
clawhub install ragclaw

πŸ“– About This Skill

RagClaw Knowledge Base Skill

Local-first knowledge base for OpenClaw.

Description

Index and search your documents, code, and web pages locally. Zero external APIs, offline embeddings, SQLite-based storage.

Commands

/kb add

Index a file, directory, or URL.

Examples:

/kb add ./docs/
/kb add https://docs.example.com
/kb add ~/projects/my-app/src/
/kb add https://docs.example.com --crawl --crawl-max-depth 2

Options:

  • --db β€” Knowledge base name (default: "default")
  • --recursive β€” Recurse into directories (default: true)
  • --embedder β€” Embedder preset: nomic|bge|mxbai|minilm (default: nomic)
  • --include β€” Regex filter: include only matching filenames
  • --exclude β€” Regex filter: exclude matching filenames
  • --max-depth β€” Maximum directory recursion depth
  • --max-files β€” Maximum number of files to index
  • --crawl β€” Follow links from a seed URL
  • --crawl-max-depth β€” Link traversal depth (default: 3)
  • --crawl-max-pages β€” Max pages to fetch (default: 100)
  • --crawl-same-origin β€” Stay on the same domain (default: true)
  • --crawl-include β€” Comma-separated URL path prefixes to include
  • --crawl-exclude β€” Comma-separated URL path prefixes to exclude
  • --crawl-concurrency β€” Concurrent fetchers (default: 1)
  • --crawl-delay β€” Delay between requests in ms (default: 1000)
  • --enforce-guards β€” Enable path/URL security guards
  • /kb search

    Search the knowledge base.

    Examples:

    /kb search how to configure authentication
    /kb search async function error handling
    /kb search "memory leak" --mode hybrid --limit 10
    

    Options:

  • --db β€” Knowledge base name (default: "default")
  • --limit β€” Max results (default: 5)
  • --mode β€” Search mode: vector|keyword|hybrid (default: hybrid)
  • --json β€” Machine-readable JSON output
  • /kb reindex

    Re-process changed sources and keep vectors up to date.

    Options:

  • --db β€” Knowledge base name (default: "default")
  • -f, --force β€” Force full rebuild (ignore hashes)
  • -p, --prune β€” Remove sources that no longer exist on disk
  • --embedder β€” Switch embedder and rebuild all vectors
  • /kb merge

    Merge another knowledge base into the local one.

    Options:

  • --db β€” Destination knowledge base (default: "default")
  • --strategy β€” strict copies vectors verbatim (same embedder required); reindex re-embeds locally (default: strict)
  • --on-conflict β€” Conflict resolution (default: skip)
  • --dry-run β€” Preview changes without writing
  • --include β€” Comma-separated path prefixes to import
  • --exclude β€” Comma-separated path prefixes to skip
  • /kb status

    Show knowledge base statistics (chunks, sources, vector backend, embedder).

    Options:

  • --db β€” Knowledge base name (default: "default")
  • /kb list

    List indexed sources.

    Options:

  • --db β€” Knowledge base name (default: "default")
  • -t β€” Filter by source type
  • /kb remove

    Remove a source from the index.

    Options:

  • --db β€” Knowledge base name (default: "default")
  • -y β€” Skip confirmation prompt
  • /kb embedder list

    List all available embedder presets with RAM requirements and status.

    /kb embedder download [preset]

    Pre-download a model for offline use.

    Options:

  • --all β€” Download all built-in presets
  • /kb doctor

    Check system health: Node.js version, RAM, sqlite-vec status, embedder compatibility, loaded plugins.

    /kb plugin list

    List discovered plugins with enabled/disabled status.

    /kb plugin enable

    Enable a plugin (use --all for all discovered plugins).

    /kb plugin disable

    Disable a plugin.

    /kb config list

    Show all configuration values and their source (env / config file / default).

    /kb config get

    Show a single config value.

    /kb config set

    Persist a config value to ~/.config/kbclaw/config.yaml.

    Supported Formats

    | Type | Extensions | |------|------------| | Markdown | .md, .mdx | | Text | .txt | | PDF | .pdf (OCR for scanned pages) | | Word | .docx | | Code | .ts, .js, .py, .go, .java | | Images | .png, .jpg, .gif, .webp, .bmp, .tiff (OCR) | | Web | http://, https:// |

    Embedder Presets

    | Alias | Model | Language | Context | Dims | ~RAM | Strengths | |-------|-------|----------|---------|-----:|-----:|-----------| | nomic ⭐ | nomic-ai/nomic-embed-text-v1.5 | English | 8 192 tok | 768 | ~600 MB | Long docs, balanced, default | | bge | BAAI/bge-m3 | 100+ languages | 8 192 tok | 1024 | ~2.3 GB | Multilingual | | mxbai | mixedbread-ai/mxbai-embed-large-v1 | English | 512 tok | 1024 | ~1.4 GB | Best English MTEB | | minilm | sentence-transformers/all-MiniLM-L6-v2 | English | 256 tok | 384 | ~90 MB | Minimal RAM |

    Run /kb doctor to check which presets fit your available RAM.

    Storage

    Knowledge bases are stored as SQLite files following XDG conventions:

  • Default data dir: ~/.local/share/kbclaw/
  • Config file: ~/.config/kbclaw/config.yaml
  • Backwards compat: if ~/.openclaw/kbclaw/ exists it will be used automatically.
  • How It Works

    1. Extract β€” Pull text from documents (PDF, DOCX, HTML, code, images via OCR) 2. Chunk β€” Split into semantic units (paragraphs, functions, classes) 3. Embed β€” Generate vectors using a configurable local model (default: nomic-embed-text-v1.5, 768 dims) 4. Store β€” SQLite with FTS5 for keyword search; embedder info written to DB metadata 5. Search β€” Hybrid: 70% vector similarity + 30% BM25 keyword; embedder auto-detected from DB

    All processing happens locally. No API keys required.