Rust AI-powered Distributed SEARCH - An enterprise-grade MCP web search server with semantic caching and RAG integration.
- 🔍 Multiple Search Providers - DuckDuckGo, Brave Search, Synthetic Search with automatic failover
- ⚡ Weighted Round-Robin - Intelligent load distribution across providers
- 🧠 Semantic Caching - RAG-style similarity search on cached results using embeddings
- 🔄 Circuit Breakers - Enterprise resilience with automatic provider health tracking
- 📊 Self-Diagnosing Observability - MCP tools for health, stats, and cache management
- 🔒 Security First - SSRF protection, prompt injection detection, secure key handling
git clone https://github.com/TheArchitectit/RAD-SEARCH.git
cd RAD-SEARCH
cargo build --releaseAdd to your MCP client config (e.g., Claude Desktop config.json):
{
"mcpServers": {
"rad-search": {
"command": "/path/to/rad-search/target/release/rad-search",
"env": {
"RUST_LOG": "info"
}
}
}
}| Tool | Description |
|---|---|
web_search |
Search the web with automatic provider fallback |
search_similar |
Find semantically similar cached results (RAG) |
search_news |
News-focused search with freshness filters |
search_cached |
Cache-only search (no external API calls) |
get_cache_stats |
Cache hit rate, size, and health |
cache_clear |
Clear cache entries |
cache_migrate |
Run schema migrations |
get_provider_status |
Provider health and circuit breaker state |
get_server_stats |
Server metrics (latency, throughput) |
RAD-SEARCH uses hexagonal architecture (ports and adapters) for clean separation:
src/
├── domain/ # Core business logic (no external dependencies)
├── application/ # Use case orchestration
├── ports/ # Trait definitions (interfaces)
├── adapters/ # External integrations
│ ├── mcp/ # MCP protocol and tools
│ ├── providers/ # Search provider implementations
│ ├── cache/ # SQLite/PostgreSQL backends
│ ├── embeddings/ # Ollama/OpenAI embeddings
│ └── circuit_breaker/
└── infrastructure/ # Cross-cutting concerns
| Variable | Description | Default |
|---|---|---|
RUST_LOG |
Log level | info |
RAD_SEARCH_CACHE_PATH |
Cache database path | ./cache.db |
RAD_SEARCH_OLLAMA_ENDPOINT |
Ollama API endpoint | http://localhost:11434 |
Ollama (default):
{
"embedding_provider": "ollama",
"embedding_model": "nomic-embed-text"
}OpenAI:
{
"embedding_provider": "openai",
"embedding_model": "text-embedding-3-small",
"openai_api_key": "sk-..."
}| Metric | Target |
|---|---|
| p99 latency (cache hit) | < 10ms |
| p99 latency (cache miss) | < 500ms |
| Memory (resident) | < 256MB |
| Cache hit ratio | > 60% |
# Run tests
cargo test
# Run with debug logging
RUST_LOG=debug cargo run
# Lint
cargo clippy -- -D warnings
# Format
cargo fmtBSD 3-Clause License - see LICENSE for details.
Contributions are welcome! Please read the documentation before making changes:
- docs/IMPLEMENTATION_PLAN.md - Architecture and sprint phases
- docs/SECURITY_REVIEW.md - Security considerations
- docs/AGENT_GUARDRAILS.md - Agent safety protocols
Help keep this project going — use a referral link below and both of us get credits!
| Service | Your Bonus | Details | Referral Code |
|---|---|---|---|
| Neuralwatt | $10 in credits | Spend $10+ → you get $10, we get $20 | NW-ROGER-ET3Y |
| Synthetic | $10 in credits | Subscribe → both get $10 credit | UAWqkKQQLFkzMkY |