Skip to content

Scenario 2 Content Processing

Martin Schultheiss edited this page Nov 25, 2025 · 1 revision

Scenario 2: Processing Content with Strategies

Learn how to analyze and improve content using Context Processor's pre-processing strategies.

Overview

This scenario demonstrates:

  1. Applying individual strategies (Clarify, Analyze, Search, Fetch)
  2. Comparing strategy outputs
  3. Combining strategies for comprehensive analysis
  4. Processing different content types
  5. Using results for improvement

Time: ~10 minutes | Complexity: Intermediate


The Use Case

You have various content that needs analysis:

  • Blog posts that need clarity improvement
  • Articles requiring SEO optimization
  • Content with external references
  • Documents needing structural analysis

Understanding the 5 Strategies

1. Clarify Strategy

Detects and reports on:

  • Vague language and generic terms
  • Passive voice usage
  • Ambiguous pronouns
  • Clarity score (0-100)

Use when: You want to improve readability


2. Analyze Strategy

Provides metrics on:

  • Word count and reading time
  • Sentence complexity
  • Average word length
  • Readability metrics

Use when: You need content metrics


3. Search Strategy

Generates:

  • Ranked keywords
  • Topic extraction
  • SEO-relevant terms

Use when: You want content to be discoverable


4. Fetch Strategy

Detects:

  • URLs and links
  • External references
  • URL types

Use when: You have content with links


Quick Examples

Process a Blog Post

const blogPost = `
The importance of testing your code is something that cannot be overstated.
Tests ensure the code works correctly. Test strategies include unit, integration, and e2e tests.
Learn more at https://testing-library.io and https://jest.io
`;

// Get different perspectives
const clarity = processor.analyzeContent(blogPost, "clarify");
const keywords = processor.analyzeContent(blogPost, "search");
const analysis = processor.analyzeContent(blogPost, "analyze");
const urls = processor.analyzeContent(blogPost, "fetch");

console.log("Clarity Score:", clarity.clarity_score);
console.log("Top Keywords:", keywords.keywords);
console.log("Reading Time:", analysis.reading_time_minutes, "min");
console.log("URLs Found:", urls.urls.length);

Identify Improvement Areas

if (clarity.clarity_score < 50) {
  console.log("⚠️ This content needs clarity improvements");
  console.log("Suggestions:", clarity.suggestions);
}

Save with Comprehensive Processing

const saved = processor.save({
  title: "Testing Best Practices",
  content: blogPost,
  tags: ["testing", "best-practices"]
}, "comprehensive"); // Applies clarify + analyze + search

console.log("Content saved with full analysis!");

Quick Strategy Comparison

Strategy Use Case Output
Clarify Improve readability Clarity score, vague words
Analyze Content metrics Word count, complexity, reading time
Search SEO & discoverability Keywords, topics, tags
Fetch External references URLs, link types
Comprehensive Everything All of the above

Key Takeaways

✅ Analyze - Understand content from multiple angles
✅ Improve - Use suggestions to enhance content
✅ Optimize - Make content discoverable and clear
✅ Automate - Process content at scale
✅ Compare - Apply different strategies for different needs


Next Steps


Ready to dive deeper? Check out Scenario 3 for advanced workflows!