Skip to main content

Generate filesystem-based agentskills.io skill around a haiku-rag RAG database

Project description

ragpicker

Generate a self-contained, filesystem-based agentskills.io skill that wraps a haiku-rag-built LanceDB RAG database.

Unlike haiku-rag create-skill (which emits a haiku-skills entrypoint package consumed by haiku-rag's own pydantic-ai agent), the skill produced here is driven by an external agent (e.g. Claude Code) that invokes a script. The generated skill provides a PEP 723 wrapper, scripts/haiku_rag.py, exposing search and cite subcommands implemented over the haiku-rag Python client — there is no haiku-rag cite CLI subcommand to shell out to.

Generate a skill

uv run ragpicker \
    --config path/to/haiku.rag.yaml \
    --db path/to/handbook.lancedb \
    --output ./skills \
    [--haiku-rag-version 0.48.1 | --version-from-project path/to/stack]
  • The skill is named from the database directory stem: handbook.lancedbhandbook-haiku-rag.
  • The template under src/ragpicker/template/[dbname]-haiku-rag/ (bundled as package data) is copied with [dbname] substituted by the stem (in path names and text-file contents).
  • Both the .lancedb database and the haiku.rag.yaml config are embedded under the skill's assets/.

Version pinning

The wrapper pins an exact haiku-rag-slim version so the embedded database and the runtime always agree. (Only haiku-rag-slim is supported — the full haiku-rag build's dependency weight is prohibitive for a self-contained skill.)

  • Default — sniff: the version is read from the database itself (the version that last wrote it, stored in its settings table) and pinned as-is. No migration is needed because the database already matches.
  • Minimum version: the wrapper's search/cite rely on APIs whose surface is not guaranteed below 0.48.1, so generation refuses to pin anything older. A database below that floor must be force-migrated up (see below).
  • --haiku-rag-version X — force: X is pinned in the wrapper and the embedded copy of the database is migrated up to X (via uv tool run --from haiku-rag-slim==X haiku-rag migrate). The original database is left untouched. Downgrades are rejected (haiku-rag migrations only move forward).
  • --version-from-project PATH — discover + force: read the effective haiku-rag-slim version from a target project (e.g. a Soliplex stack) and force it the same way. Looks first in the project's .venv (the installed version), then falls back to resolving the project's dependencies with uv tree --package haiku-rag-slim --depth 0. Either path finds haiku-rag-slim even though it is a transitive dependency of soliplex (not named directly in pyproject.toml). Mutually exclusive with --haiku-rag-version.

Forcing requires uv on PATH and network access to fetch the requested version; most migrations are schema-only, but some may need model access.

Using a generated skill

cd handbook-haiku-rag
uv run scripts/haiku_rag.py search "<query>" [--limit N] [--filter "<SQL>"]
uv run scripts/haiku_rag.py cite <chunk_id> [<chunk_id> ...]

uv resolves the wrapper's pinned haiku-rag dependency on first use. The wrapper opens the bundled database read-only, so the embedded database and the pinned version always agree by construction (the generator either sniffs or migrates to match).

Embedding hosts (e.g. Soliplex)

There are two execution models, with different requirements:

  • Standalone (uv run) — the model above. uv honors the wrapper's PEP 723 pin, so the runtime always matches the embedded database.
  • Embedding host (sys.executable) — a host such as Soliplex runs the skill script with its own Python interpreter, not uv (e.g. haiku.skills uses SCRIPT_RUNNERS[".py"] = (sys.executable,)). The wrapper's pin is then ignored: the host's installed haiku-rag opens the database. The embedded database must match that version, not the wrapper's pin.

So when targeting such a host, generate with --haiku-rag-version <the backend's haiku-rag version> so the embedded database is migrated to match the interpreter that will open it. On a version mismatch the wrapper now exits non-zero with an actionable haiku-rag version mismatch message (instead of failing silently and returning nothing to the agent).

Develop

uv run --with pytest --with pylance --with packaging pytest tests/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragpicker-0.1.tar.gz (187.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragpicker-0.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file ragpicker-0.1.tar.gz.

File metadata

  • Download URL: ragpicker-0.1.tar.gz
  • Upload date:
  • Size: 187.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for ragpicker-0.1.tar.gz
Algorithm Hash digest
SHA256 39b9f8ee5f77b731436e07459d02bd0e917b27e9d2911e79ea13c5a431757a6d
MD5 5f8fba0597a22a1472418841e63da10d
BLAKE2b-256 19516e4c879542fd448f9e52775b59394dbb308f9257f56bd0bd232f14b4891e

See more details on using hashes here.

File details

Details for the file ragpicker-0.1-py3-none-any.whl.

File metadata

  • Download URL: ragpicker-0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for ragpicker-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d34d411ec99765e6166ee48dbf58107cca95572ce1c627bf494f4d9ed25a5e7
MD5 c33a27159f32effa5ff8eba6383751cf
BLAKE2b-256 1517072b7ad50560bc7b12cc34b61137ce8a270bca3a286f2aa9580bc5420dac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page