Skip to content

eugeneyan/news-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

News Agents

A little experiment with Amazon Q, Model Context Protocol (MCP), and tmux to create a news aggregation system that runs entirely in your terminal. It fetches and summarizes articles from various news sources using multiple agents working in parallel.

Also read the write-up here, and click the image below for 3-minute demo on YouTube.

3-minute news agents demo

What's This All About?

This project is me playing around with:

  • Amazon Q CLI as agent harness
  • MCP to parse RSS feeds as tools
  • tmux for terminal splitting and monitoring

The system grabs news from several sources like Hacker News, TechCrunch, and WSJ, then summarizes everything into nice readable digests, all in your terminal window.

Getting Started

Setting Up Amazon Q

  1. Follow the official guide to install Amazon Q CLI
  2. Set up your AWS credentials
  3. Make sure it's working:
q --version

Clone repo and run it

git clone https://github.com/eugeneyan/news-agents.git

cd news-agents
uv sync  # Sync dependencies
uv tree  # Check httpx and mcp[cli] are installed

q chat --trust-all-tools  # Start Q

/context add --global context/agents.md  # Add system context for multi-agents

Q, read context/main-agent.md and spin up sub agents to execute it.  # Start main agent

The system will start doing its thing: Splitting into multiple agents and processing news feeds in parallel using tmux panes to keep everything visible.

How It Works

Main Agent

  • Grabs feed URLs from feeds.txt
  • Splits them into 3 equal chunks
  • Spawns 3 sub agents in separate tmux panes
  • Keeps an eye on everyone's progress
  • Collects all the summaries at the end

Sub Agents

  • Each gets assigned several feeds
  • For each feed they:
    • Pull down the content
    • Parse out the articles
    • Write up summaries
    • Save them to summaries/[feed-name].md
  • When done, they report back to the main agent

The Whole Process Looks Like This

Main Agent (in the main tmux pane)
β”œβ”€β”€ Read feeds.txt
β”œβ”€β”€ Split feeds into 3 chunks
β”œβ”€β”€ Create 3 Sub-Agents (in separate tmux panes)
β”‚   β”œβ”€β”€ Sub-Agent #1
β”‚   β”‚   β”œβ”€β”€ Process feeds in chunk 1
β”‚   β”‚   └── Report back when done
β”‚   β”œβ”€β”€ Sub-Agent #2
β”‚   β”‚   β”œβ”€β”€ Process feeds in chunk 2
β”‚   β”‚   └── Report back when done
β”‚   └── Sub-Agent #3
β”‚       β”œβ”€β”€ Process feeds in chunk 3
β”‚       └── Report back when done
└── Combine everything into main-summary.md

What You Get

  • Individual summaries in the summaries/ folder
  • One big summary in main-summary.md
  • A cool demonstration of agents working together in your terminal

Debugging MCP

uv run mcp dev src/main.p

Project Files

.
β”œβ”€β”€ context/           # Instructions for the agents
β”œβ”€β”€ src/               # Code for processing each feed type
β”‚   β”œβ”€β”€ ainews.py      # AI News stuff
β”‚   β”œβ”€β”€ hackernews.py  # Hacker News stuff
β”‚   β”œβ”€β”€ techcrunch.py  # TechCrunch stuff
β”‚   β”œβ”€β”€ wired.py       # Wired stuff
β”‚   └── wsj.py         # Wall Street Journal stuff
└── summaries/         # Where all the summaries end up

About

πŸ“° Building News Agents to Summarize News with MCP, Q, and tmux

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages