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

# AI Signal Ranker

> Rank news by novelty, velocity, and relevance signals

# AI Signal Ranker

Rank news articles using multiple signals: novelty, velocity, relevance, and engagement.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
flowchart LR
    A[Articles] --> B[AI Signal Ranker]
    B --> C[Multi-Signal Analysis]
    C --> D[Ranked Articles]
    
    style A fill:#e1f5fe
    style D fill:#c8e6c9
```

## CLI Quickstart

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai recipe run ai-signal-ranker \
  --input '{"articles": [...], "top_n": 10}' \
  --json
```

## Use in Your App (SDK)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.recipe import run, run_stream

result = run(
    "ai-signal-ranker",
    input={
        "articles": articles_list,
        "top_n": 10,
        "weights": {
            "novelty": 0.3,
            "velocity": 0.2,
            "relevance": 0.3,
            "engagement": 0.2
        }
    }
)

# Direct tool usage
import sys
sys.path.insert(0, 'agent_recipes/templates/ai-signal-ranker')
from tools import rank_articles, calculate_novelty_score

ranked = rank_articles(articles, top_n=10)
```

## Input Schema

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "type": "object",
  "properties": {
    "articles": {"type": "array"},
    "top_n": {"type": "integer", "default": 10},
    "weights": {
      "type": "object",
      "properties": {
        "novelty": {"type": "number"},
        "velocity": {"type": "number"},
        "relevance": {"type": "number"},
        "engagement": {"type": "number"}
      }
    }
  }
}
```

## Output Schema

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "ranked_articles": [
    {
      "title": "...",
      "combined_score": 0.85,
      "scores": {
        "novelty": 0.9,
        "velocity": 0.8,
        "relevance": 0.85,
        "engagement": 0.75
      }
    }
  ]
}
```

## Signal Definitions

| Signal     | Description                     |
| ---------- | ------------------------------- |
| Novelty    | How new/unique the topic is     |
| Velocity   | How fast the story is spreading |
| Relevance  | Match to target keywords/topics |
| Engagement | Social engagement metrics       |

## Related Tools

* [AI News Crawler](/docs/examples/agent-recipes/creator-suite/ai-news-crawler)
* [AI Context Enricher](/docs/examples/agent-recipes/creator-suite/ai-context-enricher)
