rag-applications
Compose and validate LEANN RAG workflows for documents, code, personal or live data, semantic file search, images, and visual PDFs without exposing private data or triggering heavy setup.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- rag-applications
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Compose and validate LEANN RAG workflows for documents, code, personal or live data, semantic file search, images, and visual PDFs without exposing private data or triggering heavy setup.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/chunking-metadata-and-layout.md9.2 KB
- 参考文档references/document-and-code-rag.md6.0 KB
- 参考文档references/multimodal-rag.md7.0 KB
- 参考文档references/personal-and-live-data.md9.2 KB
- 参考文档references/troubleshooting.md10.3 KB
03 SKILL.md 正文
LEANN RAG Applications
Use this sub-skill to turn a source into LEANN passages, preserve useful metadata, build a searchable index, and choose retrieval or chat. Start with a small bounded sample and keep private, live, and multimodal sources opt-in.
Route by source
- For PDF/TXT/Markdown documents, code repositories, or mixed code and prose, use document and code RAG.
- For browser history, Apple Mail, Apple Calendar, iMessage, existing WeChat exports, Slack, or Twitter/X, use personal and live data.
- For CLIP image retrieval or ColQwen2/ColPali visual-PDF retrieval, use multimodal RAG.
- For chunk sizes, Abstract Syntax Tree (AST) fallback, file layout, ignore rules, metadata schemas, filters, or temporal search, use chunking, metadata, and layout.
- For parser, permission, export, Model Context Protocol (MCP), PDF, image, dependency, or empty-corpus failures, use troubleshooting.
- To produce a validated public
leanncommand without executing it, use the bundled command planner.
Operating sequence
- Classify the source as local public files, private local data, live MCP data, image data, or vision-PDF data. State platform, permissions, export format, dependency, model-cache, and compute prerequisites before access.
- Define a passage contract: non-empty
textplus a flatmetadatamapping. Select stable source identifiers and use one field name and type per concept. - Load a bounded sample. Exclude hidden, ignored, generated, oversized, empty, corrupt, or unsupported inputs before chunking.
- Chunk prose traditionally; use AST-aware chunking only for supported code. Keep the deterministic traditional fallback enabled.
- Validate counts and inspect representative passage text and metadata. Stop if zero passages, required source identity is missing, or chunk metadata no longer matches its text.
- Build, then search with a query whose expected source is known. Add metadata or time filters only after verifying those fields exist in stored passages.
- Add chat only after retrieval is sound. Provider, credential, and model selection belongs to the provider sub-skill.
Safety rules
- Never export private platform data, open private databases, start an MCP server, read credentials, install system packages, or download models merely to plan a workflow.
- Never print secrets or include them in generated commands. Pass credentials through the provider or server's documented environment only when the user separately authorizes execution.
- Treat Slack and Twitter/X readers, Spotlight collection, image encoders, and visual-PDF models as reference-only here. Preflight them; do not run them.
- Treat an existing WeChat export as input. Do not invoke an exporter or attempt to modify a running client.
- Do not force rebuilds or include hidden files by default. Preserve the source corpus and write indexes to a separate destination.
Boundaries
- Backend choice, graph/search parameters, compact storage, recomputation, and index updates: backends and storage.
- Embedding modes, model caches, API credentials, prompt templates, and LLM/chat providers: embeddings and chat.
- MCP protocol details, server installation, transport, and deployment: MCP and services.
- General Python builder/searcher lifecycle and custom precomputed-vector code: API and indexing.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.