Logo Rag Data Curator

Rag Data Curator

Cộng đồng
leichu0612-byte
rag-data-curator

Inspect, normalize, structurally chunk, enrich, and validate Markdown or text corpora before embedding or vector-store ingestion. Use when preparing RAG datasets, diagnosing chunk quality, or producing traceable chunk JSON and a quality report; do not use it to invent missing source metadata or claim retrieval gains without an evaluation.

Tổng quan

Nhà phát hànhleichu0612-byte
Kho mãRAG-Data-Curator-Agent-Skill
Tên kỹ năngrag-data-curator
Sao
85
Bản fork
5
Tệp đi kèm
15
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 15 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được leichu0612-byte công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Rag Data Curator trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/leichu0612-byte/RAG-Data-Curator-Agent-Skill/tree/main
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/leichu0612-byte/RAG-Data-Curator-Agent-Skill.git \
  .claude/skills/rag-data-curator
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Rag Data Curator trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Rag Data Curator ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Rag Data Curator với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

RAG Data Curator

Purpose

Turn raw Markdown or plain-text documents into reviewable chunks that are ready for embedding and vector-store ingestion. Treat curation as a data-quality workflow: inspect before transforming, preserve semantic structure, record provenance, and report measured results separately from recommended settings.

Tools determine what an agent can do; this skill defines how the agent should do document curation consistently.

When to use

Use this skill to:

  • prepare .md, .markdown, or .txt corpora for a RAG pipeline;
  • replace blind fixed-window splitting with structure-aware chunking;
  • generate chunk-level provenance and quality evidence;
  • inspect an existing chunk dataset for fragmentation, duplication, or metadata gaps.

Do not treat this workflow as a retrieval benchmark. Chunk quality signals cannot establish answer quality without downstream evaluation.

Goals

  • Preserve headings, paragraphs, sentences, fenced code, and useful blockquotes where possible.
  • Keep each accepted chunk within the configured token maximum.
  • Carry only metadata declared by the source or derived through documented deterministic rules.
  • Produce stable identifiers, normalized text hashes, and a measured quality report.
  • Leave a clear audit trail from each chunk to its source document and section.

Workflow

Follow these stages in order:

  1. Inspect. Count headings, paragraphs, sentences, fenced code blocks, blockquotes, exact repeated blocks, known boilerplate, and malformed code fences. Decide whether code and quotes have retrieval value before dropping them.
  2. Normalize. Normalize line endings and prose whitespace. Remove only conservative boilerplate and exact repeated substantive blocks. Preserve headings and paragraph boundaries. Keep code and blockquotes by default.
  3. Chunk. Split at section, heading, paragraph, and sentence boundaries in that order. Use the token limit only as a fallback for a single oversized semantic unit.
  4. Add overlap. For adjacent chunks in the same section, copy up to the last two complete sentences from the previous chunk. Aim for the configured overlap target and skip overlap if no full sentence fits.
  5. Enrich metadata. Record provenance, title, section, index, token count, tags, and keywords. Add optional domain fields only when they appear in source frontmatter.
  6. Validate. Check empty, short, oversized, duplicated, fallback-split, heading-only, metadata-deficient, and excessive-overlap chunks. Reject empty, oversized, and exact duplicate chunks; report nonfatal findings.
  7. Deliver. Write chunk JSON plus a Markdown quality report, and state the tokenizer and run configuration used for every measured size.

Before changing the rules for a corpus, read references/chunking-strategy.md. Before mapping source fields, read references/metadata-schema.md. Use references/quality-checklist.md when reviewing the output or designing a downstream gate.

Chunking rules

Start with these recommended defaults:

  • target chunk size: 400 tokens;
  • maximum chunk size: 600 tokens;
  • minimum chunk size: 80 tokens;
  • overlap target: 60 tokens.

These values are tunable starting points, not industry standards. Prefer ending near the target at a complete semantic boundary. Never exceed the maximum; if a single sentence or code block exceeds it, use a tokenizer-based fallback split and report that fallback. Merge an undersized prose fragment with a neighbor in the same section when the combined chunk remains within the maximum. A naturally complete short section may remain independent.

Metadata rules

Every chunk must include:

  • source, filename, document_title, and section_title;
  • chunk_index and measured token_count;
  • tags and keywords, which may be empty arrays when the source provides no reliable values.

The bundled implementation derives document_title from declared title, then the first H1, then the filename. It derives section_title from the nearest heading, and uses declared tags/keywords plus document and section titles. It copies author, category, and dynasty only when those fields exist in frontmatter. Do not infer identities, dates, categories, or domain attributes from unstated assumptions.

Quality checks

Apply the acceptance rules and interpretations in references/quality-checklist.md. A clean report means the configured structural checks passed; it does not prove good retrieval, ranking, or generation performance.

Output format

Emit one JSON object per accepted chunk with this shape:

json
{
  "chunk_id": "stable-content-derived-id",
  "content": "chunk text",
  "metadata": {
    "source": "relative/path.md",
    "filename": "path.md",
    "document_title": "Document title",
    "section_title": "Section title",
    "chunk_index": 0,
    "token_count": 386,
    "overlap_token_count": 0,
    "tags": [],
    "keywords": []
  },
  "token_count": 386,
  "normalized_text_hash": "sha256:..."
}

The quality report must include document count, accepted chunk count, measured average/minimum/maximum size, duplicate count and rate, rejected count, metadata completeness, inspection counts, configuration, and individual findings.

Run the bundled implementation

Install and curate a corpus:

bash
python -m pip install -e .
python scripts/curate.py docs/ \
  --output build/chunks.json \
  --report build/quality-report.md \
  --source-root docs/

Review both outputs before embedding. Adjust parameters only with a corpus-specific reason, then record the configuration and compare downstream retrieval behavior.

Failure and fallback behavior

  • If no supported documents are found, stop and report the paths checked.
  • If the configured tokenizer is unavailable, stop and install/configure it; do not silently substitute character counts.
  • If a semantic unit exceeds the maximum, apply the measured token fallback, flag broken_sentence_fallback, and keep the source traceable.
  • If source metadata is absent or ambiguous, leave optional values absent and required list fields empty.
  • If parsing reveals an unclosed code fence or widespread noise, include it in inspection results and request human review before ingestion.
  • If clean chunking is impossible without losing important structure, preserve the source and report the limitation rather than hiding it.

Important constraints

  • Analyze structure before splitting.
  • Prefer semantic boundaries; use token limits as a safety bound.
  • Never fabricate metadata, benchmarks, user counts, performance gains, or downstream retrieval claims.
  • Distinguish configured recommendations from measurements observed in the current run.
  • Preserve source text fidelity except for declared normalization and overlap.
  • Treat successful preprocessing and successful RAG retrieval as separate claims requiring separate evidence.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Rag Data Curator làm được gì?

Inspect, normalize, structurally chunk, enrich, and validate Markdown or text corpora before embedding or vector-store ingestion. Use when preparing RAG datasets, diagnosing chunk quality, or producing traceable chunk JSON and a quality report; do not use it to invent missing source metadata or claim retrieval gains without an evaluation.

Vì sao nên dùng Rag Data Curator trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Rag Data Curator là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Rag Data Curator trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/leichu0612-byte/RAG-Data-Curator-Agent-Skill/tree/main. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Rag Data Curator?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Rag Data Curator với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Rag Data Curator với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Rag Data Curator có miễn phí không?

Có. Kỹ năng này được leichu0612-byte phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇