add internet search: ?query escape + web_search tool (SearXNG)

This commit is contained in:
drjones
2026-09-18 18:11:55 -07:00
parent ff7ad69fa0
commit 52500cfdc2
2 changed files with 70 additions and 17 deletions

View File

@@ -1,18 +1,19 @@
# METATRON — lightweight Ollama terminal harness
A minimal terminal harness for talking to Ollama (hosted on nightmare `10.30.20.29:11434`)
with full system access. Type `metatron` to launch.
with full system access and internet search. Type `metatron` to launch.
## Flow
1. **Model selection** — fetches the live model list from nightmare, numbered menu.
2. **Chat** — streaming REPL against the selected model.
3. **System access** — two ways:
- `!command` — run a shell command directly (e.g. `!dir`, `!whoami`).
- The model calls `run_command` natively (function calling) to execute commands itself.
3. **System access** — `!command` runs a shell command directly, and the model can also
call `run_command` natively (function calling).
4. **Search** — `?query` searches the internet (SearXNG), and the model can call
`web_search` natively.
## Requirements
- Python 3.11 (stdlib only — `urllib`, `subprocess`, `json`). No pip deps.
- Network reach to `10.30.20.29:11434`.
- Network reach to `10.30.20.29:11434` and `10.30.20.35:6969`.
## Install (Commando VM)
```
@@ -22,13 +23,20 @@ setx PATH "%PATH%;C:\Tools\metatron"
```
Then `metatron` from any shell.
## Hardcoded
- Ollama URL: `http://10.30.20.29:11434`
- System prompt + `run_command` tool definition
- Only the model list is dynamic (fetched from `/api/tags`).
## Controls
| Input | Action |
|-------|--------|
| `exit` / `quit` | leave |
| `!<command>` | run a shell command directly |
| `?<query>` | search the internet (SearXNG) directly |
## Hardcoded
- Ollama URL: `http://10.30.20.29:11434`
- SearXNG URL: `http://10.30.20.35:6969` (self-hosted meta-search, CT 516)
- System prompt + `run_command` / `web_search` tool definitions
- Only the model list is dynamic (fetched from `/api/tags`).
## Search notes
- `?<query>` is the guaranteed path (no LLM needed).
- Native `web_search` tool-calling can degenerate on nightmare `.29`'s qwen3.8fast —
the `?` escape always works.