Pipeline Overview
Core Constraint: Process 100% of content. No summarization, no omission. Every insight must trace back to source with full lineage.
Phase 1: Initialization + Validation
Purpose
Purpose
Validate input files, extract metadata from paths, load state files, and check for duplicate processing.
1
Validate Input
2
Extract Path Metadata
Parse file path to extract:
SOURCE_PERSON- Folder after inbox/SOURCE_COMPANY- Content in parenthesesSOURCE_TYPE- Material type (MASTERMINDS, COURSES, etc.)SOURCE_ID- Unique hash (e.g., “CG003”)SCOPE- course | company | personalCORPUS- Derived from SOURCE_COMPANY
3
Load State Files
Load or create:
CHUNKS-STATE.jsonCANONICAL-MAP.jsonINSIGHTS-STATE.jsonNARRATIVES-STATE.json
4
Check Already Processed
Search existing chunks for
SOURCE_ID. If found, ask user whether to reprocess.Phase 2: Chunking
Purpose
Purpose
Segment content into semantic chunks (~300 words) while preserving context, timestamps, and speaker labels.
core/templates/PIPELINE/PROMPT-1.1-CHUNKING.md
Chunking Rules
- Chunk size: ~300 words (~1000 tokens)
- Preserve: Timestamps, speaker labels, formatting
- Extract: People (raw mentions), themes (raw topics)
- Generate: Sequential
chunk_idlikechunk_CG003_001
Process
1
Read Full Content
Load entire source file, count words
2
Execute Chunking
Apply semantic segmentation while maintaining context boundaries
3
Merge and Save
CHUNKS-STATE.json, deduplicate by chunk_idcount(new_chunks) > 0, each chunk has unique ID, state file saved
Phase 3: Entity Resolution
Purpose
Purpose
Normalize entity names (people, companies, themes) to canonical forms to prevent duplication.
core/templates/PIPELINE/PROMPT-1.2-ENTITY-RESOLUTION.md
Resolution Rules
- Threshold: 0.85 confidence for merging
- Prefer: Longest/most explicit form as canonical
- NEVER merge: Across different corpus
- Flag collisions: For human review
Examples
Output: Canonicalized chunks, updated
CANONICAL-MAP.json, review queue for ambiguous cases
Phase 4: Insight Extraction
Purpose
Purpose
Extract actionable insights from chunks, classify by priority, and detect contradictions.
core/templates/PIPELINE/PROMPT-2.1-INSIGHT-EXTRACTION.md
Insight Structure
Priority Levels
High
Immediately actionable, high-impact insights
Medium
Important context, strategic guidance
Low
Supporting details, background information
INSIGHTS-STATE.json
Phase 5: Narrative Synthesis
Purpose
Purpose
Synthesize insights into coherent narratives for each person and theme, tracking tensions and open questions.
core/templates/PIPELINE/PROMPT-3.1-NARRATIVE-SYNTHESIS.md
Narrative Structure
Merge Rules (CRITICAL)
- narrative: CONCATENATE with update separator
- insights_included[]: APPEND (never replace)
- tensions[]: APPEND new ones
- open_loops[]: APPEND new, mark RESOLVED when answered
- next_questions[]: REPLACE (only exception)
NARRATIVES-STATE.json with synthesized narratives
Phase 6: Dossier Compilation
Purpose
Purpose
Compile comprehensive dossiers for persons and themes with full source traceability.
core/templates/PIPELINE/DOSSIER-COMPILATION-PROTOCOL.md
Dossier Types
- Person Dossiers
- Theme Dossiers
knowledge/dossiers/persons/ and knowledge/dossiers/themes/
Phase 7: Agent Enrichment
Purpose
Purpose
Update agent knowledge and memory files with new insights, respecting agent boundaries.
Process
1
Compile Knowledge Payload
Extract frameworks, techniques, metrics, and high-priority insights discovered
2
Check Role Threshold
- >=10 mentions: Flag “Create New Agent”
- >=5 mentions: Flag “Monitor Role”
3
Present Options
4
Execute Updates
Update relevant agent files with new knowledge, maintaining agent voice and structure
5
Template Evolution Check
If new knowledge doesn’t fit existing template structure, trigger evolution protocol
Phase 8: Finalization
Purpose
Purpose
Execute automatic cleanup, generate execution report, and verify pipeline integrity.
Automatic Actions
1
RAG Index
python scripts/rag_index.py --knowledge --force2
File Registry
python scripts/file_registry.py --scan3
Session State
Update
SESSION-STATE.md with processed file4
Role Tracking
Update
agents/DISCOVERY/role-tracking.md5
Audit Log
Append to
logs/AUDIT/audit.jsonlFinal Verification (9 Items)
Execution Report
Pipeline Commands
Next Steps
DNA Schema
Learn about the 5-layer knowledge extraction
Architecture
Understand the system architecture
