Clean blocks
PII redaction
Automatically detects and replaces:- Emails →
[email] - Phone numbers →
[phone](US, EU, JP, KR formats) - Credit card numbers →
[cc] - National IDs (SSN, KRRN, MyKad) →
[id] - Names — optional, off by default. Uses NER + a small on-device model.
- Custom regex — add your own patterns.
Boilerplate stripping
Removes common noise:- Email headers and signatures.
- HTML tags and styling.
- Table of contents, page numbers, headers/footers.
- Legal footers and disclaimers.
- Cookie notices and nav menus (web content).
Language filter
Drops items in unwanted languages. Set an allowlist (e.g.,en, ko, ja). Everything else is filtered out and logged.
Content filter
Drops items whose content matches a denylist — patterns, keywords, or a small classifier you supply. Useful for keeping test data or internal-only content out of a public-facing agent’s knowledge.Near-duplicate detector
Removes items that are >95% similar to something already ingested. Uses MinHash sketches — fast and doesn’t require re-embedding. Tunable threshold. Set higher (>99%) to only catch exact-ish copies; lower (~85%) to be aggressive.Custom transform (inline)
Run a small JS/Python function on each item. Full access tocontent, metadata, and helper libs (re, bs4, markdown-it). Return the transformed item, or return null to drop it.
Order matters
Blocks in Clean run in the order you wire them. Common recipe:- Language filter (drop early — cheap).
- Boilerplate stripping (clean up structure).
- PII redaction (act on clean text).
- Near-duplicate detector (dedup after everything else has normalized noise).