Rag Data Curator logo

Rag Data Curator

Community
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.

Overview

Publisherleichu0612-byte
RepositoryRAG-Data-Curator-Agent-Skill
Skill namerag-data-curator
Stars
85
Forks
5
Bundled files
15
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 15 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by leichu0612-byte on GitHub. Read the source before you install it.

Installation

Install the Rag Data Curator AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/leichu0612-byte/RAG-Data-Curator-Agent-Skill/tree/main
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/leichu0612-byte/RAG-Data-Curator-Agent-Skill.git \
  .claude/skills/rag-data-curator
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Rag Data Curator in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Rag Data Curator on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Rag Data Curator is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Rag Data Curator AI skill do?

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.

Why use Rag Data Curator on TypingMind?

Because you install it once and use it with any model. Rag Data Curator is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Rag Data Curator in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/leichu0612-byte/RAG-Data-Curator-Agent-Skill/tree/main. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Rag Data Curator?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Rag Data Curator?

As many as you like. As long as a model supports skills, you can use Rag Data Curator with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Rag Data Curator AI skill free?

Yes. It is published on GitHub by leichu0612-byte under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇