> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mavera.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Transcript Mega-Analysis

> Feed an entire quarter of meeting transcripts into Claude's long context window for cross-meeting pattern analysis — recurring objections, shifting priorities, competitor mentions, and sentiment trajectories, then enrich with Mavera

## Scenario

Feed an entire quarter of meeting transcripts into Claude's long context window for cross-meeting pattern analysis. Instead of summarizing each meeting individually, Claude identifies patterns that only emerge across conversations: recurring objections, shifting priorities, competitors mentioned offhand, and sentiment trajectories. Then send the synthesized patterns to Mavera for enrichment with competitive intelligence and trend validation.

**Flow:** Aggregate transcripts → Anthropic `POST /v1/messages` (Claude processes all at once) → Extract patterns → Mavera `POST /mave/chat` → Enriched quarterly intelligence report

## Code

<CodeGroup>
  ```python Python theme={"dark"}
  import os, glob, time, anthropic, requests

  MV = os.environ["MAVERA_API_KEY"]
  MV_BASE = "https://app.mavera.io/api/v1"
  MV_H = {"Authorization": f"Bearer {MV}", "Content-Type": "application/json"}
  client = anthropic.Anthropic()

  # 1. Aggregate all transcripts
  transcripts = []
  for fpath in sorted(glob.glob("./transcripts/2025-Q4/*.txt")):
      with open(fpath) as f:
          transcripts.append(f"--- MEETING: {os.path.basename(fpath)} ---\n{f.read()}")
  combined = "\n\n".join(transcripts)
  print(f"Loaded {len(transcripts)} transcripts ({len(combined):,} chars, ~{len(combined)//4:,} tokens)")

  # 2. Claude cross-meeting pattern analysis
  patterns = client.messages.create(
      model="claude-opus-4-6-20250725",
      max_tokens=4096,
      input=[{
          "role": "user",
          "content": "Strategic analyst reviewing an entire quarter of meeting transcripts.\n\n"
              "Identify cross-meeting patterns:\n"
              "1. **Recurring Objections** — concerns across multiple meetings\n"
              "2. **Shifting Priorities** — how priorities evolved early → late quarter\n"
              "3. **Competitor Mentions** — who, how often, in what context\n"
              "4. **Sentiment Arc** — trending more or less optimistic?\n"
              "5. **Decision Bottlenecks** — where deals/projects stall repeatedly\n"
              "6. **Emerging Themes** — topics that appeared late (early signals)\n"
              "7. **Key Stakeholders** — who has most influence\n\n"
              f"Cite specific meetings with verbatim quotes.\n\nTRANSCRIPTS:\n{combined}"
      }],
  )
  pattern_output = patterns.content[0].text
  print(f"Pattern analysis complete — {patterns.usage.input_tokens:,} input tokens")

  # 3. Mavera enrichment
  enriched = requests.post(f"{MV_BASE}/mave/chat", headers=MV_H, json={
      "message": "Competitive intelligence analyst. Enrich these internal meeting patterns with market context.\n\n"
          f"INTERNAL PATTERNS:\n{pattern_output[:6000]}\n\n"
          "For each pattern:\n"
          "1. **Market Validation** — Do external signals confirm this?\n"
          "2. **Competitive Context** — What are competitors doing about this?\n"
          "3. **Trend Classification** — Short-term blip or structural shift?\n"
          "4. **Recommended Action** — What should leadership do?\n"
          "5. **Risk if Ignored** — What happens if we don't act?\n\n"
          "End with EXECUTIVE SUMMARY (5 bullets, each with urgency: high/medium/low)."
  }).json()

  print(f"\n{'='*60}\nENRICHED QUARTERLY INTELLIGENCE\n{'='*60}")
  print(enriched.get("content", "")[:3000])
  ```

  ```javascript JavaScript theme={"dark"}
  import Anthropic from "@anthropic-ai/sdk";
  import fs from "fs";
  import path from "path";

  const MV = process.env.MAVERA_API_KEY;
  const MV_BASE = "https://app.mavera.io/api/v1";
  const MV_H = { Authorization: `Bearer ${MV}`, "Content-Type": "application/json" };
  const client = new Anthropic();

  const dir = "./transcripts/2025-Q4/";
  const files = fs.readdirSync(dir).filter(f => f.endsWith(".txt")).sort();
  const combined = files.map(f =>
    `--- MEETING: ${f} ---\n${fs.readFileSync(path.join(dir, f), "utf-8")}`).join("\n\n");
  console.log(`Loaded ${files.length} transcripts (${combined.length.toLocaleString()} chars)`);

  const patterns = await client.messages.create({
    model: "claude-opus-4-6-20250725", max_tokens: 4096,
    input: [{ role: "user",
      content: `Strategic analyst. Full quarter of transcripts. Identify:\n`
        + `1. Recurring Objections 2. Shifting Priorities 3. Competitor Mentions\n`
        + `4. Sentiment Arc 5. Decision Bottlenecks 6. Emerging Themes 7. Key Stakeholders\n`
        + `Cite meetings with verbatim quotes.\n\nTRANSCRIPTS:\n${combined}` }],
  });
  console.log(`Pattern analysis — ${patterns.usage.input_tokens.toLocaleString()} input tokens`);

  const enriched = await fetch(`${MV_BASE}/mave/chat`, { method: "POST", headers: MV_H,
    body: JSON.stringify({
      message: `CI analyst. Enrich patterns with market context.\n\nPATTERNS:\n${patterns.content[0].text.slice(0, 6000)}\n\n`
        + `Per pattern: Market Validation, Competitive Context, Trend Classification, `
        + `Recommended Action, Risk if Ignored.\nEnd with EXECUTIVE SUMMARY.` }),
  }).then(r => r.json());
  console.log(`\n${"=".repeat(60)}\nENRICHED QUARTERLY INTELLIGENCE`);
  console.log((enriched.content || "").slice(0, 3000));
  ```
</CodeGroup>

## Example Output

```text theme={"dark"}
Loaded 47 transcripts (1,284,920 chars, ~321,230 tokens)
Pattern analysis complete — 321,230 input tokens

ENRICHED QUARTERLY INTELLIGENCE
============================================================
1. RECURRING OBJECTION: "Integration timeline is too long" (12/47 meetings)
   Market Validation: Gartner avg enterprise integration = 4.2 months.
   Competitive Context: Competitor X launched "60-minute setup" in Oct.
   Classification: STRUCTURAL — buyer expectations permanently shifted.
   Risk: HIGH — Pipeline stalls increase 30%/quarter if unaddressed.

2. SHIFTING PRIORITY: Security → compliance framing (early → late quarter)
   Market Validation: SEC cyber disclosure rules took effect Q4.
   Classification: REGULATORY — will intensify through 2026.
   Risk: MEDIUM — Messaging feels dated within 2 quarters.

EXECUTIVE SUMMARY:
• HIGH: Integration speed is the #1 deal-killer — 12/47 meetings
• HIGH: Competitor X gaining mindshare — 8 mentions (up from 2)
• MEDIUM: Compliance framing needed — regulatory shift
• LOW: AI features generating pull — 6 inbound requests
```

## Error Handling

<AccordionGroup>
  <Accordion title="Context window overflow">47 transcripts at \~7K tokens each ≈ 329K tokens — within the 1M limit. If your quarter exceeds 900K tokens, split into months and synthesize in a final call.</Accordion>
  <Accordion title="Slow responses">Large context calls take 60-120 seconds. The `anthropic` SDK defaults to 10 minutes. For raw HTTP, set `timeout=600`.</Accordion>
  <Accordion title="Mavera context limits">Pattern output can be long. The enrichment call truncates to 6,000 chars. Split into two calls if needed.</Accordion>
</AccordionGroup>
