Skip to main content

/ingest - Material Ingestion

Ingests external materials into the Mega Brain inbox, extracting metadata and preparing content for pipeline processing.

Syntax

string
required
YouTube URL, local file path, or Google Drive link

Supported Sources

YouTube

Videos with automatic transcription

Local Files

.txt, .pdf, .docx documents

Google Drive

Docs, PDFs, Sheets

Flags

string
Manually specify the expert/person name (overrides automatic detection)Example: --person "Cole Gordon"
string
Content type: PODCAST, MASTERCLASS, COURSE, BLUEPRINT, VSL, etc.Example: --type MASTERCLASS
boolean
Automatically start pipeline processing after ingestionExample: --process

Examples

How It Works

Step 1: Source Type Detection

The command identifies the source type:

Step 2: Metadata Extraction

Automatic metadata detection:
If --person flag provided, uses that instead.

Step 3: Destination Path

Files are saved to structured inbox:
Filename Format:
  • YouTube: {VIDEO_TITLE} [youtube.com_watch_v={ID}].txt
  • Local: {ORIGINAL_NAME}.txt
  • Google Drive: {DOC_TITLE}.txt

Step 4: Generate Source ID

Each file gets a unique identifier:

Step 5: Ingest Report

Display confirmation:

Step 6: Auto-Process (if —process flag)

If --process flag is present, automatically triggers:

Audit Logging

All ingestions are logged to /logs/AUDIT/audit.jsonl:

YouTube Transcription

Requirements

OPENAI_API_KEY required for YouTube transcription via Whisper
YouTube videos are transcribed using OpenAI Whisper:
  1. Download audio using yt-dlp
  2. Convert to MP3
  3. Send to Whisper API
  4. Save transcript with timestamps

Transcript Format

Supported Languages

Whisper auto-detects language. Supports 50+ languages including:
  • English
  • Spanish
  • Portuguese
  • French
  • German
  • Chinese
  • Japanese
  • And more…

Google Drive Import

Setup Required

GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET required for Drive import
Configure during /setup or manually in .env:

OAuth Flow

First time accessing Drive:

Supported Document Types

  • Google Docs - Converted to plain text
  • Google Sheets - Converted to CSV then text
  • PDFs - Extracted with OCR if needed
  • Word Docs (.docx) - Converted to text

Error Handling

YouTube Video Not Available

Transcription Failed

File Already Exists

Unsupported File Type

Performance

Processing Times

YouTube transcription time depends on video length and Whisper API latency

Rate Limits

  • OpenAI Whisper: 50 requests/min (Tier 1)
  • YouTube API: 10,000 quota/day
  • Google Drive API: 1,000 requests/100s/user

Best Practices

1. Organize by Expert

Use --person flag for consistency:

2. Specify Content Type

Helps with later analysis:

3. Batch Processing

For multiple files, ingest first, then batch process:

4. Use Descriptive Filenames

Before ingesting local files:

Advanced Usage

Playlist Ingestion

Webhook Integration

Custom Metadata

Troubleshooting

”yt-dlp not found”

Issue: YouTube downloader not installed Solution:

“OpenAI API key invalid”

Issue: API key not configured or incorrect Solution:

“Permission denied writing to inbox/”

Issue: Insufficient file permissions Solution:

Next Steps

Process Command

Transform raw content into structured knowledge

JARVIS Briefing

Monitor your knowledge base growth

Pipeline Guide

Understand the 8-phase processing pipeline

Inbox Management

Best practices for organizing materials