ToolUp.RAG.StaticCorpus.Build
0.23.0
Prefix Reserved
dotnet tool install --global ToolUp.RAG.StaticCorpus.Build --version 0.23.0
dotnet new tool-manifest
dotnet tool install --local ToolUp.RAG.StaticCorpus.Build --version 0.23.0
#tool dotnet:?package=ToolUp.RAG.StaticCorpus.Build&version=0.23.0
nuke :add-package ToolUp.RAG.StaticCorpus.Build --version 0.23.0
ToolUp.RAG.StaticCorpus.Build
Build-time tooling for static-corpus retrieval: the Markdown chunker and the
packer CLI that precompute an embedding index (.scidx) over a documentation
corpus.
Chunker— parses Markdown with Markdig and splits it into retrievable chunks on H2/H3 heading boundaries. EachRawChunkcarries its full ancestorHeadingPath(so a retrieved chunk keeps its section context), the raw section body, and ananchorslug forsource#anchorjump-links. A section body over the character budget is split on block boundaries — fenced code blocks and paragraphs are never split mid-way. Chunk identity is by value:{source}:{heading-anchor}:{ordinal}. Pure function, no I/O.toolup-rag pack-docsCLI (Packer+Program) — walks a configured include set (staticcorpus.json), chunks each document, embeds each chunk once via the configured provider (hashingoffline default, oropenai), caches embedding responses on disk against(model, text)hashes, and writes the deterministic.scidxindex consumed at runtime byToolUp.RAG.StaticCorpus.Server. Exit codes:0clean,1config invalid,2embedding-provider error,3output write failure.
staticcorpus.json
{
"include": ["docs/**/*.md"],
"exclude": ["**/drafts/**"],
"embeddingProvider": "hashing",
"dimensions": 512,
"maxChunkChars": 1500,
"output": "out/docs.scidx"
}
Run dotnet toolup-rag pack-docs --config staticcorpus.json, or wire the packer
into a project build with the shipped ToolUp.RAG.StaticCorpus.Build.targets:
<ItemGroup>
<ToolUpRagStaticCorpus Include="docs/**/*.md"
Config="staticcorpus.json"
Output="$(IntermediateOutputPath)docs.scidx" />
</ItemGroup>
The pack is incremental: it content-hashes the inputs (config + docs + packer
version) and writes a <output>.inputs sidecar, so an unchanged re-pack is a
no-op even on a fresh checkout where timestamps are unreliable. Setting
SOURCE_DATE_EPOCH fixes the corpus BuiltUtc for reproducible builds (it
defaults to the Unix epoch, so the .scidx is byte-reproducible by default).
Licensed under Apache-2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.