A full, working setup to run SearXNG with multiple AI-powered and enhancement plugins on Coolify, including:
- Building a custom SearXNG image (so you can ship your plugins + extra Python deps)
- Configuring OpenAI-like API (base URL + key)
- Enabling multiple useful plugins in settings.yml
- AI-powered summarization, quick answers, result enhancement, and smart suggestions
Requires: OpenAI API key
The main AI summarization plugin:
- LLM intelligently selects the most relevant URLs from search results
- Fetches and extracts clean content using advanced heuristics
- Generates comprehensive summaries with:
- 3-7 factual bullet points
- Suggested links with explanations
- Follow-up query suggestions
Usage: Add !!sum to your search query
best home assistant zigbee dongle !!sum
Requires: OpenAI API key
Get instant AI answers for simple queries without fetching external URLs:
- Faster than full summarization (no URL fetching)
- Perfect for definitions, quick facts, simple questions
- Concise answers under 3 paragraphs
Usage: Add !!ask to your search query
what is quantum computing !!ask
No API key needed
Automatically enhances search results with metadata:
- π Shows clean domain names
- π Identifies documentation
- π» Flags code repositories
- π₯ Marks video content
- π° Highlights news articles
- π Identifies academic papers
- β±οΈ Estimates reading time
Also filters out duplicate and low-quality results.
No API key needed
Provides intelligent search refinements:
- Query pattern suggestions (e.g., "how to" β "tutorial", "guide")
- Technical query enhancements (adds "tutorial", "documentation", "examples")
- Common terms from result titles
- Time-sensitive suggestions (adds current year for "latest" queries)
- Alternative suggestions for product searches
searxng-ai/
Dockerfile
settings.yml
searx_plugins/
ai_summarize_select_fetch.py # Main AI summarization
ai_quick_answer.py # Quick AI answers
result_enhancer.py # Result metadata
smart_suggestions.py # Smart refinements
tests/
test_ai_summarize_select_fetch.py
- Push this repo to GitHub
- Coolify β New Resource β Application β pick your repo
- In Build Pack, choose Dockerfile
- Expose port 8080
- Add a domain and enable TLS (normal Coolify routing)
If you prefer compose (e.g., to add Redis), create a docker-compose.yml and choose Docker Compose build pack in Coolify.
Configure these in Coolify β App β Environment Variables (mark OPENAI_API_KEY as secret):
OPENAI_API_KEY=sk-xxxxxxxx
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_MODEL=gpt-4o-miniAI Summarization Plugin:
# Trigger pattern for AI summary
SEARXNG_AI_TRIGGER=!!sum
# LLM selection and fetching limits
SEARXNG_AI_RESULTS_FOR_SELECTION=40 # snippets to consider
SEARXNG_AI_SELECT_K=12 # URLs LLM returns
SEARXNG_AI_FETCH_K=7 # URLs we actually fetch
# Timeouts and limits
SEARXNG_AI_FETCH_TIMEOUT=4.0
SEARXNG_AI_FETCH_MAX_BYTES=700000
SEARXNG_AI_EXTRACT_MAX_CHARS=9000
SEARXNG_AI_SELECT_TIMEOUT=7.0
SEARXNG_AI_SUMMARIZE_TIMEOUT=12.0
# User agent for fetching
SEARXNG_AI_UA=Mozilla/5.0 (compatible; SearXNG-AI/1.0)AI Quick Answer Plugin:
# Trigger pattern for quick answers
SEARXNG_AI_QUICK_TRIGGER=!!ask
# Timeout for quick answers
SEARXNG_AI_QUICK_TIMEOUT=5.0OPENAI_BASE_URL=https://your-gateway.example.com/v1
OPENAI_API_KEY=whatever-your-gateway-requiresIn the SearXNG search box, add !!sum to your query:
best home assistant zigbee dongle !!sum
You'll get:
- Normal search results (enhanced with metadata)
- An AI summary panel with:
- Key findings in bullet points
- Suggested links with explanations
- Follow-up query suggestions
For faster answers to simple queries, use !!ask:
what is machine learning !!ask
how does DNS work !!ask
You'll get:
- Normal search results (enhanced with metadata)
- A concise AI answer without fetching URLs
- Smart search suggestions
The Result Enhancer and Smart Suggestions plugins work automatically on every search:
- Results show content type icons (π docs, π» code, π₯ video, etc.)
- Reading time estimates for articles
- Duplicate results are filtered out
- Related search suggestions appear at the bottom
To keep things fast and stable:
- Keep it opt-in (
!!sumand!!ask) - don't LLM every search - Keep FETCH_K ~ 5-8 - fetching too many pages slows things down
- Keep timeouts tight (4s fetch, 12s summarize, 5s quick answer)
- Expect some sites to block bots - plugin will fall back to snippets
- Result Enhancer and Smart Suggestions are lightweight and can stay always-on
The AI plugins use SearXNG's official plugin hooks:
post_searchhook to process results after search completes- Inject
Answerobjects into the answer panel (SearXNG "answer result" type) - Fail gracefully if API key is missing or requests time out
- Runs on every search (minimal overhead)
- Analyzes URLs and content to classify results
- Removes exact duplicates and near-duplicate titles
- Adds visual indicators using emoji icons
- No external dependencies or API calls
- Analyzes query patterns to suggest refinements
- Extracts common terms from result titles
- Provides technical query enhancements
- Suggests time-sensitive additions (current year)
- No external dependencies or API calls
- httpx: Async HTTP client for fetching pages (AI summarization)
- trafilatura: Extract clean text from HTML pages (AI summarization)
- requests: For OpenAI API calls (AI plugins)
- Check if query contains trigger (default:
!!sum) - Send all result snippets to LLM to select best URLs
- Fetch and extract content from selected URLs (async, parallel)
- Use advanced content extraction with:
- HTML filtering (removes ads, nav, footers)
- Content density scoring
- NLP-based relevance ranking
- Send extracted content to LLM for summarization
- Display summary in SearXNG answer panel
- Check if query contains trigger (default:
!!ask) - Send query directly to LLM (no URL fetching)
- Get concise answer with max 500 tokens
- Display answer in SearXNG answer panel
- Run on every search automatically
- Detect and filter duplicate URLs and titles
- Classify content by analyzing URL patterns
- Add metadata and visual indicators
- Estimate reading time from content length
- Run on every search automatically
- Analyze query patterns for refinement opportunities
- Extract common terms from top result titles
- Generate related search suggestions
- Add suggestions to SearXNG suggestion panel
- All plugins fail closed (don't break search if API key missing)
- AI Summarization: Limited fetch size (700KB max per page)
- AI Summarization: Limited extract size (9000 chars max per page)
- All AI plugins: Tight timeouts to prevent hanging
- User agent identification for fetching
- No plugins execute arbitrary code or make unsafe operations
Plugins not appearing: Check that settings.yml has the plugins enabled and the paths match where they're copied in the Dockerfile.
No AI summary or quick answer: Verify OPENAI_API_KEY is set and the appropriate trigger (!!sum or !!ask) is in your query.
Slow responses with !!sum: Reduce SEARXNG_AI_FETCH_K or tighten timeouts.
Fetch blocked with !!sum: Some sites block bots. Plugin will fall back to search result snippets for summary.
Result enhancer not showing metadata: Check that the plugin is enabled in settings.yml and marked as active: true.
No smart suggestions: The plugin runs automatically. If you don't see suggestions, it may be that no relevant refinements were found for your query.
See LICENSE file in this repository.