Add SearXNG web search for current information

- Add searxng.py service for web queries via SearXNG API
- Integrate search into ai_chat.py with AI-driven search decisions
- AI determines if query needs current info, then searches automatically
- Add SEARXNG_URL, SEARXNG_ENABLED, SEARXNG_MAX_RESULTS config options
- Update documentation in README.md, CLAUDE.md, and .env.example
This commit is contained in:
2026-01-11 20:49:20 +01:00
parent c5c42c8701
commit 6a9b6fdda2
7 changed files with 225 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ A customizable Discord bot that responds to @mentions with AI-generated response
## Features
- **Multi-Provider AI**: Supports OpenAI, OpenRouter, Anthropic (Claude), and Google Gemini
- **Web Search**: Access current information via SearXNG integration
- **Fully Customizable**: Configure bot name, personality, and behavior
- **Conversation Memory**: Remembers context per user
- **Easy Deployment**: Docker support included
@@ -75,6 +76,16 @@ All configuration is done via environment variables in `.env`.
| `AI_TEMPERATURE` | `0.7` | Response creativity (0.0-2.0) |
| `MAX_CONVERSATION_HISTORY` | `20` | Messages to remember per user |
### Web Search (SearXNG)
| Variable | Default | Description |
|----------|---------|-------------|
| `SEARXNG_URL` | (none) | SearXNG instance URL |
| `SEARXNG_ENABLED` | `true` | Enable/disable web search |
| `SEARXNG_MAX_RESULTS` | `5` | Max search results to fetch |
When configured, the bot automatically searches the web for queries that need current information (news, weather, etc.).
### Example Configurations
**Friendly Assistant:**
@@ -143,7 +154,8 @@ src/daemon_boyfriend/
└── services/
├── ai_service.py # AI provider factory
├── providers/ # AI providers
── conversation.py # Chat history
── conversation.py # Chat history
└── searxng.py # Web search service
```
## License