Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4703270
Add a web search tool on the new huggingface tool
KunjShah95 Oct 18, 2025
4e1d3a5
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Oct 19, 2025
0fe81cc
feat: Add Exa MCP web search provider and update configuration
KunjShah95 Oct 19, 2025
95e63d9
feat: Implement Exa MCP web search provider and update configuration
KunjShah95 Oct 19, 2025
e1a565e
Merge branch 'KunjShah95/issue1940' of https://github.com/KunjShah95/…
KunjShah95 Oct 19, 2025
7b81606
Merge branch 'huggingface:main' into KunjShah95/issue1940
KunjShah95 Oct 19, 2025
1d5b9c4
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Oct 20, 2025
e54f855
feat: Update .gitignore to exclude .env files and add .env.example
KunjShah95 Oct 20, 2025
1058fdc
Merge branch 'KunjShah95/issue1940' of https://github.com/KunjShah95/…
KunjShah95 Oct 20, 2025
157a1d2
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Oct 20, 2025
8df9c8a
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Oct 20, 2025
cbf0649
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Oct 20, 2025
e421c4a
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Oct 24, 2025
e327a53
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Oct 28, 2025
7e46752
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Oct 29, 2025
8346cab
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Oct 29, 2025
1f8604d
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Nov 5, 2025
c2d648f
Merge branch 'main' into KunjShah95/issue1940
KunjShah95 Nov 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,27 @@ OPENID_PROVIDER_URL=https://huggingface.co # for Google, use https://accounts.go
OPENID_TOLERANCE=
OPENID_RESOURCE=
EXPOSE_API=# deprecated, API is now always exposed

### Web Search API Keys ###
# Google Custom Search (Recommended)
GOOGLE_SEARCH_API_KEY=#your Google Custom Search API key
GOOGLE_SEARCH_ENGINE_ID=#your Google Search Engine ID

# Exa MCP (AI-Powered Neural Search via Smithery) - NEW!
EXA_API_KEY=#your Exa API key from https://exa.ai or https://smithery.ai/server/exa
# Optional: Custom MCP endpoint (defaults to https://mcp.exa.ai/mcp)
# EXA_MCP_ENDPOINT=https://mcp.exa.ai/mcp

# Bing Search API
BING_SEARCH_API_KEY=your_bing_key_here

# SerpAPI (Good for development)
SERPAPI_API_KEY=your_serpapi_key_here

# Brave Search API
BRAVE_SEARCH_API_KEY=#your Brave Search API key

# You.com Search API
YOUCOM_API_KEY=#your You.com API key

# DuckDuckGo - Free, no API key required (automatically enabled)
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ node_modules
/build
/.svelte-kit
/package
.env
.env.*
.env.example
.env.local
!.env.ci
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
SECRET_CONFIG
.idea
!.env.ci
!.env
gcp-*.json
db
models/*
Expand Down
77 changes: 74 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ A chat interface for LLMs. It is a SvelteKit app and it powers the [HuggingChat
0. [Quickstart](#quickstart)
1. [Database Options](#database-options)
2. [Launch](#launch)
3. [Optional Docker Image](#optional-docker-image)
4. [Extra parameters](#extra-parameters)
5. [Building](#building)
3. [Web Search](#web-search)
4. [Optional Docker Image](#optional-docker-image)
5. [Extra parameters](#extra-parameters)
6. [Building](#building)

> [!NOTE]
> Chat UI only supports OpenAI-compatible APIs via `OPENAI_BASE_URL` and the `/models` endpoint. Provider-specific integrations (legacy `MODELS` env var, GGUF discovery, embeddings, web-search helpers, etc.) are removed, but any service that speaks the OpenAI protocol (llama.cpp server, Ollama, OpenRouter, etc. will work by default).
Expand Down Expand Up @@ -89,6 +90,76 @@ npm run dev

The dev server listens on `http://localhost:5173` by default. Use `npm run build` / `npm run preview` for production builds.

## Web Search

Chat UI includes a powerful web search feature with support for **7 search providers** including **Exa MCP (Model Context Protocol)** integration via Smithery.

### Quick Setup

Add at least one search provider API key to your `.env.local`:

```env
# Exa MCP (AI-Powered Neural Search - Recommended!)
EXA_API_KEY=your_exa_api_key

# Google Custom Search (Also Recommended)
GOOGLE_SEARCH_API_KEY=your_google_api_key
GOOGLE_SEARCH_ENGINE_ID=your_search_engine_id

# Other providers (optional)
BING_SEARCH_API_KEY=your_bing_key
SERPAPI_API_KEY=your_serpapi_key
BRAVE_SEARCH_API_KEY=your_brave_key
YOUCOM_API_KEY=your_youcom_key
# DuckDuckGo is free and enabled by default
```

### Supported Providers

1. **Google Custom Search** - Most reliable, good results
2. **Exa MCP (Smithery)** - 🆕 AI-powered neural search with MCP support
3. **Bing Search API** - Microsoft's search
4. **SerpAPI** - Easy setup, good for development
5. **DuckDuckGo** - Free, no API key required
6. **Brave Search** - Privacy-focused
7. **You.com** - AI-powered search

### Features

- ✅ **Intelligent Fallback**: Automatically tries providers in priority order
- ✅ **Rate Limiting**: Per-minute and daily limits for each provider
- ✅ **Analytics**: Real-time monitoring and health reports
- ✅ **MCP Integration**: Full Model Context Protocol support via Exa
- ✅ **Customizable Patterns**: 12+ detection patterns
- ✅ **Mock Data**: Works even without API keys for testing

### Usage

Simply include web search triggers in your messages:

```
🌐 using web search what is quantum computing?
web search latest AI news
search the web for blockchain information
```

### Documentation

- 📘 **[WEB_SEARCH_SETUP.md](./WEB_SEARCH_SETUP.md)** - Complete setup guide for all providers
- 📗 **[WEB_SEARCH_COMPLETE.md](./WEB_SEARCH_COMPLETE.md)** - Implementation details and features
- 🆕 **[WEB_SEARCH_MCP_EXA.md](./WEB_SEARCH_MCP_EXA.md)** - Exa MCP integration guide

### Exa MCP (New!)

Exa MCP provides AI-powered neural search with:

- 🧠 **Neural Search**: AI understanding of query intent and context
- 🎯 **High-Quality Results**: Fresh, relevant content from trusted sources
- 💻 **Code Context**: Specialized search for programming queries
- 🔌 **MCP Support**: Full Model Context Protocol integration

Get your Exa API key from [exa.ai](https://exa.ai) or [Smithery](https://smithery.ai/server/exa).

## Optional Docker Image

Prefer containerized setup? You can run everything in one container as long as you supply a MongoDB URI (local or hosted):
Expand Down
Loading