Skip to main content
AI agent that searches and summarizes latest news on any topic.

Code

File Setup

Create news-summarizer.py with the code below, or save it directly from your editor.
"""News Summarizer Agent

A Bindu agent that searches and summarizes latest news on any topic.
Runs locally via Ollama - no API key required!

Features:
- Real-time web search using DuckDuckGo
- Local LLM via Ollama
- Works for any topic: sports, tech, finance, politics etc..

Usage:
    python news_agent.py
"""

import os
from dotenv import load_dotenv
from agno.agent import Agent
from agno.models.ollama import Ollama
from agno.tools.duckduckgo import DuckDuckGoTools
from bindu.penguin.bindufy import bindufy

load_dotenv()

# Agent Brain
agent = Agent(
    instructions=(
        "You are a news research assistant. "
        "When given a topic, search for the latest news about it. "
        "Return a structured summary with: "
        "1. Top 3 headlines "
        "2. Brief summary of each "
        "3. Overall sentiment (positive/negative/neutral)"
    ),
    model=Ollama(id="llama3.2"),
    tools=[DuckDuckGoTools()],
)

# Bindu Config
config = {
    "author": "SSJ.shabdsnehi08@gmail.com",
    "name": "news_summarizer_agent",
    "description": "Searches and summarizes latest news on any topic using local Ollama",
    "deployment": {
        "url": "http://localhost:3773",
        "expose": True,
        "cors_origins": ["http://localhost:5173"]
    },
    "skills": ["skills/news-summarization"],
}

# Handler
def handler(messages: list[dict[str, str]]):
    """Process incoming messages and return news summary.

    Args:
        messages: Conversation history as list of dicts
                  e.g. [{"role": "user", "content": "cricket news"}]

    Returns:
        Agent response with structured news summary
    """
    latest_message = messages[-1]["content"]
    result = agent.run(input=messages)
    return result

# Launch
if __name__ == "__main__":
    os.environ["AUTH_ENABLED"] = "false"
    bindufy(config, handler)

Skill Configuration

Create skills/news-summarization/skill.yaml:
# News Summarization Skill
# Searches and summarizes latest news on any topic using web search

id: news-summarization-v1
name: news-summarization
version: 1.0.0
author: Shabd Snehi Juneja

description: |
  Searches the web for latest news on any topic and returns structured
  summaries with headlines, brief descriptions, and sentiment analysis.
  Use when users ask for current news, recent events, or topic updates.

tags:
  - news
  - summarization
  - web-search
  - research
  - current-events

input_modes:
  - text/plain
  - application/json

output_modes:
  - text/plain
  - application/json

examples:
  - "Give me latest cricket news"
  - "What's happening in AI today?"
  - "Summarize recent Tesla news"
  - "Latest updates on climate change"
  - "What happened in football this week?"

capabilities_detail:
  news_search:
    supported: true
    sources:
      - web
      - news sites
    description: "Real-time web search using DuckDuckGo"

  summarization:
    supported: true
    output_format:
      - headlines
      - brief summaries
      - sentiment analysis
    description: "Structured news summaries with top 3 headlines"

  topics:
    - sports
    - technology
    - finance
    - politics
    - science
    - entertainment
    - general

requirements:
  packages:
    - ollama
    - duckduckgo-search
  system:
    - "Ollama running locally with llama3.2 model"
  min_memory_mb: 500

performance:
  avg_processing_time_ms: 20000
  max_concurrent_requests: 5
  memory_per_request_mb: 500
  scalability: vertical

allowed_tools:
  - Search
  - Read
  - Summarize

documentation:
  overview: |
    This skill enables the agent to fetch and summarize latest news on any
    topic. Unlike static summarization, this skill actively searches the web
    for current information using DuckDuckGo, then uses a local Llama 3.2
    model to produce structured summaries — completely free and private.

  use_cases:
    when_to_use:
      - User asks for latest news on any topic
      - User wants current events summarized
      - User needs quick news briefing
      - User asks "what's happening with X"

    when_not_to_use:
      - User provides their own text to summarize (use summarizer skill)
      - User needs historical data analysis
      - User needs real-time live scores (latency too high)

  output_format: |
    Structured response with three sections:

    1. Top 3 Headlines
    2. Brief summary of each headline
    3. Overall sentiment (positive/negative/neutral)

  examples:
    - title: "Sports News"
      input: "Give me latest cricket news"
      output:
        answer: |
          Top 3 Headlines:
          1. Australia T20 World Cup Update...
          2. Imran Khan Cricket Captains Letter...
          3. Afghanistan vs Canada Match Preview...

          Overall Sentiment: Neutral

assessment:
  keywords:
    - news
    - latest
    - recent
    - today
    - current
    - update
    - happening
    - summarize
    - headlines
    - cricket
    - football
    - sports
    - technology
    - finance
    - politics

  specializations:
    - domain: sports_news
      confidence_boost: 0.4
    - domain: tech_news
      confidence_boost: 0.3
    - domain: general_news
      confidence_boost: 0.3

  anti_patterns:
    - "summarize this text"
    - "summarize this document"
    - "explain this"
    - "what is"
    - "define"
    - "calculate"
    - "write code"

  complexity_indicators:
    simple:
      - "latest news"
      - "recent updates"
      - "what happened"
    medium:
      - "summarize news about"
      - "give me headlines on"
    complex:
      - "compare coverage of"
      - "sentiment analysis of news"

How It Works

News Research
  • DuckDuckGoTools(): Real-time web search for latest news
  • Searches for current events on any topic
  • Retrieves multiple news sources for comprehensive coverage
Local Processing
  • Ollama(id="llama3.2"): Local LLM for private processing
  • No API keys required - runs completely locally
  • Cost-effective and privacy-preserving
Structured Output
  • Top 3 headlines from search results
  • Brief summary of each news item
  • Overall sentiment analysis (positive/negative/neutral)
Agent Capabilities
  • News research assistant persona
  • Multi-topic support (sports, tech, finance, politics)
  • Structured summary generation
  • Real-time information gathering

Dependencies

uv init
uv add bindu agno python-dotenv duckduckgo-search ollama

Environment Setup

Create .env file:
# No API key required - runs locally with Ollama

Run

uv run news-summarizer.py
Examples:
  • “Give me latest cricket news”
  • “What’s happening in AI today?”
  • “Summarize recent Tesla news”

Example API Calls

{
  "jsonrpc": "2.0",
  "method": "message/send",
  "params": {
    "message": {
      "role": "user",
      "kind": "message",
      "messageId": "9f11c870-5616-49ad-b187-d93cbb100001",
      "contextId": "9f11c870-5616-49ad-b187-d93cbb100002",
      "taskId": "9f11c870-5616-49ad-b187-d93cbb100003",
      "parts": [
        {
          "kind": "text",
          "text": "Give me latest cricket news"
        }
      ]
    },
     "skillId": "news-summarization-v1",
    "configuration": {
      "acceptedOutputModes": ["application/json"]
    }
  },
  "id": "9f11c870-5616-49ad-b187-d93cbb100003"
}
{
  "jsonrpc": "2.0",
  "method": "tasks/get",
  "params": {
    "taskId": "9f11c870-5616-49ad-b187-d93cbb100003"
  },
  "id": "9f11c870-5616-49ad-b187-d93cbb100004"
}

Frontend Setup

# Clone the Bindu repository
git clone https://github.com/GetBindu/Bindu

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start frontend development server
npm run dev
Open http://localhost:5173 and try to chat with the news summarizer