Skip to content

0xDecay/PromptCorder

Repository files navigation

PromptCorder

A personal AI prompt capture and organization system. Paste a URL, text, or screenshot into a Discord channel — PromptCorder extracts the prompt, classifies it with AI, and stores it in a structured Notion database.

Discord Capture → AI Processing (OpenRouter/MiniMax) → Notion Database

The Problem

AI power users encounter 3-4 high-value prompts daily across Twitter, Substack, newsletters, and other platforms. These get saved in unstructured ways — copy-pasted into flat documents with no tagging or searchability. Within days, the collection becomes a digital junk drawer.

The problem is not capture. The problem is that saving feels like the finish line when it is actually the starting line.

How It Works

  1. Paste a URL, text, or screenshot into a dedicated Discord channel
  2. PromptCorder fetches the content, extracts the prompt, and sends it to AI for classification
  3. AI generates a title, assigns a category, and infers tags
  4. The structured record is written to a Notion database
  5. A confirmation is posted in Discord with the classification details

Input Types

Input Behavior
URL Fetches page content, extracts prompt text, detects source type (Twitter, Substack, Newsletter, Other)
Text Classifies directly, source type = Manual
Screenshot OCR extracts text from image, then classifies

Notion Database Schema

Property Type Details
Prompt Title Title AI-generated, 5-10 words
Prompt Text Rich Text Full extracted prompt content
Category Select Marketing, Business Strategy, Coding, Writing, Research, Uncategorized
Tags Multi-Select 1-5 AI-inferred tags, lowercase hyphenated
Source URL URL Original URL (null for text input)
Source Type Select Twitter, Newsletter, Substack, Manual, Screenshot, Other
Date Captured Date Auto-set at capture time

Setup

Prerequisites

  • Python 3.10+
  • Discord bot with Message Content Intent enabled
  • OpenRouter API key
  • Notion integration connected to a parent page

Installation

git clone https://github.com/dhroovmehta/PromptCorder.git
cd PromptCorder
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Fill in all values in .env

Environment Variables

Variable Description
DISCORD_BOT_TOKEN Discord bot token
DISCORD_CHANNEL_ID ID of the capture channel
DISCORD_OWNER_ID Your Discord user ID
OPENROUTER_API_KEY OpenRouter API key
OPENROUTER_MODEL Model identifier (default: minimax/minimax-01)
NOTION_API_KEY Notion integration token
NOTION_DATABASE_ID Notion database ID

Run Locally

python3 bot.py

Deploy with PM2

pm2 start ecosystem.config.js
pm2 save

Error Handling

PromptCorder follows a "never lose anything" philosophy:

  • URL fetch fails → stores the URL with fallback values
  • AI API fails → stores raw content with title = first 50 chars, category = Uncategorized
  • Notion API fails → retries 3x with exponential backoff, then logs to logs/failed_writes.json for manual recovery
  • OCR fails → stores image reference with partial text

No content is ever silently discarded.

Stack

  • Python 3.10+ — discord.py, httpx, BeautifulSoup4, notion-client
  • OpenRouter — AI classification via MiniMax model
  • Notion API — Structured storage
  • PM2 — Process management on DigitalOcean VPS

Cost

  • Hosting: $0 incremental (shared VPS)
  • Discord: Free
  • Notion API: Free
  • AI Processing: ~$5/month at 3-4 prompts/day

License

MIT

About

Personal AI prompt capture and organization system. Paste a URL, text, or screenshot into Discord — AI extracts the prompt, classifies it, and stores it in a structured Notion database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors