agentleFS
shaowen310shaowen310/skills/kb-ingest/SKILL.md

kb-ingest

Skill1 starsChanged 4 months agoMITView on GitHub

Thin orchestrator that turns PowerPoint `.pptx` slides into knowledge-base-ready, slide-level JSONL chunks for RAG / agent pipelines. Delegates extraction to the pptx2md skill, then parses the Markdown per the deterministic output contract (slide anchors, field extraction, image/encoding rules) into one record per slide with title, body, images, and metadata. Triggers on: "把PPT做成知识库", "PPT转知识库给AI用", "ingest PPTX into KB", "build RAG dataset from slides", "把幻灯片切片入库". Best for building agent/RAG knowledge bases, search indexes, or training corpora from slide decks. Do NOT use for translating PPTX (use the pptx-translate skill) or for plain markdown export without chunking (use the pptx2md skill).

  • Installs packages

6 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use kb-query.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • tjkuhnsSkill

    kb-query

    Natural-language query against the KB with graph expansion. Returns findings ranked by semantic similarity, decay weighting, and graph-expansion scoring. Use when the user asks what the KB contains about a topic, wants to explore connections, or needs context for a content generation run.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not use for: translating the deck (use pptx-translate), or plain markdown export without chunking (use pptx2md directly).

    line 29
  2. Very specific:

    Embed + index: read each line, embed title + "\n" + content (optionally append image OCR/caption), upsert into a vector store.

    line 81

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

kb-ingest

A thin orchestrator that converts PowerPoint decks into a deterministic, slide-level JSONL dataset ready for any knowledge-base / RAG / agent pipeline. It does not re-implement extraction — it delegates to the pptx2md skill for the faithful pptx → md transform, then applies the chunking contract from pptx2md/references/styling.md.

.pptx ──(pptx2md)──▶ out.md + assets/ ──(build_kb.py)──▶ kb.jsonl
                                                  (one record per slide)

When to use

  • The user wants to ingest slide decks into a knowledge base / RAG system / search index / agent memory — not just a human-readable markdown file.
  • The user says things like "把PPT做成知识库", "把幻灯片切片入库", "build a RAG dataset from these slides", "PPT转知识库给AI用".
  • You already have a pptx2md-produced .md and want to chunk it for ingestion (skips the conversion step).

Do not use for: translating the deck (use pptx-translate), or plain markdown export without chunking (use pptx2md directly).

Workflow

Step 1 — Convert (only if starting from .pptx)

build_kb.py calls pptx2md automatically. If you already have the .md, pass it directly and Step 1 is skipped.

Step 2 — Chunk into JSONL

# End-to-end from a pptx (conversion + chunking):
python "<skill_dir>/scripts/build_kb.py" input.pptx --out kb.jsonl

# From an existing markdown (skip conversion):
python "<skill_dir>/scripts/build_kb.py" input.md --out kb.jsonl

# Resolve relative assets/ paths to absolute URLs for an HTTP-served KB:
python "<skill_dir>/scripts/build_kb.py" input.md \
    --base-url https://kb.example.com/assets/ --out kb.jsonl

Note: pptx2md is resolved automatically as a sibling skill (../pptx2md/scripts/pptx2md.py). If it lives elsewhere, pass --pptx2md-dir /path/to/pptx2md.

Output schema

kb.jsonl has one JSON object per line, one per slide:

FieldTypeSource
source_filestringoriginal .pptx stem (the # title)
slide_nointN from <!-- Slide N -->
titlestringfirst ## heading (or "" if none)
contentstringbody text; anchors/titles stripped
imagesstring[]relative paths under assets/ (or absolute URLs w/ --base-url)
has_diagrambooltrue if a rendered diagram image (slide-XX.png) is present
langstringfixed zh by default (--lang to override)

Example line:

{"source_file":"季度汇报","slide_no":3,"title":"项目进展","content":"Q1 完成 80%…","images":["assets/page-03-img-01.png"],"has_diagram":false,"lang":"zh"}

Downstream ingestion

kb.jsonl is backend-agnostic. Typical next steps (outside this skill):

  • Embed + index: read each line, embed title + "\n" + content (optionally append image OCR/caption), upsert into a vector store.
  • Keep assets: copy the assets/ directory alongside kb.jsonl so the relative image paths resolve, or serve it and pass --base-url.
  • Graph/diagram: index rendered diagram images (slide-XX.png) separately for diagram search.

Dependencies

pip install python-pptx   # only needed when converting a .pptx

Bundled resources

  • scripts/build_kb.py — the orchestrator: delegates to pptx2md, parses markdown per styling.md, emits deterministic kb.jsonl.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.