by langgenius ยท v0.0.12
A free internet metasearch engine.
This community listing does not yet include every recommended support, privacy, pricing, and permission disclosure. Review the available package permissions before installing.
Available inside your emploidai workspace after installation.
Available inside your emploidai workspace after installation.
SearXNG is a free, open-source, and privacy-respecting metasearch engine that aggregates results from over 70 search services and databases. Unlike traditional search engines, SearXNG doesn't track users or build profiles, ensuring complete anonymity while delivering comprehensive search results.
This Dify plugin integrates SearXNG's powerful search capabilities directly into your Dify workflows, enabling you to:
Before installing and configuring the SearXNG plugin, ensure you have:
If installing manually, ensure all files are properly structured:
searxng/
โโโ main.py
โโโ manifest.yml
โโโ tools/
โ โโโ searxng_search.py
โโโ provider/
โ โโโ searxng.yaml
โโโ icon.svg
โโโ README.md
Create a dedicated directory for your SearXNG instance:
# Create and navigate to instance directory
mkdir my-searxng-instance && cd my-searxng-instance
# Set environment variables
export PORT=8081 # Using 8081 to avoid conflicts with other services
export INSTANCE_NAME="dify-searxng"
# Pull and run SearXNG container
docker pull searxng/searxng:latest
docker run --rm \
-d \
-p ${PORT}:8080 \
-v "${PWD}/searxng:/etc/searxng" \
-e "BASE_URL=http://localhost:${PORT}/" \
-e "INSTANCE_NAME=${INSTANCE_NAME}" \
--name searxng-dify \
searxng/searxng:latest
After the container starts, SearXNG will create a configuration directory. You need to modify the settings:
# Wait for configuration files to be created
sleep 10
# Edit the settings file
nano searxng/settings.yml
In the settings.yml file, ensure these configurations:
search:
formats:
- html
- json # This is crucial for API access
server:
limiter: false # Disable rate limiting for API usage
# Optional: Configure specific engines
engines:
- name: google
disabled: false
- name: bing
disabled: false
# ... other engines
# Restart the container to apply changes
docker restart searxng-dify
# Verify the service is running
curl "http://localhost:8081/search?q=test&format=json"
If you have access to an existing SearXNG deployment:
https://searx.example.com)curl "https://your-searx-instance.com/search?q=test&format=json"
http://host.docker.internal:8081https://your-searx-instance.comOnce configured, you can use SearXNG in your Dify workflows:
# Example of using SearXNG results in a workflow
search_results = searxng_tool.invoke({
"query": "artificial intelligence trends 2024",
"search_type": "news",
"time_range": "month"
})
# Process results
for result in search_results:
print(f"Title: {result['title']}")
print(f"URL: {result['url']}")
print(f"Content: {result['content'][:200]}...")
| Parameter | Type | Description | Example |
|---|---|---|---|
query | string | Search keywords or phrase | "machine learning python" |
| Parameter | Type | Default | Description | Options |
|---|---|---|---|---|
search_type | select | "general" | Type of content to search | general, images, videos, news, map, music, it, science, files, social_media |
time_range | select | null | Time period for results | day, week, month, year |
The plugin returns search results in JSON format:
[
{
"title": "Result Title",
"url": "https://example.com/page",
"content": "Brief description of the content...",
"engine": "google",
"score": 0.95,
"category": "general"
}
]
Problem: "SearXNG api is required" or connection timeout Solutions:
docker ps | grep searxnghost.docker.internal instead of localhostProblem: Results return HTML instead of JSON Solutions:
formats: [html, json] in settings.ymlcurl "http://localhost:8081/search?q=test&format=json"Problem: Requests are being rate-limited Solutions:
limiter: false in SearXNG configurationProblem: "No results found" message Solutions:
Check Service Status:
docker logs searxng-dify
Test API Directly:
curl -v "http://localhost:8081/search?q=test&format=json&categories=general"
Verify Configuration:
cat searxng/settings.yml | grep -A5 -B5 "formats\|limiter"
Network Connectivity:
ping host.docker.internal # For Docker Desktop
telnet localhost 8081 # Test port accessibility
# In settings.yml
server:
limiter: false
image_proxy: true
search:
safe_search: 0 # 0=off, 1=moderate, 2=strict
autocomplete: ""
default_lang: "en"
# Engine-specific optimizations
engines:
- name: google
timeout: 10.0
disabled: false
- name: bing
timeout: 8.0
disabled: false
We welcome contributions to improve the SearXNG plugin! Here's how you can help:
git clone https://github.com/your-username/searxng-dify-plugin.git
cd searxng-dify-plugin
uv sync
git checkout -b feature/your-feature-nameWhen reporting issues, please include:
This plugin is released under the Apache License 2.0. See the LICENSE file for details.
Maintainer: Junytang
Plugin Version: 0.0.5
Dify Compatibility: Community Edition & Cloud
Last Updated: May 2025