AGENT SKILL

leann

Use LEANN to build, search, update, chat over, serve, integrate, debug, and maintain compact local vector indexes and RAG applications across Python APIs, CLI workflows, backends, data sources, MCP, and HTTP.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
leann
license
MIT
metadata
{ "disco-role": "operating" }
description
Use LEANN to build, search, update, chat over, serve, integrate, debug, and maintain compact local vector indexes and RAG applications across Python APIs, CLI workflows, backends, data sources, MCP, and HTTP.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

LEANN

Use this skill when a task names LEANN, LeannBuilder, LeannSearcher, LeannChat, leann/leann_mcp, a LEANN index artifact, a LEANN backend, or a LEANN RAG application.

Route by task

  • Python index lifecycle and retrieval: use API and indexing for builders, searchers, precomputed vectors, updates, metadata filters, hybrid BM25/vector search, grep, result handling, and cleanup.
  • CLI and local operations: use CLI operations for build/search/ask, rebuild, watch, ID migration, warmup, daemons, source indexers, list/remove, command planning, and project registry behavior.
  • Backend and artifact decisions: use backends and storage for HNSW, IVF, DiskANN, FlashLib, compact/recompute storage, update tradeoffs, tuning, native builds, and index integrity.
  • Embeddings, chat, and ReAct: use embeddings and chat for embedding modes, model/device/cache choices, LLM providers, LeannChat, prompts, ReAct, web tools, credentials, and daemon model mismatches.
  • RAG application composition: use RAG applications for documents, code, browser/email/chat exports, Slack/Twitter readers, semantic file search, images, visual PDFs, chunking, metadata, and private-data preflight.
  • MCP and HTTP services: use MCP and services for MCP JSON-RPC, Claude/OpenClaw configuration, tool schemas, service process behavior, and the read-only HTTP search API.
  • Repository development: use development and testing when editing the LEANN monorepo, selecting focused tests, building native packages, checking versions, maintaining docs, or planning a guarded release.

Fast start

  1. Read installation and choose package-user or checkout-development setup. Do not install every optional backend merely because the host has an accelerator.

  2. Run the bundled non-networking probe:

    python scripts/check_leann_install.py --check-cli
    

    Add --require-backend hnsw or another selected backend when that backend is part of the task.

  3. Choose the owning sub-skill above. Keep build-time and query-time embedding model, mode, dimensions, normalization, and task templates consistent.

  4. Treat an index name as an artifact family, not one file. Back up the complete family before migration, risky rebuild work, or irreplaceable removal.

  5. Start with tiny public fixtures. Model downloads, API calls, private data, live services, CUDA packages, and publication commands require separate preflight and authorization.

Shared references

  • Installation covers distributions, Python and backend choices, source builds, and a minimal import check.
  • Cross-cutting troubleshooting routes install, import, model, index, daemon, credential, and service failures.
  • Repository provenance records the source revision, component versions, and evidence baseline. Read it before deciding whether this skill is stale or should be refreshed.

Guardrails

  • Do not assume optional backends or provider packages are installed because import leann succeeds; require the selected registry entry and a matching smoke check.
  • Do not hand-edit pickle offset maps, backend ID maps, or native index files.
  • Do not place API keys in commands, logs, generated MCP JSON, or committed index metadata.
  • Do not expose private passage text, source paths, or unauthenticated HTTP service endpoints to an untrusted client or non-loopback network.
  • Do not use release/upload helpers or destructive rebuild/removal commands as diagnostics.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351