agentleFS
patonkikhpatonkikh/APES/skills/rag/knowledge-ingestion-planner/skill.md

knowledge-ingestion-planner

Skill3 starsChanged 4 months agoMITView on GitHub

Design a knowledge ingestion pipeline for RAG: source connectors, parsing, chunking handoff, metadata enrichment, and incremental sync. Use when onboarding documents, building knowledge bases, or scaling RAG corpora.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Document fallback when parsing confidence is low (quarantine queue).

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Knowledge Ingestion Planner

Purpose

Design a knowledge ingestion pipeline: how documents enter the system, are parsed, enriched, chunked, and indexed with reliable incremental updates.

Input: Source types (PDF, wiki, API, DB), volume, update frequency, access control requirements
Output: Ingestion Pipeline Specification with connector map, parsing rules, metadata schema, and sync strategy
Examples: See examples.md for worked input/output.


Workflow

Step 1: Inventory sources

SourceFormatVolumeUpdate freqACL
ConfluenceHTML5k pagesDailyPer-space
S3 PDFsPDF200 filesWeeklyBucket policy
GitHub READMEMarkdown50 reposOn pushPublic

Identify authoritative vs supplemental sources; flag duplicates across sources.

Step 2: Design connector layer

PatternUse when
Batch pullScheduled full/incremental sync
Webhook pushReal-time wiki/git updates
CDC streamDatabase knowledge tables
Upload APIUser-generated documents

Each connector outputs normalized RawDocument with provenance:

source_id, uri, mime, fetched_at, acl_principal, raw_bytes

Step 3: Define parsing and extraction

FormatParser approachPitfalls
PDFLayout-aware OCR if scannedTables split wrong
HTML/wikiDOM + boilerplate removalNav/footer noise
OfficeStructured extractionHidden text layers
CodeAST or markdown-awareLicense headers

Document fallback when parsing confidence is low (quarantine queue).

Step 4: Metadata enrichment

Required metadata per chunk parent document:

FieldPurpose
doc_idStable ID across reindexes
titleDisplay and filtering
source_systemProvenance
updated_atFreshness ranking
aclRetrieval filter
languageRouting / embedding model
tagsFaceted search

Optional: auto-summary, entity extraction, section headings.

Step 5: Hand off to chunking and indexing

Define contract with chunking-strategy-advisor:

  • Send cleaned markdown + structure hints (headings, tables)
  • Chunk size/overlap per doc type
  • Parent-child chunk linking for citations

Indexing pipeline:

Parse → Enrich → Chunk → Embed → Upsert vector store → Verify count

Step 6: Incremental sync and deletion

EventAction
New documentFull ingest path
Updated documentRe-chunk changed sections or full replace
Deleted / ACL revokedHard delete vectors + tombstone log
Source driftReconciliation job weekly

Idempotency key: source_id + content_hash.

Step 7: Validate

Run Validation checklist.


Decision Rules

ConditionAction
ACL per documentPropagate to vector metadata; filter at query time
>1M documentsPartition by tenant/source; async queue
Scanned PDF majorityOCR pipeline + human QA sample
Duplicate content across sourcesCanonical URL + dedupe hash
Real-time requirement <5 minPush webhooks, not nightly batch
PII in corpusScan pre-index; block or redact

Validation

  • Source inventory with volume and update frequency
  • Connector pattern per source
  • Parsing rules per MIME type
  • Metadata schema with ACL fields
  • Chunking handoff documented
  • Incremental sync and delete behavior defined
  • Idempotency and reconciliation plan
  • Ingestion SLA and error quarantine queue

Anti-patterns

  • Reindex everything nightly — wasteful at scale; misses true incremental.
  • Ignore ACL at ingest — retrieval leaks across tenants.
  • Chunk before clean — boilerplate pollutes every chunk.
  • No deletion path — stale content forever in answers.
  • Single parser for all PDFs — table-heavy docs need layout models.

Best Practices

  • Store raw originals in object storage; derived chunks reproducible.
  • Log ingest lineage: chunk → doc → source fetch timestamp.
  • Sample 1% of ingested docs for human QA each week.
  • Pair with embedding-strategy-advisor for model/version pinning.
  • Monitor ingest lag and embedding failure rate.

Output Structure

# Ingestion Pipeline: [Knowledge Base Name]

## Sources
| Source | Connector | Schedule | ACL |
|--------|-----------|----------|-----|

## Architecture
[Diagram: sources → queue → parse → enrich → chunk → index]

## Parsing Rules
| MIME | Parser | Fallback |
|------|--------|----------|

## Metadata Schema
[Field definitions]

## Sync Strategy
[Incremental rules]

## SLAs & Monitoring
| Metric | Target |
|--------|--------|

## Error Handling
[Quarantine, retry]

Next Skills

OutcomeRecommended Skill
Chunking parametersrag/chunking-strategy-advisor
Embedding model choicerag/embedding-strategy-advisor
End-to-end RAG designrag/rag-architecture-designer
Retrieval tuningrag/retriever-optimizer
Hybrid search setuprag/hybrid-search-advisor

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.