Overview
The Newsletter Generator is a powerful AI-powered application that researches, analyzes, and creates professional newsletters on any topic using Nebius AI, Agno, and Firecrawl. It leverages advanced AI models to deliver well-structured, up-to-date newsletters with the latest information from the web.
Features
Real-time Research
Web research using Firecrawl for latest articles and sources
AI Content Generation
Powered by Nebius AI (Llama-3.1-70B-Instruct)
Professional Formatting
Newsletter structure in markdown with proper formatting
Customizable Search
Configure number of articles and time range
Download Support
Export newsletters in markdown format
Example Topics
Quick-start with pre-built topic examples
How It Works
Topic Research
The agent uses Firecrawl to search for recent, authoritative articles and sources on your chosen topic.
Newsletter Generation
Synthesizes information into a well-structured newsletter using Nebius AI, following a professional template.
Prerequisites
Python 3.10+
Python 3.10 or higher required
Nebius AI API
Firecrawl API
Installation
Implementation
Newsletter Agent Configuration
The core of the newsletter generator is built using the Agno framework with specialized tools:Newsletter Generation Function
The main function that orchestrates the newsletter creation:Usage
Start the Application
Choose a Topic
Enter a topic or select from example topics:
- Latest developments in AI
- Cryptocurrency market trends
- Tech industry news
- Climate change updates
Configure Parameters
Set search parameters:
- Number of articles (2-10)
- Time range (past day, week, month)
Newsletter Structure
The generated newsletters follow this professional structure:Newsletter Template
Newsletter Template
Technical Details
Architecture
UI Layer
Streamlit interface for user interactions
Agent Layer
Agno agent framework for workflow orchestration
Research Layer
Firecrawl for real-time web research
AI Layer
Nebius AI for content generation
Storage
The agent uses SQLite for persistent storage:Search Parameters
Customize the Firecrawl search behavior:| Parameter | Description | Default |
|---|---|---|
limit | Number of articles to search | 2 |
tbs | Time range (qdr:d=day, qdr:w=week, qdr:m=month) | “qdr:w” |
formats | Output formats | [“markdown”, “links”] |
The time-based search parameter
tbs uses Google search syntax:qdr:d- Past 24 hoursqdr:w- Past weekqdr:m- Past monthqdr:y- Past year
Project Structure
Example Workflow
Here’s what happens when you generate a newsletter:Best Practices
Topic Selection
Choose specific, focused topics for better results
Article Limit
Start with 5-7 articles for comprehensive coverage
Time Range
Use past week for trending topics, past month for analysis
Review Output
Always review generated content before publishing
Troubleshooting
API Key Errors
API Key Errors
Ensure both
FIRECRAWL_API_KEY and NEBIUS_API_KEY are correctly set in your .env file.No Articles Found
No Articles Found
Try adjusting the time range or broadening your topic. Check your Firecrawl API key validity.
Generation Timeout
Generation Timeout
Reduce the number of articles or check your internet connection.
Database Errors
Database Errors
Ensure the
tmp/ directory exists and has write permissions.Next Steps
Agno Framework
Learn more about Agno’s capabilities
Firecrawl API
Explore Firecrawl documentation
Nebius AI
Discover Nebius AI models
Advanced Features
Add custom templates and styling