Commit f0bf5ed
prune SurrealDB + bridges to OWUI native + Ollama embeddings
Operator directive 2026-05-18: "make sure this is all Ollama (and
other OpenSource Alternatives / Local Endpoints / Self-Hosted
Endpoints) and Open WebUI Native DB(s) for knowledge/memory/
context/scratch/skills/functions/tools/etc-etc". My initial
SurrealDB schema duplicated OWUI native tables (memory, knowledge,
doc) -- exactly the parallel-universe trap the operator was
flagging.
Three corrections:
1. schema-init.surql pruned. Dropped:
memory -> OWUI memory table (chat-bound recall, already used)
doc -> OWUI knowledge + file tables (RAG corpus via
mios-owui-apply-knowledge)
SurrealDB keeps ONLY what OWUI doesn't natively have:
agent registry of running AI surfaces
session agent sessions (cron / cli / delegate / mcp;
OWUI's chat table covers OWUI sessions and
we join via owui_chat_id)
tool_call cross-agent structured tool history (OWUI
stores text status emits; this stores typed
{tool, args, success, latency_ms} rows)
event observability stream (launch verifier hits,
refusals, critic verdicts, nudges, cdi changes)
kanban_shadow live mirror of hermes/kanban.db
scratch typed shared-mutable note surface
agent_metric time-series for tool latency / dispatch success
2. mios-db CLI extended with two NEW backend modes:
--owui '<SQL>' queries OWUI webui.db (SQLite via host
sqlite3 binary OR podman-exec python3
fallback with a CURSOR -- not the broken
Connection.description my first draft had).
Source of truth for: chat / message / memory /
knowledge / file / tool / function / model /
user / group / channel.
--embed '<text>' POSTs to Ollama /v1/embeddings (OpenAI-
compat shape; works for any local-endpoint
backend that speaks the spec). Default
model nomic-embed-text (768-dim), override
via --embed-model. Source of truth for
vectors.
No flag = SurrealDB (cross-cutting state only).
3. Quadlet Exec= path fixed: file://var/lib/... (relative, broken)
-> file:///var/lib/... (absolute, valid SurrealDB syntax).
SOUL.md "Shared DB" section rewritten as a 3-row table:
mios-db '<SurrealQL>' cross-cutting state
mios-db --owui '<SQL>' OWUI native (chat/memory/knowledge/...)
mios-db --embed '<text>' Ollama embeddings
with a "source of truth per kind" cheat sheet so the agent never
duplicates a query against the wrong backend.
Live verified on the dev distro (all four OWUI queries return
clean JSON):
memory rows: 0
knowledge collections: MiOS Documentation (32 files)
registered tools: openui, mios_verbs
function pipes: mios_agent (pipe), mios_antimeta
(filter), mios_sidecar (filter)
And --embed via nomic-embed-text:
model: nomic-embed-text
vector dim: 768
first 5 values: [-0.0068, -0.0013, -0.1714, 0.0085, 0.0058]
Day-0 / FHS / bootc: nothing new outside /usr/libexec/mios/ +
/usr/share/mios/surrealdb/. All three backends MIOS_* env-
overridable. Fresh clone + image build reproduces.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8bf2c98 commit f0bf5ed
4 files changed
Lines changed: 199 additions & 109 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 6 | + | |
| 7 | + | |
12 | 8 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
16 | 15 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
23 | 32 | | |
24 | 33 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
30 | 42 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 43 | + | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
| |||
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
42 | 56 | | |
43 | 57 | | |
44 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
45 | 62 | | |
46 | 63 | | |
47 | 64 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
52 | 72 | | |
53 | | - | |
| 73 | + | |
54 | 74 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
58 | 79 | | |
59 | 80 | | |
60 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
61 | 135 | | |
62 | 136 | | |
63 | 137 | | |
| |||
84 | 158 | | |
85 | 159 | | |
86 | 160 | | |
87 | | - | |
88 | 161 | | |
89 | 162 | | |
90 | 163 | | |
91 | 164 | | |
92 | 165 | | |
93 | | - | |
94 | | - | |
| 166 | + | |
95 | 167 | | |
96 | | - | |
97 | 168 | | |
98 | | - | |
| 169 | + | |
99 | 170 | | |
100 | 171 | | |
101 | 172 | | |
102 | 173 | | |
103 | 174 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
108 | 181 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
245 | 254 | | |
246 | 255 | | |
247 | 256 | | |
| |||
0 commit comments