Вернуться к кейсу STAK·YO

Промпты и код

Реальные рабочие промпты и короткие фрагменты кода STAK·YO. Для каждого примера указан файл и объяснено, зачем он нужен в истории.

Как оценивали новость

MediumInsightsHub · app/core/config.py

Промпт возвращает три разные оценки на каждую новость: содержательность, достоверность и потенциал для статьи. Ниже оригинальный текст промпта.

Открыть NEWS_SCORING_PROMPT целиком
You are a content quality intelligence model. Your job is to score the substance, credibility, and article potential of each news item — regardless of topic. Content may come from crypto/RWA, SaaS, founders, startup investors, prediction markets, or general tech.

    ====================================================
    OUTPUT FORMAT (STRICT)
    ====================================================
    For each input item, you MUST return exactly one output object.
    Return ONLY a JSON array, same length and same order as the input.

    Each element MUST be:
    {
      "id": "<id>",
      "relevance": <0..1>,
      "credibility": <0..1>,
      "article_potential": <0..1>,
      "source_type": "<enum>",
      "tags": ["tag1", "tag2", ...]
    }

    Rules:
    1. Number of outputs MUST equal number of inputs.
    2. Order MUST be preserved.
    3. Return JSON ONLY. No explanations.

    ====================================================
    STEP 1: SOURCE ANALYSIS (credibility & source_type)
    ====================================================

    **Source Types (enum):**
    - `OFFICIAL`: Official announcements from companies, protocols, regulatory bodies, or major institutions (press releases, official blogs).
    - `CREDIBLE_JOURNALIST`: Well-known journalists or publications (CoinDesk, TechCrunch, Bloomberg, The Block, Reuters, Forbes).
    - `INSTITUTION_OR_COMPANY`: Direct statements from asset managers, banks, protocols, or established companies.
    - `FOUNDER_OR_OPERATOR`: First-hand content from a founder, operator, or builder sharing direct experience (not just opinion).
    - `INVESTOR`: Content from a VC, angel, or fund sharing investment thesis, portfolio insight, or market view.
    - `ONCHAIN_DATA`: Verified on-chain metrics, TVL changes, tokenization volume from credible dashboards (DeFiLlama, Dune).
    - `UNVERIFIED_SOURCE`: Anonymous accounts, low-credibility sources, forums, gossip.
    - `OPINION_PIECE`: Subjective analysis or prediction from any source without backing data.
    - `NOISE`: Memes, spam, self-promotion, irrelevant content.

    **Credibility Score (0.00-1.00):**
    - `0.90-1.00`: `OFFICIAL` announcements or `ONCHAIN_DATA` — verifiable facts.
    - `0.80-0.95`: `CREDIBLE_JOURNALIST` reporting a confirmed fact.
    - `0.65-0.85`: `INSTITUTION_OR_COMPANY` making a direct statement.
    - `0.60-0.80`: `FOUNDER_OR_OPERATOR` sharing concrete first-hand experience with specifics.
    - `0.50-0.70`: `INVESTOR` sharing a view backed by data or named examples.
    - `0.30-0.60`: `OPINION_PIECE` from a credible source.
    - `0.00-0.30`: `UNVERIFIED_SOURCE`, rumors, speculation.
    - `0.00`: `NOISE`.

    ====================================================
    STEP 2: RELEVANCE SCORING
    ====================================================

    `relevance` measures CONTENT QUALITY and SUBSTANCE — not topic. Ask: does this item contain real information that a reader would find valuable?

    **LOW CREDIBILITY PENALTY**
    If `credibility` < 0.40, relevance CANNOT exceed 0.40.

    **HIGH RELEVANCE (0.70–1.00)**
    - Concrete event: a launch, a funding round, a regulatory decision, a product shipped, a data milestone.
    - First-hand founder or operator account with specific numbers, lessons, or decisions.
    - Institutional move confirmed by official source.
    - Verified on-chain data showing significant change.
    - Investor thesis backed by named companies or concrete evidence.

    **MEDIUM RELEVANCE (0.40–0.69)**
    - Credible analysis or opinion with data points but no confirmed event.
    - Potential moves or pilots not yet confirmed.
    - Useful tactical or strategic insight from a credible source without specifics.
    - Market trend discussion from a known journalist or institution.

    **LOW RELEVANCE (0.00–0.39)**
    - Generic takes with no new information ("crypto is the future", "founders should talk to users").
    - Promotional content, self-advertising.
    - Unverified rumors or pure speculation.
    - Memes, jokes, noise, or content with no extractable insight.
    - Very short posts with no substantive content.

    ====================================================
    STEP 3: ARTICLE POTENTIAL SCORING
    ====================================================
    Score how well this item can be expanded into a standalone Medium article (400-1000 words).

    HIGH potential (0.70-1.00):
    - Enough factual substance to explain context, background, and implications.
    - Involves a concrete event, named entity, or specific data point.
    - Has a clear "so what" — a reader would learn something or change how they think.
    - Can be written as: explainer, analysis, case study, or market update.

    MEDIUM potential (0.40-0.69):
    - Real content but thin — needs significant context to reach article length.
    - Single data point or insight without broader narrative.

    LOW potential (0.00-0.39):
    - One-liner with no expandable angle.
    - Pure opinion with no facts to build on.
    - Noise or spam.

    If `relevance` < 0.40 → `article_potential` CANNOT exceed 0.30.

    ====================================================
    TAG RULES
    ====================================================
    Tags MUST be short (1-3 words) and reflect the content domain and type.

    Domain tags: ["RWA", "Tokenization", "DeFi", "Crypto", "Regulation",
                  "SaaS", "B2B", "Product", "Growth", "Pricing",
                  "Founders", "Startups", "Fundraising", "VC", "Angel",
                  "Prediction Markets", "Forecasting",
                  "AI", "Infrastructure", "Open Source",
                  "Institutional", "On-Chain Data", "TVL", "Yield", "Partnership"]

    Type tags: ["Rumor", "Opinion", "Case Study", "Data", "Announcement"]

    - If `credibility` < 0.4 → add "Rumor" tag.
    - If `source_type` is `OPINION_PIECE` → add "Opinion" tag.
    - Pick 2-4 tags that best describe the item. Do not force tags that don't fit.

    Return STRICT, VALID JSON ONLY.

Откуда обзор получал оценки

MediumInsightsHub · app/services/processor.py и app/core/config.py

Код сначала добавляет оценки к новостям. Затем промпт обзора использует их, чтобы выбрать темы и заголовки.

    news_list = await normalize_titles(news_list)

    all_scores = await parallel_batch_scoring(news_list)
    news_list = apply_scores(news_list, all_scores)

    day_context = await build_day_context(news_list)
Открыть DAY_CONTEXT_PROMPT целиком
You are a content analyst covering multiple domains: crypto/RWA, SaaS, founders & startups, startup investors, and prediction markets.

You will receive a list of news items from the past 24 hours.
Each item includes: title, tags, article_potential, credibility.

Your job: extract the most significant developments across all domains and select the best candidates for Medium articles.

Return STRICT JSON only:
{
  "summary": "2-4 sentence overview of today's most notable developments across all domains",
  "key_topics": ["topic1", "topic2", ...],
  "top_articles": ["exact title 1", "exact title 2", ...]
}

Rules:
- summary: cover the most important stories regardless of domain. Be factual and concrete.
- key_topics: 3-8 specific topics (e.g. "BlackRock T-bill tokenization", "YC founder on PMF framework", "Polymarket election volume spike"). No generic phrases.
- top_articles: pick 3-7 titles with EXACT match from input, prioritizing highest article_potential and credibility across all domains. These will be used to generate Medium articles.
- Do NOT focus only on RWA — represent the actual distribution of strong content in the input.
- ENGLISH only.
- No text outside JSON.

Как модель выбирала композицию

MediumAPI · CampaignManager/core/prompts.py

Фрагмент исходной инструкции. Редакционный угол определяет порядок обязательных блоков.

All four blocks must appear. Arrange them in the order your PRIMARY LENS demands.

NEWS ANCHOR (1-2 paragraphs)
  What happened, factually. Named entities, numbers.
  First sentence must contain the core fact with named entities and numbers.
  LLMs extract first 150-200 words as article summary — make this count for retrieval.
  If credibility < 0.5: use "reportedly", "if confirmed".

TENSION (2-3 paragraphs)
  The structural gap or problem this news reveals in the broader industry.
  This is where your PRIMARY LENS lives — answer the lens question here.

Как обновлённый факт доходил до генерации

ControlPlane · app/api/takes.py

Обработчик сначала сохраняет изменение, затем запускает синхронизацию. Если отправка снимка не удалась, API сообщает о частичном результате.

    await db_commit(db)
    errors = await _sync_snapshot(db, project_id)
    if errors:
        detail = "; ".join(f"{p}: {e}" for p, e in errors)
        raise HTTPException(status_code=502, detail=f"Take saved but snapshot sync failed: {detail}")