Skip to main content
Glama
README.md
# AI News Agent

Multi-topic news aggregation agent suite. Fetches, summarizes, and lets you interactively explore news via CLI or MCP (Model Context Protocol) for use with AI coding assistants like Devin, Claude Code, and opencode.

## Agents

| Command | Agent | Sources |
|---------|-------|---------|
| `ainews` | AI News | Hacker News, Reddit (9 AI subs), GitHub trending + releases (26 AI orgs), arXiv, 11 AI blog RSS feeds |
| `mynews` | Malaysian News | Malay Mail, FMT, World of Buzz, Rojak Daily, Coconuts KL, Cilisos, Soya Cincau, Reddit r/malaysia, Google News MY |
| `denews` | Germany SWE Jobs | The Local DE, DW, Deutschland.de, Reddit (r/germany, r/cscareerquestionsEU, etc.), Google News DE (visa, Blue Card, jobs) |

## Quick Start

```bash
# Clone and install
git clone https://github.com/sirhafizho/ai-news-agent.git
cd ai-news-agent
python -m venv .venv && source .venv/bin/activate
pip install -e .

# Set your LLM provider key (optional - only needed for AI summarization)
export NEXUS_API_KEY="your-key"  # genai-nexus

# Optional: GitHub PAT for trending repos (5000 req/hr vs 60)
export GITHUB_PAT_TOKEN="ghp_..."

# Run
ainews              # AI news briefing
mynews              # Malaysian news briefing
denews              # Germany job market briefing
```

## CLI Usage

```bash
ainews                    # Full AI-summarized briefing
ainews -i                 # Interactive mode (ask follow-up questions)
ainews --raw              # Raw data dump, no LLM
ainews --sources hn,github  # Specific sources only
ainews --provider glm     # Switch LLM (kimi/glm/gemini)
ainews --no-banner        # Skip banner
```

## Interactive Mode

After the briefing, you get a REPL for follow-up questions:

| Command | What it does |
|---------|-------------|
| `#5` or `article 5` | Deep-dive into article #5 (fetches comments, page content) |
| `list` | Show all articles numbered |
| `search <term>` | Search fetched articles |
| `/deep <topic>` | Deep research on ANY topic (searches the web) |
| `/web <query>` | Web news search for anything |
| Any question | Ask the AI (auto-searches web if out of scope) |
| `quit` | Exit |

## MCP Server (for Devin / Claude Code / opencode)

Exposes 10 tools for programmatic access:

```bash
python -m src.mcp_server    # stdio transport
```

| Tool | Description |
|------|-------------|
| `get_ai_news` | Latest AI news briefing |
| `search_ai_news` | Search AI news by keyword |
| `get_hn_discussion` | Fetch HN comments for a story |
| `get_article_content` | Fetch article text |
| `get_malaysian_news` | Malaysian news briefing |
| `search_malaysian_news` | Search Malaysian news |
| `get_germany_news` | Germany SWE job market briefing |
| `search_germany_jobs` | Search Germany job/visa topics |
| `web_search_news` | Web search for any topic |
| `deep_research_topic` | Multi-query deep research |

## Configuration

Environment variables:

| Variable | Purpose | Required? |
|----------|---------|-----------|
| `NEXUS_API_KEY` | LLM summarization via genai-nexus | Only for AI summaries |
| `GITHUB_PAT_TOKEN` | Higher GitHub API rate limits | Recommended |

LLM providers (via genai-nexus):
- `kimi` — Kimi K2.5 (default)
- `glm` — GLM-5
- `gemini` — Gemini 2.5 Flash

## Project Structure

```
src/
├── cli.py              # ainews entry point
├── my_cli.py           # mynews entry point
├── de_cli.py           # denews entry point
├── interactive.py      # Interactive REPL mode
├── mcp_server.py       # MCP server (stdio)
├── summarizer.py       # LLM summarization
├── details.py          # Article deep-dive (comments, page text)
└── fetchers/
    ├── hackernews.py   # Hacker News
    ├── reddit.py       # Reddit AI subs
    ├── github_trending.py  # GitHub trending + releases
    ├── arxiv.py        # arXiv papers
    ├── rss_feeds.py    # AI blog RSS feeds
    ├── web_search.py   # Web search (Google News + DDG)
    ├── malaysian/      # Malaysian news fetchers
    └── germany/        # Germany job market fetchers
```

## License

MIT — see [LICENSE](LICENSE)

TDQS

A3.9/5.0

Scored across 8 tools

Disambiguation3/5

Most tools have clear get/search distinctions, but get_germany_news and search_germany_jobs overlap heavily—both cover Germany visa, job, and expat topics. The AI and Malaysia pairs are distinct, but this one boundary creates real misselection risk.

Naming Consistency4/5

The get_/search_ verb pattern is mostly consistent, but search_germany_jobs breaks the get_<region>_news / search_<region>_news convention used elsewhere (search_malaysian_news, search_ai_news). get_hn_discussion and get_article_content also deviate, but their unique purposes justify it.

Tool Count4/5

8 tools is a reasonable count, but the server name says 'ai-news' while three tools cover Malaysia and Germany news, making the scope broader than the name suggests. The Germany tools could potentially be consolidated, but the total is not excessive.

Completeness4/5

The set covers fetch and search workflows for each news domain, plus article content and HN discussion deep-dives. Minor gaps include lack of date filtering and a unified cross-source search, but core news consumption workflows are well supported.

Maintenance

ActivityMaintained
ResponsivenessNo issues