chunking-embeddings
Chunking, embeddings, and RAG pipeline integration
Skill by xberg-io
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/xberg-io-chunking-embeddings
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data, ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/chunking-embeddings
What's inside
- Skill name
chunking-embeddings- Description
- Chunking, embeddings, and RAG pipeline integration
- License
- MIT
- Instructions
- 105 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- name: missing
Files (2)
- SKILL.md
- index.md
SKILL.md (first lines)
# Chunking & Embeddings
**Text splitting, ONNX/static embedding generation, RAG pipeline integration**
Locations: `crates/xberg/src/chunking/` and `crates/xberg/src/embeddings/` (both directories,
not single files).
## Chunking
`ExtractionConfig.chunking: Option<ChunkingConfig>` drives it. The standalone entry points are
`chunking::chunk_text(text, &ChunkingConfig, page_boundaries) -> Result<ChunkingResult>`
(`chunking/core.rs`) and `chunking::rag::chunk_for_rag(text, &ChunkingConfig)`
(`chunking/rag.rs`), which upgrades `ChunkerType::Text` to `Markdown` and fills each chunk's
`heading_path`.
`ChunkingResult { chunks: Vec<Chunk>, chunk_count: usize }`. `Chunk` carries `content`,
`chunk_type`, `metadata`, and the optional vectors `embedding`, `sparse_embedding`,
`late_interaction` (`types/extraction.rs`).
### `ChunkerType` — there is no strategy enum beyond this
`Text` (default), `Markdown`, `Yaml`, `Semantic` (`core/config/processing.rs`).
`Semantic` splits at embedding-based topic shifts when an `EmbeddingConfig` is present, and
falls back to a structural-boundary heuristic otherwise — `topic_threshold` has no effect on
the fallback path.
### `ChunkingConfig` fields and their serde wire names
| Field | Wire name (config file) | Default |
| --- | --- | --- |
| `max_characters` | `max_chars` (alias `max_characters`) | 1000 |
| `overlap` | `max_overlap` (alias `overlap`) | 200 |
| `trim` | `trim` | true |
| `chunker_type` | `chunker_type` | `Text` |
| `preset` | `preset` | none |
The renames are load-bearing: a config file that writes `max_characters` works only via the
alias, and a typo'd key is silently ignored (see `config-loading-precedence`).
### Presets set chunk size AND the embedding model
`ChunkingConfig.preset` resolves through `resolve_preset()`, which is
`#[cfg(feature = "embeddings")]`-gated — **without that feature it is a no-op and the preset
name does nothing**. A preset overrides `max_characters` and `overlap` and, if no embedding
config was given, selects the model.
| Preset | chunk_size | overlap | dims | backend |
| --- | --- | --- | --- | --- |
| `fast` | 512 | 50 | 384 | ONNX |
| `balanced` | 1024 | 100 | 768 | ONNX |
| `quality` | 2000 | 200 | 1024 | ONNX |
| `multilingual` | 1024 | 100 | 768 | ONNX |
| `gte-modernbert-base` | 1024 | 100 | 768 | ONNX |
| `lightweight` | 512 | 50 | 256 | static (model2vec) |
| `arctic-embed-m-v2.0` | 1024 | 100 | 768 | ONNX |
| `qwen3-embedding-0.6b` | 2000 | 200 | 1024 | ONNX |
Source of truth: `EMBEDDING_PRESETS` in `crates/xberg/src/embeddings/mod.rs`.
## Embeddings
There is no `TextEmbeddingManager`, no `embed_chunks()`, no `ChunkWithEmbedding`, no
`RagDocument`, and **no fastembed dependency** — do not write code against any of those.
Model selection is `EmbeddingModelType`, a tagged enum (`core/config/processing.rs`):
`Preset { name }` (recommended), `Custom { … }` (HuggingFace ONNX), `Llm { … }`,
`Plugin { … }`.
Two defaults disagree and both are live: `EmbeddingModelType::default()` is the
`gte-modernbert-base` preset (what bindings and `#[serde(default)]` get), while
`EmbeddingConfig::default()` names `balanced` via `default_balanced_embedding_model()`. Read
the constructor you are actually going through before assuming which model runs.
`EmbeddingConfig` defaults: `normalize = true`, `batch_size = 32`,
`max_embed_duration_secs = Some(60)`, `max_sequence_length = None` (falls back to 512, capped
at the model's own `model_max_length`).
### Feature gating
```toml
embeddings = ["onnx-runtime", "dep:ndarray", "chunking", "tokio-runtime", "embedding-presets"]
```
`ort-bundled` (the default ORT linkage) **downloads** ONNX Runtime at build time — no system
install, no `ORT_DYLIB_PATH`. That variable matters only under `ort-dynamic`.
`static-embeddings` is the pure-Rust model2vec path and the only dense embedder available on
`no-ort-target` (WASM/Android). `embedding-presets` carries preset metadata alone and is
WASM-safe.
## Critical Rules
1. **Chunk before embedding** — vectors are attached per chunk, not per document.
2. **A preset without the `embeddings` feature is inert** — `resolve_preset()` is compiled out.
3. **Write serde wire names in config files** — `max_chars`/`max_overlap`, not the Rust field names.
4. **Degrade, don't fail** — a build without ORT should skip embeddings, not error.
5. **Normalize for cosine similarity** — `EmbeddingConfig.normalize` defaults to true; leave it on.
## Related Skills
- **extraction-pipeline-patterns** — text extraction preceding chunking
- **config-loading-precedence** — how `ChunkingConfig` is resolved and why typos are silent
- **feature-flag-conventions** — `embeddings` vs `static-embeddings` vs `embedding-presets`From xberg-io/xberg, MIT.
More from xberg-io/xberg
- 0.769score
xberg-extracting-keywords
xberg-io
Use when extracting keywords (YAKE/RAKE) from documents — and, secondarily, when detecting document language or generating embeddings for RAG and search.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
xberg-extracting-tables
xberg-io
Use when extracting tabular data from PDFs, spreadsheets, or images.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
xberg
xberg-io
Extract text, tables, metadata, and images from 107 document formats (PDF, Office, images, HTML, email, archives, academic) using Xberg.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
xberg-chunking
xberg-io
Use when splitting extracted text into chunks for LLM context windows or RAG ingestion.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
alef-generated-bindings
xberg-io
Alef-managed generated bindings in packages/* and binding crates — the regeneration workflow (task alef:generate / alef:verify), the alef.toml section layout…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
crate-structure
xberg-io
The Xberg workspace layout — the version source of truth (root Cargo.toml [workspace.package] version), the 19 workspace members and 3 excluded crates, the…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
wasm-constraints
xberg-io
WASM build constraints for the crates/xberg-wasm crate — the wasm-target feature set, no-tokio sync-only internal APIs, the crate-private SyncExtractor trait…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
feature-flag-policy
xberg-io
Cargo feature flags for crates/xberg — ORT-incompatible targets (WASM, Android x86_64 emulator), type-only and tract inference companion features…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
mime-detection-routing
xberg-io
MIME type detection and extractor routing in core/mime.rs — the FORMATS registry that EXT_TO_MIME and SUPPORTED_MIME_TYPES are derived from, the path-based…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
xberg-batch-extraction
xberg-io
Use when extracting from many files at once with shared config, bounded parallelism, per-file overrides, and error recovery.
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
config-loading-precedence
xberg-io
How Xberg resolves configuration — CLI-mode and server/MCP-mode precedence orders, project config walk-up, user config fallback, field-level inline JSON merge…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
xberg-extracting-with-ocr
xberg-io
Use when extracting text from scanned PDFs, photographed pages, or images that have no embedded text layer.
SkillAFreshness: A★ 9.4KClaude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 9,441
- Forks
- 600
- Open issues
- 7
- Last commit (this folder)
- Oct 10, 2026 (17 days ago)
- Last release
- Oct 13, 2026 (14 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/xberg-io/xberg
- Website
- docs.xberg.io
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from xberg-io
- 0.769score
feature-flag-policy
xberg-io
Cargo feature flags for crates/xberg — ORT-incompatible targets (WASM, Android x86_64 emulator), type-only and tract inference companion features…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
crate-structure
xberg-io
The Xberg workspace layout — the version source of truth (root Cargo.toml [workspace.package] version), the 19 workspace members and 3 excluded crates, the…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
config-loading-precedence
xberg-io
How Xberg resolves configuration — CLI-mode and server/MCP-mode precedence orders, project config walk-up, user config fallback, field-level inline JSON merge…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
alef-generated-bindings
xberg-io
Alef-managed generated bindings in packages/* and binding crates — the regeneration workflow (task alef:generate / alef:verify), the alef.toml section layout…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
wasm-constraints
xberg-io
WASM build constraints for the crates/xberg-wasm crate — the wasm-target feature set, no-tokio sync-only internal APIs, the crate-private SyncExtractor trait…
SkillAFreshness: A★ 9.4KClaude Code +9 - 0.769score
mime-detection-routing
xberg-io
MIME type detection and extractor routing in core/mime.rs — the FORMATS registry that EXT_TO_MIME and SUPPORTED_MIME_TYPES are derived from, the path-based…
SkillAFreshness: A★ 9.4KClaude Code +9
Cite this page
chunking-embeddings skill. Agent Mart. https://agentmart.dev/skills/xberg-io-chunking-embeddings (last updated 2026-10-24)