
news_agent
一个基于多代理架构的智能新闻处理系统,收集、分析并发送新闻摘要至 Telegram。
Repository Info
About This Server
一个基于多代理架构的智能新闻处理系统,收集、分析并发送新闻摘要至 Telegram。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
News Multi-Agent System
An intelligent news processing system that collects, analyzes, and delivers news digests using a multi-agent architecture. The system processes news from various sources, adds context, performs sentiment analysis, and delivers formatted digests to Telegram.
Features
- Intelligent News Collection: Collects news from multiple RSS feeds
- Smart News Grouping: Groups related news items using semantic analysis
- Context Enhancement: Adds historical context and future implications
- Advanced Analytics: Provides sentiment analysis and key insights
- Multi-language Support: Translates content to Russian
- Telegram Integration: Delivers formatted digests to Telegram channels
System Architecture
The system uses a multi-agent architecture with specialized agents:
- Collector Agent: Fetches news from configured RSS feeds
- Manager Agent: Groups related news items using semantic clustering
- Context Maker Agent: Enhances news with historical context using vector database
- Writer Agent: Processes and analyzes news, including translation and sentiment analysis
- Publisher Agent: Formats and publishes digests to Telegram
Installation
- Clone the repository:
git clone [your-repo-url]
cd news_multi_agent
- Create and activate a virtual environment:
python -m venv venv
# Windows
venv\Scripts\activate
# Unix/MacOS
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables in
.envfile:
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id
OPENAI_API_KEY=your_openai_api_key
Usage
- Configure news sources in
main.py:
source_configs = [
{"url": "https://feeds.bbci.co.uk/news/world/rss.xml", "days_ago": 0},
# Add more sources as needed
]
- Run the application:
python main.py
Sample Output
The system generates structured news digests in the following format:
News Digest
Generated: 2025-02-06 11:50:29
Region: Global
*1. [News Description]*
Category: Politics
Tags: diplomacy, international relations, summit
Analysis:
[Analysis of the news and its significance]
Historical Context:
[Events and context leading to this news]
Future Implications:
[Predicted future developments]
Sentiment Score: 0.75
────────────────────────
*2. [Next News Description]*
...
Technologies Used
Core Technologies
- Python 3.11+
- Pydantic for data validation
- AsyncIO for asynchronous operations
- FAISS for vector similarity search
- Telegram Bot API for message delivery
AI and NLP
- OpenAI API for text analysis
- Sentence Transformers for semantic analysis
- NLTK for text processing
- MCP Server for efficient RAG (Retrieval-Augmented Generation)
- Optimized vector storage and retrieval
- Fast similarity search for context enhancement
- Efficient document chunking and embedding
Data Storage
- FAISS vector database for context storage
- JSON for processed news storage
Development Tools
- Poetry for dependency management
- Python-dotenv for environment management
- Logging for system monitoring
Project Structure
news_multi_agent/
├── agents/
│ ├── collector.py
│ ├── manager.py
│ ├── context_maker.py
│ ├── writer.py
│ └── publisher.py
├── base_agent.py
├── data_models.py
├── main.py
├── requirements.txt
└── .env
Logging
The system maintains detailed logs in the logs/agents.log file, capturing:
- Agent initialization and operations
- News processing steps
- Errors and warnings
- Performance metrics
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT License
Copyright (c) 2025 Dmitriy Kravtsov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Author
Dmitriy Kravtsov dmkravtsov@gmail.com
Quick Start
Clone the repository
git clone https://github.com/dmkravtsov/news_agentInstall dependencies
cd news_agent
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.