Skip to main content

reels-wiki logo

reels-wiki

CI Release Please GitHub Pages GitHub Release PyPI Python License: MIT Homebrew

Local-first pipeline that converts saved Instagram Reels into atomic Markdown notes inside an existing 3-layer Obsidian LLM Wiki vault without duplicates.

Available interfaces: Python SDK (reels_wiki), CLI (reels-sync), MCP server (reels-wiki-mcp), Telegram capture bot (reels-wiki-telegram), local HTTP ingest (reels-sync serve for Shortcuts & browser extensions), and Agent Skill (SKILL.md).

Demo

Watch reels-wiki Demo on YouTube

Watch on YouTube

Local Sync Pipeline Offline Obsidian Vault
Local Sync Pipeline Offline Obsidian Vault

Table of Contents

Quick Start (Docker)

cp config.example.yaml config.yaml && cp .env.example .env
docker compose build
docker compose run --rm reels-process
docker compose up -d reels-telegram

Quick Start (Local)

Prerequisites: Python 3.10 or newer and ffmpeg on your PATH. ffmpeg is only required when audio or frame fallbacks run.

Step 1: Clone and install

git clone https://github.com/AtaCanYmc/reels-secretary.git
cd reels-secretary
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

To enable offline audio transcription with faster-whisper, include the local extra:

pip install -e ".[dev,local]"

Step 2: Configure your vault path and credentials

Run the interactive setup wizard to generate config.yaml and .env, then run diagnostics automatically:

reels-sync init

Or copy the example configuration manually and set vault_path to your Obsidian LLM Wiki root directory:

cp config.example.yaml config.yaml

reels-wiki searches for configuration files in this order:

  1. --config <path> CLI flag
  2. $REELS_WIKI_CONFIG environment variable
  3. ./config.yaml in the current working directory
  4. ~/.config/reels-wiki/config.yaml

You can override vault_path at runtime with --vault <path> or $REELS_WIKI_VAULT. Unknown keys in config.yaml are rejected on load to catch typos early.

Step 3: Add API keys in .env

Create a .env file in the project root with your provider credentials:

GROQ_API_KEY=your_groq_api_key
GEMINI_API_KEY=your_gemini_api_key

# Optional: only required for the Telegram capture bot
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_ALLOWED_CHAT_ID=123456789

Step 4: Set up Instagram authentication

Instagram blocks anonymous scraping. Choose one authentication method under the extraction: section in config.yaml:

  • cookies_from_browser: chrome: reads your active browser session via yt-dlp. Also supports firefox or profile syntax such as "chrome:Profile 1".
  • cookies_file: ~/cookies.txt: reads a Netscape-format cookie export file.

Keep delay_seconds at 2.0 or higher, process items in small batches, and keep yt-dlp updated with pip install -U yt-dlp.

Step 5: Verify the installation

Run the queue statistics command to verify configuration loading and vault access:

reels-sync stats

Usage

1. Enqueue a single URL

reels-sync ingest accepts Instagram Reels/posts (/share/... supported), YouTube Shorts, and TikTok video URLs:

reels-sync ingest "https://www.instagram.com/reel/DAbCdEfGhIj/?igsh=xyz"
reels-sync ingest "https://www.youtube.com/shorts/dQw4w9WgXcQ"
reels-sync ingest "https://www.tiktok.com/@creator/video/7123456789012345678"

Duplicate media IDs are skipped automatically unless --force is passed.

2. Import an Instagram data export

  1. Open Instagram and go to Accounts Center > Your information and permissions > Export your information.
  2. Select JSON format and include Saved items.
  3. Pass the downloaded folder or saved_posts.json file to the importer:
reels-sync import-ig ~/Downloads/instagram-export/

3. Process the queue

Preview pending items before spending LLM or transcription calls:

reels-sync process --dry-run

Run extraction, synthesis, and note writing in batches (optionally parallelize synthesis via --workers):

reels-sync process --limit 10
reels-sync process --limit 20 --workers 4

Retry previously failed items:

reels-sync process --retry-failed

4. Reprocess stored artifacts

Re-run LLM synthesis from the saved sources/reels/<shortcode>.json artifact without downloading media or running Whisper again:

reels-sync reprocess DAbCdEfGhIj
reels-sync reprocess --all

5. Inspect queue statistics

reels-sync stats
reels-sync --json stats

When using --json, global flags must appear before the subcommand.

6. Generate a weekly or topic-scoped digest

Scan atomic notes created within the last N days (excluding sources/, inbox/, and digests/) and write a summary note at digests/<YYYY-MM-DD>-digest.md (or -<tag>-digest.md with --tag):

reels-sync digest --days 7
reels-sync digest --days 30 --tag ai-agents

7. Search and curate inbox notes

Search vault notes offline via keyword or optional local embeddings (ollama / fastembed), and interactively promote, retag, or archive status: inbox notes:

reels-sync search "ffmpeg framing" --backend ollama
reels-sync review --limit 10

See Search, Curation & Digests for backlinks, folder prompt profiles, and worker concurrency details.

Telegram Capture Bot

  1. Create a bot via @BotFather and retrieve your numeric chat ID via @userinfobot.
  2. Set TELEGRAM_BOT_TOKEN and TELEGRAM_ALLOWED_CHAT_ID in .env.
  3. Start the long-polling listener:
reels-sync telegram

Share Instagram Reels, YouTube Shorts, or TikTok links to your bot from mobile. The bot rejects all other chat IDs and refuses to start without TELEGRAM_ALLOWED_CHAT_ID. It only enqueues URLs; schedule reels-sync process via cron or launchd to digest the queue.

MCP Server

Add the server to your MCP client configuration:

{
  "mcpServers": {
    "reels-wiki": {
      "command": "/path/to/reels-secretary/.venv/bin/reels-wiki-mcp",
      "env": {
        "REELS_WIKI_CONFIG": "/path/to/reels-secretary/config.yaml"
      }
    }
  }
}

Exposed MCP tools: enqueue_reel, import_ig_export, process_reels_queue, get_queue_stats, reprocess_reel, search_vault_notes.

Python SDK

from reels_wiki import enqueue, load_config, process_queue

cfg = load_config()
enqueue("https://www.instagram.com/reel/DAbCdEfGhIj/", "script", vault=cfg.vault_path)
process_queue(cfg, limit=3)

How It Works

reels-wiki Core Pipeline Architecture

Step 1: URL normalization and deduplication

Every incoming URL variant (/reel/, /reels/, /p/, /tv/, optional /<user>/, and tracking query parameters) is reduced to its 11-character shortcode and normalized to https://www.instagram.com/reel/<shortcode>/.

sources/.reels_index.json acts as an O(1) lookup gate mapping each shortcode to {status, url, note_path, updated_at}. The queue at inbox/reels-queue.jsonl is append-only, where the last snapshot per shortcode determines the current state. If the index is lost or corrupted, it is rebuilt from the queue. All writes are atomic and guarded by a file lock. Items left in processing after a crash are automatically reset on the next run. A forced re-run reuses the existing note_path and preserves user edits to status and created frontmatter fields.

Step 2: Cost-aware 3-stage waterfall extraction

  1. Metadata: Calls yt_dlp Python API with extract_info(download=False) to retrieve the caption, creator, duration, upload date, and subtitles.
  2. Audio transcription: Runs only when the caption is shorter than min_caption_chars (default 150) and no usable subtitles exist. Audio is downloaded to a temporary directory and transcribed with Groq whisper-large-v3-turbo or local faster-whisper.
  3. Frame OCR: Runs only when both caption and transcript fall below min_caption_chars and min_transcript_chars (default 40). vision_frames (default 4) evenly spaced frames are extracted via ffmpeg and read with gemini-2.5-flash.

Failures in any stage are recorded in the artifact warnings list instead of aborting the pipeline. Reels with zero extracted text are marked skipped without spending an LLM synthesis call. Extracted payloads are stored in sources/reels/<shortcode>.json. No media files are saved inside the vault.

Step 3: Vault discovery and strict enforcement

Before synthesis, reels-wiki reads the vault to discover allowed folders from backticked folder tokens in _CLAUDE.md and _index.md, existing #tags, and existing note titles. sources/ and inbox/ are excluded as output destinations. You can override discovery with allowed_folders in config.yaml.

Model output is validated before writing:

  • Invalid folders fall back to default_folder.
  • File slugs are transliterated to ASCII (including Turkish characters).
  • Tags are normalized against the vault taxonomy.
  • related_wikilinks that do not match an existing note are rendered as plain text (new note candidate) ... to prevent broken links.
  • Notes are written atomically inside the vault path using python-frontmatter.
  • _index.md entries are inserted idempotently under the matching folder heading, and _log.md entries match the file's existing format.

Step 4: Noise filtering and retries

The AtomicNoteSynthesis schema includes a should_keep boolean. Memes, trends, and low-signal posts are marked skipped with skip_reason stored in the index. Malformed JSON responses trigger repair retries and then fall back to fallback_provider if configured.

Repository Layout

reels-secretary/
├── assets/
│   ├── chrome-store/
│   │   ├── promo-marquee-1400x560.png
│   │   ├── promo-small-440x280.png
│   │   └── screenshot-1280x800.png
│   ├── architecture-diagram.svg
│   ├── logo.png
│   ├── promo-local-sync.jpg
│   ├── promo-never-lose.jpg
│   └── promo-offline-vault.jpg
├── docs/
│   ├── README.md
│   ├── architecture.md
│   ├── cli-and-mcp.md
│   ├── configuration.md
│   ├── deployment.md
│   ├── example-walkthrough.md
│   ├── migration.md
│   ├── providers.md
│   ├── saved-posts-workflow.md
│   ├── search-and-curation.md
│   ├── shortcuts-and-extension.md
│   ├── step-by-step.md
│   ├── telegram-bot.md
│   └── troubleshooting.md
├── src/
│   └── reels_wiki/
│       ├── __init__.py
│       ├── core/
│       │   ├── __init__.py
│       │   ├── config.py
│       │   ├── models.py
│       │   └── utils.py
│       ├── ingestion/
│       │   ├── __init__.py
│       │   ├── ig_export.py
│       │   └── queue_manager.py
│       ├── interfaces/
│       │   ├── __init__.py
│       │   ├── cli.py
│       │   ├── cli_ui.py
│       │   ├── http_server.py
│       │   ├── mcp_server.py
│       │   └── telegram_bot.py
│       ├── pipeline/
│       │   ├── __init__.py
│       │   ├── extractor.py
│       │   ├── runner.py
│       │   └── synthesizer.py
│       ├── prompts/
│       │   ├── __init__.py
│       │   ├── synthesis_system.j2
│       │   ├── synthesis_user.j2
│       │   └── vision_ocr.j2
│       └── vault/
│           ├── __init__.py
│           ├── context.py
│           ├── digest.py
│           ├── search.py
│           └── writer.py
├── extension/
│   ├── icons/
│   ├── store-assets/
│   ├── STORE_LISTING.md
│   ├── background.js
│   ├── manifest.json
│   ├── popup.css
│   ├── popup.html
│   └── popup.js
├── obsidian-plugin/
│   ├── main.js
│   ├── manifest.json
│   ├── README.md
│   └── styles.css
├── site/
│   ├── architecture-diagram.html
│   ├── architecture-diagram.svg
│   ├── favicon.ico
│   ├── favicon.png
│   ├── index.css
│   ├── index.html
│   ├── index.js
│   ├── llms.txt
│   ├── privacy.html
│   ├── robots.txt
│   └── sitemap.xml
├── tests/
│   ├── test_cli.py
│   ├── test_e2e_vault.py
│   ├── test_extractor.py
│   ├── test_http_server.py
│   ├── test_ig_export.py
│   ├── test_mcp_server.py
│   ├── test_pipeline.py
│   ├── test_queue_manager.py
│   ├── test_search.py
│   ├── test_synthesizer.py
│   ├── test_telegram_bot.py
│   └── test_writer.py
├── config.example.yaml
├── docker-compose.yml
├── Dockerfile
├── Makefile
├── pyproject.toml
└── SKILL.md

Tests run offline via make test (pytest) without making network or LLM API calls.

Documentation and Governance

Notes and Limits

  • Multi-platform ID normalization: Instagram URLs resolve to 11-character shortcodes ([A-Za-z0-9_-], including /share/... HTTP redirects), YouTube Shorts normalize to yt_<id>, and TikTok video URLs normalize to tt_<id>.
  • Carousel and image-only photo posts (/p/) are accepted: when yt-dlp finds no video stream, downloaded carousel/thumbnail frames are routed to Gemini Vision OCR. Use import-ig --reels-only to skip /p/ posts during bulk import.
  • Note titles are generated in Turkish for Turkish content and technical English otherwise.
  • Offline synthesis is supported via synthesis.provider: ollama against any OpenAI-compatible local endpoint (http://localhost:11434/v1), requiring no cloud API keys when paired with whisper_provider: local.
  • Provider integrations for Groq, Google GenAI, and yt-dlp are isolated in extractor.py and synthesizer.py so upstream SDK changes only require edits in those two files.

Metadata

Release files for reels-wiki 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reels-wiki 0.1.4
File Size Uploaded Provenance Actions
reels_wiki-0.1.4.tar.gz 3.5 MB With provenance Details for reels_wiki-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reels-wiki 0.1.4
File Interpreter ABI Platform Actions
reels_wiki-0.1.4-py3-none-any.whl Python 3 none any Details for reels_wiki-0.1.4-py3-none-any.whl

Total release size: 3.5 MB

Release files / reels_wiki-0.1.4.tar.gz

Download URL reels_wiki-0.1.4.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
e64fde9efe977d14f5c6ffd43b62e3211df350d6cef53a57d07aec881a3ddffe
BLAKE2b-256 checksum
How to use checksums
644a83e15c4f824054692bb60a5a0221f48a54af0e7b62ecd0ee7df61e5d8ddd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / reels_wiki-0.1.4-py3-none-any.whl

Download URL reels_wiki-0.1.4-py3-none-any.whl
Size 62.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29ad1b72e2a00588068e869efe72894258a7c54f933da578b40495d61fea7023
BLAKE2b-256 checksum
How to use checksums
3983852a22ca9ed77f3da97ccd58a9700e9ae82d29307ab0dd443680aab2af8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for reels-wiki 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for reels_wiki-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page