From 85d1481bd9b07c6973c169123c910eeba2f77505 Mon Sep 17 00:00:00 2001 From: Tyler <1+tyss-dev@noreply.git.tysstech.com> Date: Sun, 17 May 2026 19:45:37 -0400 Subject: [PATCH 1/7] Updated README --- README.md | 56 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 043272b..ef63d4f 100644 --- a/README.md +++ b/README.md @@ -10,44 +10,50 @@ A SearXNG plugin that generates local AI overviews powered by Ollama, using search results as RAG context. -Features: -- Token-by-token UI streaming -- Clickable inline citations -- Interactive mode: continue summary, ask follow-ups, copy, or regenerate -- Simple response mode with no extras -- Internally called low-latency RAG for follow-ups (bypasses HTTP loopback) -- Native network integration via `searx.network` (respects proxy/SSL settings) -- Stateless conversation persistence/shareability via URL hash -- Model selector in the AI overview widget -- Does not slow down result loading -- One file install -- Real-time streaming via Valkey — responses stream token by token using a background thread + Valkey job queue, working around granian's broken generator support for true streaming feel -- TF-IDF result reranking — fetched page content is scored against the query using BM25-style TF-IDF before being sent to Ollama, surfacing the most relevant sources first -- Smart chunking — pages are split into 512-token overlapping segments and the highest-scoring chunk per page is selected for context -- Intent detection — queries are automatically classified into 8 intent types (factual, howto, technical, comparison, opinion, current, local, general) with tailored system prompts per type -- Conversation memory — 30-minute cross-search conversation history stored in Valkey, so follow-up questions work even after navigating to a new search -- Markdown rendering — AI responses render bold, italic, lists, headers, and inline code natively in the result box -- Intent emoji badge — a small emoji appears next to "AI Overview" indicating the detected query type +## Features: + +- Inline numbered citations +- Interactive mode - Continue summary, ask follow-ups, copy, or regenerate +- Overview of ranked results with prompts based on detected query intent: + - `How To` `Technical` `Factual` `Comparison` `Opinion` `Current` `Local` `Geneal, General +- Internally called RAG for follow-ups +- Native network integration via `searx.network` +- Stateless conversation presistence/shareability via URL hash +- Ollama model selector +- Feeds fetched results to Ollama without slowing down SearXNG results +- Real-time streaming via Valkey (No waiting for a completed response) +- TF-IDF result ranking before being sent to Ollama +- Smart chunking - Pages are split into 512-token segments and highest-scoring chunk per page used for context +- Conversation memory - 30-minute cross-search conversation history via Valkey for follow-up questions +- Markdown support +- Intent emoji badge showing what intent prompt was used ## Install 1. Download the plugin: + + ### Main repo (Gitea) ```bash - curl -o ollama_answers.py https://raw.githubusercontent.com/TySP-Dev/ollama-ai-answers-searxng/master/ollama_answers.py + curl -o ollama_answers.py https://git.tysstech.com/TySS-Dev/ollama-ai-answers-searxng/raw/branch/main/ollama_answers.py ``` -2. Copy to your SearXNG plugins directory: + ### Mirror repo (Github): ```bash - cp ollama_answers.py ~/searxng/plugins/ollama_answers.py + curl -o ollama_answers.py https://raw.githubusercontent.com/TySP-Dev/ollama-ai-answers-searxng/main/ollama_answers.py ``` -3. Add the volume mount to your `docker-compose.yml` under the searxng service: +3. Copy to your SearXNG plugins directory: + ```bash + cp ollama_answers.py path_to/searxng/plugins/ollama_answers.py + ``` + +4. Add the volume mount to your `docker-compose.yml` under the searxng service: ```yaml volumes: - ./plugins/ollama_answers.py:/usr/local/searxng/searx/plugins/ollama_answers.py:Z ``` -4. Add environment variables to `docker-compose.yml`: +5. Add environment variables to `docker-compose.yml`: ```yaml environment: - LLM_URL=http://ollama:11434/v1/chat/completions @@ -55,14 +61,14 @@ Features: - VALKEY_HOST=searxng-valkey ``` -5. Add to `settings.yml` plugins section: +6. Add to `settings.yml` plugins section: ```yaml plugins: searx.plugins.ollama_answers.SXNGPlugin: active: true ``` -6. Restart SearXNG: +7. Restart SearXNG: ```bash docker compose up -d --force-recreate core ``` From 3dffeb384bc16f057223a2c55e64cf7c036ade8a Mon Sep 17 00:00:00 2001 From: Tyler <1+tyss-dev@noreply.git.tysstech.com> Date: Sun, 17 May 2026 19:46:04 -0400 Subject: [PATCH 2/7] Fixed a typo in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef63d4f..cb8db07 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ A SearXNG plugin that generates local AI overviews powered by Ollama, using sear - Inline numbered citations - Interactive mode - Continue summary, ask follow-ups, copy, or regenerate - Overview of ranked results with prompts based on detected query intent: - - `How To` `Technical` `Factual` `Comparison` `Opinion` `Current` `Local` `Geneal, General + - `How To` `Technical` `Factual` `Comparison` `Opinion` `Current` `Local` `Geneal` - Internally called RAG for follow-ups - Native network integration via `searx.network` - Stateless conversation presistence/shareability via URL hash From ffad0de8ae242d31753db2fd4dd5c0e5b37d15a5 Mon Sep 17 00:00:00 2001 From: Tyler <1+tyss-dev@noreply.git.tysstech.com> Date: Sun, 17 May 2026 19:51:19 -0400 Subject: [PATCH 3/7] Fixed flow diagram --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cb8db07..e271278 100644 --- a/README.md +++ b/README.md @@ -111,35 +111,35 @@ Configure via environment variables. └────────────────┬────────────────────────────────────┘ │ ┌────────────────▼────────────────────────────────────┐ -│ SearXNG + Plugin │ -│ │ -│ post_search() │ +│ SearXNG + Plugin │ +│ │ +│ post_search() │ │ → _enrich_results() ← ThreadPoolExecutor │ │ → _fetch_page_text() × 5 parallel │ │ → _chunk_text() + _tfidf_score() │ │ → rerank by score │ │ → _assemble_context() │ │ → inject AI Overview HTML + JS │ -│ │ -│ /ai-stream │ -│ → validate token │ +│ │ +│ /ai-stream │ +│ → validate token │ │ → _detect_intent() → select system prompt │ │ → _load_conversation() from Valkey │ │ → launch stream_to_valkey() thread │ │ → return {job_id} immediately │ -│ │ +│ │ │ stream_to_valkey() [background thread] │ │ → Ollama stream=True │ │ → RPUSH tokens to Valkey │ │ → RPUSH __DONE__ when complete │ -│ │ +│ │ │ /ai-status/{job_id} │ │ → LRANGE chunks from offset │ │ → return {chunks, done} │ └────────────────┬────────────────────────────────────┘ │ ┌────────────────▼────────────────────────────────────┐ -│ Valkey │ +│ Valkey │ │ ai:job:{id}:chunks (list, TTL 120s) │ │ ai:job:{id}:status (string, TTL 120s) │ │ ai:conv:{session} (JSON, TTL 1800s) │ From 5e2b2a246f2bbf8275f464831a2013bf2af0a514 Mon Sep 17 00:00:00 2001 From: Tyler <1+tyss-dev@noreply.git.tysstech.com> Date: Sun, 17 May 2026 19:59:55 -0400 Subject: [PATCH 4/7] Added known issues and roadmap --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index e271278..396e349 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,16 @@ Configure via environment variables. 6. Client-side script calls a signed endpoint (`/ai-stream`) 7. Ollama streams a response token-by-token in the UI +## Known Issues + +[ ] When asking a follow up question the previous output disappear + +For any issues not stated here please create an issue ticket on [Gitea](https://git.tysstech.com/TySS-Dev/ollama-ai-answers-searxng/issues) or [GitHub](https://github.com/TySP-Dev/ollama-ai-answers-searxng/issues) and add the `bug` tag. + +## Roadmap + +[ ] Working on feature plans + ## Architecture ``` From a7c031d27b492fc095f3c2a38546d77720cc26e6 Mon Sep 17 00:00:00 2001 From: Tyler <1+tyss-dev@noreply.git.tysstech.com> Date: Sun, 17 May 2026 20:00:56 -0400 Subject: [PATCH 5/7] Fixed check boxes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 396e349..2c5a712 100644 --- a/README.md +++ b/README.md @@ -104,13 +104,13 @@ Configure via environment variables. ## Known Issues -[ ] When asking a follow up question the previous output disappear +- [ ] When asking a follow up question the previous output disappear For any issues not stated here please create an issue ticket on [Gitea](https://git.tysstech.com/TySS-Dev/ollama-ai-answers-searxng/issues) or [GitHub](https://github.com/TySP-Dev/ollama-ai-answers-searxng/issues) and add the `bug` tag. ## Roadmap -[ ] Working on feature plans +- [ ] Working on feature plans ## Architecture From 1c3824b7a4a6d149f45a26e0da0e1eff1d532585 Mon Sep 17 00:00:00 2001 From: Tyler <1+tyss-dev@noreply.git.tysstech.com> Date: Sun, 17 May 2026 20:01:43 -0400 Subject: [PATCH 6/7] Fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c5a712..b9a98b3 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Configure via environment variables. ## Known Issues -- [ ] When asking a follow up question the previous output disappear +- [ ] When asking a follow up question the previous output disappears For any issues not stated here please create an issue ticket on [Gitea](https://git.tysstech.com/TySS-Dev/ollama-ai-answers-searxng/issues) or [GitHub](https://github.com/TySP-Dev/ollama-ai-answers-searxng/issues) and add the `bug` tag. From eeac7fcd88d91cb6f7a60a4435b18bf6f7f1e11b Mon Sep 17 00:00:00 2001 From: Tyler <1+tyss-dev@noreply.git.tysstech.com> Date: Sun, 17 May 2026 20:13:19 -0400 Subject: [PATCH 7/7] Added more known issues --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b9a98b3..1f7fd14 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,8 @@ Configure via environment variables. ## Known Issues - [ ] When asking a follow up question the previous output disappears +- [ ] Parts of the UI are not theme aware resulting in a unpolished look when not using a dark theme +- [ ] When SearXNG provides a info blob for a search it appears on top of the overview i.e. `Wikipedia` or `Linux` For any issues not stated here please create an issue ticket on [Gitea](https://git.tysstech.com/TySS-Dev/ollama-ai-answers-searxng/issues) or [GitHub](https://github.com/TySP-Dev/ollama-ai-answers-searxng/issues) and add the `bug` tag.