Intelligent search agent that uses DuckDuckGo to find relevant content by specific category and presents the 5 best results curated by Gemini LLM. Interactive command-line interface with 10 specialized categories.
- ๐๏ธ 10 Specialized Categories: Scientific articles, news, tech blogs, videos, education, documentation, corporate, forums, data and general search
- ๐ Intelligent Search: Automated DuckDuckGo search with category-specific filters
- ๐ค AI Curation: Analysis and refinement of results using Gemini
- ๐ Relevance System: Proprietary algorithm with category-specific bonus
- ๐ป CLI Interface: Easy and intuitive terminal interaction
- โก Optimized Results: Top 5 most relevant results for each query
- ๐ English Content: Searches prioritized for English content
- ๐ Continuous Session: Conversation history maintained during session
ID | Category | Description | Filters Include |
---|---|---|---|
1 | ๐ Scientific Articles | Academic papers, research studies, scientific publications | Scholar, PubMed, ArXiv, ResearchGate, IEEE |
2 | ๐ฐ News | Latest news, headlines, current reports | BBC, CNN, Reuters, NPR, AP News |
3 | ๐ป Technical Articles/Blogs | Tutorials, tech blogs, technical guides | Medium, Dev.to, StackOverflow, GitHub Pages |
4 | ๐ฅ Videos | Video content, courses, lectures | YouTube, Vimeo, Twitch |
5 | ๐ Educational Content | Courses, MOOCs, educational materials | Coursera, edX, Khan Academy, Udemy, Pluralsight |
6 | ๐ Official Documentation | Official docs, manuals, technical references | Official documentation sites, APIs |
7 | ๐ข Corporate Content | White papers, case studies, business reports | Reports, case studies, corporate research |
8 | ๐ Forums & Communities | Discussions, Q&A, online communities | Reddit, StackOverflow, Quora, Hacker News |
9 | ๐ Data & Statistics | Datasets, statistics, data analysis | Kaggle, Data.gov, CSV/JSON files |
10 | ๐ General Search | Broad search without specific filters | All types of content |
# Clone the repository
git clone <your-repository>
cd agents
# Install dependencies
uv sync
# Configure environment variable
export GEMINI_API_KEY=your_api_key_here
# Run the agent
uv run python agents/search_agent/agent.py
# Clone the repository
git clone <your-repository>
cd agents
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
# Install dependencies
pip install agno ddgs google-genai python-dotenv
# Configure environment variable
export GEMINI_API_KEY=your_api_key_here
# Run the agent
python agents/search_agent/agent.py
- Visit Google AI Studio
- Create an account or sign in
- Generate a new API Key
- Configure the environment variable:
# Linux/Mac
export GEMINI_API_KEY=your_api_key_here
# Windows
set GEMINI_API_KEY=your_api_key_here
uv run python agents/search_agent/agent.py
๐ DuckDuckGo Search Agent with Gemini - Categorized
=================================================================
๐ฏ Search specific content by category!
โ
Agent initialized successfully!
------------------------------------------------------------
๐ Show available categories? (y/n): y
๐๏ธ AVAILABLE CONTENT CATEGORIES:
============================================================
1. ๐ Scientific Articles
Academic papers, research studies, scientific publications
2. ๐ฐ News
Latest news, headlines, current reports
[... other categories ...]
๐ฏ Choose category (1-10) or press Enter for general search: 3
โ
Selected category: ๐ป Technical Articles/Blogs
๐ Tutorials, tech blogs, technical guides
๐ฌ Enter your search query (or 'exit' to quit): React hooks tutorial
๐ Searching: React hooks tutorial
๐ Searching in: ๐ป Technical Articles/Blogs
๐ Query: (React hooks tutorial) AND (site:medium.com OR site:dev.to OR site:stackoverflow.com OR site:github.io OR site:hashnode.com OR site:towardsdatascience.com OR tutorial OR guide OR how-to OR blog OR technical)...
โณ Please wait, processing...
======================================================================
๐ SEARCH RESULTS:
======================================================================
[Curated response by Gemini with the 5 best results]
- Categories: Type
y
to see all categories - Selection: Choose 1-10 or press Enter for general search
- Search: Type any term or question
- Exit: Type
exit
,quit
,q
or press Enter when empty - Interrupt: Press
Ctrl+C
at any time
Category: 1
Search: "machine learning deep learning"
Result: Papers from ArXiv, Google Scholar, PubMed
Category: 2
Search: "artificial intelligence 2024"
Result: News from BBC, CNN, Reuters
Category: 3
Search: "React performance optimization"
Result: Tutorials from Medium, Dev.to, tech blogs
Category: 4
Search: "Python for beginners"
Result: Videos from YouTube, Vimeo, online courses
Category: 5
Search: "data science course"
Result: Courses from Coursera, Udemy, edX
- ๐๏ธ Category System: 10 categories with specific filters
- ๐ DuckDuckGo Search: Search engine with advanced filters
- ๐ค Google Gemini: LLM for content analysis and curation
- โก Agno Framework: Agent and tool orchestration
- ๐ Relevance System: Algorithm with category-specific bonus
- Category Selection: User chooses from 10 available categories
- User Input: Receives query via terminal
- Filter Application: Combines query with category-specific filters
- Categorized Search: DuckDuckGo returns up to 15 filtered results
- Relevance Calculation: Scoring with bonus for specific categories
- Top 5 Selection: Ordering by relevance
- AI Curation: Gemini analyzes and synthesizes categorized results
- Presentation: Formatted result displayed in terminal
Each category applies specific filters in the search:
- Site-specific:
site:medium.com OR site:github.io
- File types:
filetype:pdf research OR paper
- Keywords:
tutorial OR guide OR how-to
- Combinations:
(query) AND (category filters)
# Search region (default: us-en)
export SEARCH_REGION=us-en
# Maximum initial results (default: 15)
export MAX_SEARCH_RESULTS=15
# Gemini model (default: gemini-2.0-flash-exp)
export GEMINI_MODEL=gemini-2.0-flash-exp
Edit agents/search_agent/agent.py
in the CONTENT_CATEGORIES
dictionary to:
- Add new categories
- Modify existing filters
- Adjust descriptions
- Customize priorities
"11": {
"name": "๐ฎ Gaming",
"description": "Games, reviews, gameplay, gaming news",
"filters": [
"site:ign.com OR site:gamespot.com OR site:polygon.com",
"game OR gaming OR review OR gameplay",
"steam OR playstation OR xbox"
]
}
agents/
โโโ search_agent/
โ โโโ __init__.py
โ โโโ agent.py # โญ Implementation with categories
โโโ README.md # ๐ Complete documentation
โโโ pyproject.toml # ๐ฆ Dependencies
โโโ uv.lock # ๐ UV lock file
- agno: AI agent framework
- ddgs: DuckDuckGo Search API
- google-genai: Google Gemini API
- python-dotenv: Environment variable management
โ ๏ธ ERROR: Gemini API key is required
Solution: Configure the GEMINI_API_KEY
variable
โ Invalid option. Choose between 1 and 10.
Solution: Type a number between 1-10 or press Enter for general search
Cause: Very restrictive filters may limit results Solution: Use category "10 - General Search" or adjust filters
ModuleNotFoundError: No module named 'agno'
Solution: Run uv sync
or install dependencies manually
- Save search history by category
- Export results (JSON, CSV, Markdown)
- Custom filter configuration
- Support for multiple search APIs
- Optional web interface
- Favorites system by category
- Usage analytics by category
This project is under the MIT license. See the LICENSE file for details.
Contributions are welcome! Open an issue or send a pull request.
Developed with โค๏ธ using Agno Framework