Important
📋 Version Updates from v1.0:
- Interactive Frontend Design: Replaced timeline with a masonry grid layout, featuring 3D hover effects, a source filter bar, and fade-in animations.
- Enhanced Loading Animation: Custom SVG spinner with concentric rotating paths and a blurred background, displaying "Updating Latest AI News...".
- Resolved Double API Calls: Fixed redundant API requests using a
useRefhook in React Strict Mode. - CORS Middleware: Added FastAPI CORS support for seamless communication between frontend (
http://localhost:5173) and backend (http://127.0.0.1:8000). - Reduced Backend Logging: Set logging to
WARNINGlevel with a--verboseflag to optionally enable detailed logs, minimizing terminal output.
The AI News Agent is an advanced AI-powered web application designed to fetch, summarize, and display the latest AI-related news articles in a visually engaging and user-friendly interface.
🚀 Powered by Multi-Agent Intelligence, this system integrates:
- 🤖 Large Language Models (LLMs) via Ollama and Camel AI for intelligent summarization of news articles.
- 📚 News API Integration for real-time retrieval of AI-related articles.
- 🌐 Interactive Frontend with a masonry grid layout, 3D hover effects, and a futuristic design using React, Radix UI, and Tailwind CSS.
- ⚡ Multi-Agent Orchestration with LangGraph for structured workflows managing news fetching and summarization.
🔹 👨💻 Multi-Agent Orchestration with LangGraph for efficient workflow management.
🔹 🔍 AI-Driven Summarization using LLMs to generate concise, accurate article summaries.
🔹 ⚡ Modern Frontend Design with React, Framer Motion animations, and responsive layouts.
🔹 🔒 Scalable Backend with FastAPI, MCP, and robust exception handling for production readiness.
📂 For learners: Refer to backend/main.py and frontend/src/App.jsx for detailed code comments explaining the agentic workflow and frontend design! 🎯
Flowchart: The system retrieves AI news via the News API, processes articles through a LangGraph workflow (fetch → summarize), and displays summarized content in a dynamic React frontend with a masonry grid layout.
- 🤖 Multi-Agent Architecture: Specialized agents for fetching news and summarizing articles, orchestrated by LangGraph.
- 📚 Real-Time News Retrieval: Integrates with News API to fetch the top 10 AI-related articles.
- 🧠 AI-Powered Summarization: Uses Ollama Llama 3.2 3B with a Camel AI fallback to generate 2-3 sentence summaries.
- 💻 Interactive Masonry Grid: Displays articles in a responsive masonry grid with 3D hover effects, source filtering, and fade-in animations, enhanced by a particle background.
- ⏳ Engaging Loading Animation: Custom SVG spinner with concentric rotating paths, centered on a blurred background with "Updating Latest AI News...".
- 🔄 Manual Refresh: Refresh button to re-fetch news, disabled during loading to prevent redundant calls.
- ⚔️ Robust Error Handling: Manages API failures, empty content, and summarization errors with graceful fallbacks.
- 🌐 CORS Support: FastAPI middleware ensures seamless frontend-backend communication.
- 📜 Minimal Logging: Backend logs only warnings by default, with a
--verboseflag for detailed debugging.
Note
Upcoming features:
- Real-time web search integration for broader news sources.
- User-customizable news categories and summary lengths.
- Voice-based interaction for news queries.
- Open to suggestions and contributions.
| Component | Technologies |
|---|---|
| 🔹 Backend Framework | FastAPI, MCP |
| 🔹 Agent Orchestration | LangGraph, LangChain |
| 🔹 Summarization | Ollama (Llama 3.2 3B), Camel AI |
| 🔹 News Retrieval | News API (via requests) |
| 🔹 Frontend | React, Radix UI, Tailwind CSS, Framer Motion, react-masonry-css |
| 🔹 Typography | Google Fonts (Orbitron) |
| 🔹 Deployment | Vite (frontend), Uvicorn (backend), Docker |
Backend Dependencies (from requirements.txt):
fastapi==0.115.12,mcp==1.9.0,fastmcp==2.3.4langgraph==0.3.34,langchain-core==0.3.56ollama==0.4.8,camel-ai==0.2.59requests==2.32.3,python-dotenv==1.1.0- Full list in
backend/requirements.txt.
Frontend Dependencies (from package.json):
react==18.2.0,react-dom==18.2.0@radix-ui/themes==3.1.3,framer-motion==12.12.1axios==1.7.7,tailwindcss==3.4.10,react-masonry-css- Full list in
frontend/package.json.
- Docker installed
- News API key from newsapi.org
- Ollama running separately for LLM support
git clone https://github.com/TyrelM10/ai-news-agent.git
cd ai-news-agentCreate a .env file in backend/:
NEWS_API_KEY=your_news_api_key_hereWarning
Ensure the API key is valid and has no trailing whitespace.
Run Ollama in a separate terminal or as a service:
ollama serve
ollama pull llama3.2:3bVerify:
ollama listEnsure llama3.2:3b is listed.
docker build -t ai-news-agent .docker run -d --name ai-news-agent -p 8000:8000 -p 5173:5173 --env-file backend/.env ai-news-agent- Backend: http://127.0.0.1:8000
- Frontend: http://localhost:5173
docker stop ai-news-agentdocker start ai-news-agentdocker logs ai-news-agentdocker rm ai-news-agentdocker inspect --format='{{.State.Health.Status}}' ai-news-agentCheck logs for errors:
docker logs ai-news-agentEnsure Ollama is running and the News API key is valid.
- Python 3.11+
- Node.js 18+, npm 9+
- Ollama for local LLM support
- News API key from newsapi.org
git clone https://github.com/TyrelM10/ai-news-agent.git
cd ai-news-agentpython -m venv venv
source venv/bin/activate # Mac/Linux
venv\Scripts\activate # Windowscd backend
pip install -r requirements.txtCreate backend/.env:
NEWS_API_KEY=your_news_api_key_herepython main.pyBackend available at: http://127.0.0.1:8000
Note
Use python main.py --verbose for detailed logging during debugging.
cd ../frontendnpm installnpm run devFrontend available at: http://localhost:5173
Follow instructions at ollama.ai.
ollama serveollama pull llama3.2:3bollama listEnsure llama3.2:3b is listed.
Note
- The first run may take time as Ollama downloads the Llama 3.2 3B model.
- Ensure Ollama and the backend are running before starting the frontend.
- Check browser console (F12) for frontend errors and backend terminal for warnings.
- Open http://localhost:5173 to view AI news.
- Observe the SVG spinner with a blurred background during loading.
- Browse articles in a responsive masonry grid with 3D hover effects and fade-in animations.
- Filter articles by source using the filter bar at the top.
- Click Refresh News to fetch updated articles (disabled during loading).
- Click Read More to visit original article sources.
Contributions are welcome! Check the issues tab for feature requests and improvements.
To contribute:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/YourFeature). - Commit changes (
git commit -m 'Add YourFeature'). - Push to the branch (
git push origin feature/YourFeature). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or collaboration inquiries, reach out to Tyrel Menezes on:
🔗 LinkedIn: https://www.linkedin.com/in/tyrel-menezes
🔗 GitHub: https://github.com/TyrelM10