Data Ingestion
What This Does
Processes large volumes of information — codebases, documentation sets, datasets, PDF collections, or API responses — and produces structured summaries. Handles content that would overwhelm a single prompt by using chunking, parallel processing, and progressive summarization.
Instructions
Assess the input. Determine:
- What type of content? (codebase, docs, dataset, PDFs, API output)
- How large? (file count, total size, estimated token count)
- What structure? (flat files, directory tree, database tables)
- What does the user need from it? (summary, architecture map, key patterns, data dictionary)
Plan the ingestion strategy. Based on size and type:
- Small (< 50K tokens): Direct read and summarize
- Medium (50K-200K tokens): Chunk by logical boundaries, summarize each, then synthesize
- Large (200K+ tokens): Hierarchical summarization — summarize leaves, then branches, then root
- Too large for Claude: Route to
gemini-fallback for 1M context window
Chunk intelligently. Split content at natural boundaries:
- Code: By file, by module, by class/function
- Documents: By section, by chapter, by heading
- Data: By table, by schema, by partition
- Never split mid-function, mid-paragraph, or mid-record
Process each chunk. For each chunk, extract:
- Code: Purpose, dependencies, public API, key patterns, complexity hotspots
- Documents: Key claims, definitions, relationships, action items
- Data: Schema, distributions, anomalies, relationships, quality issues
Synthesize across chunks. Combine chunk summaries into:
- High-level overview (what is this?)
- Structure map (how is it organized?)
- Key findings (what matters most?)
- Cross-references (how do parts relate?)
- Quality assessment (what's good, what's concerning?)
Deliver the summary. Format based on content type.
Output Format
For Codebases
# Codebase Summary: {name}
## Overview
{What this codebase does, tech stack, estimated size}
## Architecture
{High-level architecture: layers, modules, data flow}
## Directory Structure
{Key directories and their purposes}
## Key Components
| Component | Purpose | Dependencies | Complexity |
|-----------|---------|-------------|------------|
| {name} | {what it does} | {imports/uses} | {simple/moderate/complex} |
## Patterns and Conventions
- {Pattern 1: how X is done throughout the codebase}
- {Pattern 2}
## Quality Observations
- {Observation 1 — positive or concerning}
- {Observation 2}
## Entry Points
- {Where to start reading: main files, route definitions, etc.}
For Documents
# Document Summary: {title}
## Key Takeaways
1. {Takeaway 1}
2. {Takeaway 2}
## Section Summaries
### {Section 1}
{Summary}
## Definitions and Terms
| Term | Definition |
|------|-----------|
| {term} | {definition} |
## Action Items
- [ ] {Action identified in the document}
For Datasets
# Dataset Summary: {name}
## Schema
| Field | Type | Description | Completeness |
|-------|------|-------------|-------------|
| {field} | {type} | {desc} | {%} |
## Statistics
{Key distributions, counts, date ranges}
## Quality Issues
- {Issue 1: nulls, duplicates, anomalies}
## Relationships
{How tables/collections relate}
Tips
- Always start by assessing size before reading everything — prevents context overflow
- Use
wc -l, find | wc, or du -sh to estimate before diving in
- For codebases, read
package.json, README, and entry points first — they're the map
- Process the most important files first in case you run out of context
- If the content is too large, say so and recommend
gemini-fallback rather than producing a shallow summary
- Progressive summarization (summarize summaries) works better than trying to hold everything in context
1---2name: data-ingestion3description: Ingest, process, and summarize large documents, codebases, or datasets into structured, actionable summaries.4---56# Data Ingestion78## What This Does910Processes large volumes of information — codebases, documentation sets, datasets, PDF collections, or API responses — and produces structured summaries. Handles content that would overwhelm a single prompt by using chunking, parallel processing, and progressive summarization.1112## Instructions13141. **Assess the input.** Determine:15 - What type of content? (codebase, docs, dataset, PDFs, API output)16 - How large? (file count, total size, estimated token count)17 - What structure? (flat files, directory tree, database tables)18 - What does the user need from it? (summary, architecture map, key patterns, data dictionary)19202. **Plan the ingestion strategy.** Based on size and type:21 - **Small (< 50K tokens):** Direct read and summarize22 - **Medium (50K-200K tokens):** Chunk by logical boundaries, summarize each, then synthesize23 - **Large (200K+ tokens):** Hierarchical summarization — summarize leaves, then branches, then root24 - **Too large for Claude:** Route to `gemini-fallback` for 1M context window25263. **Chunk intelligently.** Split content at natural boundaries:27 - **Code:** By file, by module, by class/function28 - **Documents:** By section, by chapter, by heading29 - **Data:** By table, by schema, by partition30 - Never split mid-function, mid-paragraph, or mid-record31324. **Process each chunk.** For each chunk, extract:33 - **Code:** Purpose, dependencies, public API, key patterns, complexity hotspots34 - **Documents:** Key claims, definitions, relationships, action items35 - **Data:** Schema, distributions, anomalies, relationships, quality issues36375. **Synthesize across chunks.** Combine chunk summaries into:38 - High-level overview (what is this?)39 - Structure map (how is it organized?)40 - Key findings (what matters most?)41 - Cross-references (how do parts relate?)42 - Quality assessment (what's good, what's concerning?)43446. **Deliver the summary.** Format based on content type.4546## Output Format4748### For Codebases49```markdown50# Codebase Summary: {name}5152## Overview53{What this codebase does, tech stack, estimated size}5455## Architecture56{High-level architecture: layers, modules, data flow}5758## Directory Structure59{Key directories and their purposes}6061## Key Components62| Component | Purpose | Dependencies | Complexity |63|-----------|---------|-------------|------------|64| {name} | {what it does} | {imports/uses} | {simple/moderate/complex} |6566## Patterns and Conventions67- {Pattern 1: how X is done throughout the codebase}68- {Pattern 2}6970## Quality Observations71- {Observation 1 — positive or concerning}72- {Observation 2}7374## Entry Points75- {Where to start reading: main files, route definitions, etc.}76```7778### For Documents79```markdown80# Document Summary: {title}8182## Key Takeaways831. {Takeaway 1}842. {Takeaway 2}8586## Section Summaries87### {Section 1}88{Summary}8990## Definitions and Terms91| Term | Definition |92|------|-----------|93| {term} | {definition} |9495## Action Items96- [ ] {Action identified in the document}97```9899### For Datasets100```markdown101# Dataset Summary: {name}102103## Schema104| Field | Type | Description | Completeness |105|-------|------|-------------|-------------|106| {field} | {type} | {desc} | {%} |107108## Statistics109{Key distributions, counts, date ranges}110111## Quality Issues112- {Issue 1: nulls, duplicates, anomalies}113114## Relationships115{How tables/collections relate}116```117118## Tips119120- Always start by assessing size before reading everything — prevents context overflow121- Use `wc -l`, `find | wc`, or `du -sh` to estimate before diving in122- For codebases, read `package.json`, `README`, and entry points first — they're the map123- Process the most important files first in case you run out of context124- If the content is too large, say so and recommend `gemini-fallback` rather than producing a shallow summary125- Progressive summarization (summarize summaries) works better than trying to hold everything in context