Skip to content
Back to skills

Doc Ingestion

ASecurity

Get the user's documents INTO the bot cleanly — accept common formats (txt/md/pdf/docx/html), extract readable text, chunk it well for retrieval, and report back what was actually indexed. Use when the user wants to add their docs, when an upload fails or indexes badly, or when answers are missing content you'd expect (usually an ingestion problem, not a retrieval one).

  • 6 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 5, 2026
ai-agentsrustgo

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add Podbay-Cloud/podbay --skill doc-ingestion --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Doc Ingestion?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Doc Ingestion
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/podbay-cloud-doc-ingestion/badge)](https://www.skillsdirectory.com/skills/podbay-cloud-doc-ingestion)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: doc-ingestion
description: >-
  Get the user's documents INTO the bot cleanly — accept common formats
  (txt/md/pdf/docx/html), extract readable text, chunk it well for retrieval, and
  report back what was actually indexed. Use when the user wants to add their docs,
  when an upload fails or indexes badly, or when answers are missing content you'd
  expect (usually an ingestion problem, not a retrieval one).
---

# Document ingestion

Retrieval can only find what got indexed. Bad ingestion (garbled PDF text, a whole
doc as one chunk, silent format failures) looks like a "dumb bot" but is really a
pipeline problem. Get the text in clean, chunked, and confirmed.

## Formats

- **txt / md** — use as-is (markdown structure helps chunk boundaries).
- **pdf** — extract text server-side (e.g. `pdf-parse`); watch for scanned/image PDFs
  (no text layer → needs OCR, out of v1 scope — tell the user).
- **docx** — extract with `mammoth` or similar → text/markdown.
- **html / web page** — strip to readable text (drop nav/scripts).
- Reject or warn on formats you can't extract; never silently index empty text.

## Chunking (this is where quality is won or lost)

- Split into **~1000–1500 char chunks on natural boundaries** (paragraphs/headings),
  with a small **overlap (~10–15%)** so an answer straddling a boundary is still
  retrievable. (`rag.ts` `chunk` does this — reuse it.)
- Keep chunks self-contained: prepend the doc title / nearest heading so a lone chunk
  still has context.
- Very long docs: chunk fully; don't truncate. Very short docs: still one+ chunk.

## Report back (always)

After ingesting, tell the user **what actually got indexed**: doc name, chunk count,
and flag anything skipped (unreadable pages, unsupported format). "Indexed 3 docs,
142 chunks; skipped 2 image-only PDF pages" — so they trust the corpus.

## Demo docs

A small demo set ships so the bot works on first boot. When the user brings their own,
**offer to clear the demo** (via the docs list / DELETE) so answers come only from
their content — a bot citing demo docs in production is confusing.

## Never

- Never index empty or garbled text and call it done — verify extraction first.
- Never dump a whole document as a single chunk (kills retrieval precision).
- Never leave the demo docs mixed with the user's real docs in production.

Files in this skill

  • SKILL.md2.3 KB
  • SOURCE.md268 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.