You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Getting AI knowledge base to actually answer questions on NOMAD + OpenWeb UI
#1658
I spent a weekend testing why my local AI kept giving wrong answers from my own documents, and found a few settings and writing habits that fixed it. Testing was done with Claude AI. Sharing in case it saves somebody the same weekend.
Setup for context: Project NOMAD running on a Dell Precision 3640 with a Quadro RTX 4000, 8 GB VRAM. Everything below is in NOMAD's built-in Open WebUI, using its knowledge bases, with gemma4:12b for chat and nomic-embed-text for embeddings.
1. Set Full Text Threshold to 0
Default is 50000 characters. Anything under that gets injected whole instead of retrieved. With one 11 KB file attached I was burning 4,880 input tokens per message out of an 8,192 window. It looked like retrieval was working. It wasn't, the whole file was just being pasted in. Add twenty more files and nothing fits.
Setting it to 0 forces real retrieval. You know it's working when citation markers like [1] show up in the answer.
2. Turn on Hybrid Search and Enrich Hybrid Search Text
Semantic search alone misses exact strings, and technical docs are full of them: ports, container names, file paths. Hybrid adds keyword matching. Enrich adds filenames and section headers to what gets searched.
3. Write every fact as a full sentence with the subject first
This was the biggest one. I asked what port a service runs on and got the wrong number, because my notes had a bare list:
8100 CyberChef
8310 Kolibri
It grabbed the neighbor. Rewritten as "Kolibri, the kids school software, runs on port 8310," it answered correctly every time.
No sentence should depend on the heading above it or the sentence before it. Chunking splits them apart.
4. One topic per file, named for the topic
Filenames become searchable text. A question about Kolibri hits kolibri.md.
5. Keep the system prompt short
I had a 715-token system prompt full of ports and paths, duplicating what the documents already said. Cutting it to 96 tokens produced longer, more complete answers with citations.
Instruction load is the cost, not the prompt content. On a code review task, one rule scored 2.00 of 4, five rules scored 1.20, and the single phrase "Be direct and concise" alone scored 1.00. A plain "you are a helpful assistant" scored 2.00.
6. Check whether think mode is on
Turning it off on gemma took mean score from 0.79 to 0.94, and command recall from 125 seconds to under a second.
The limit worth knowing: small models don't find problems nobody pointed at. Across four models and thirty runs on a function with four planted bugs, none found more than two. What they do well is read a document you hand them and answer from it. Build for that.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I spent a weekend testing why my local AI kept giving wrong answers from my own documents, and found a few settings and writing habits that fixed it. Testing was done with Claude AI. Sharing in case it saves somebody the same weekend.
Setup for context: Project NOMAD running on a Dell Precision 3640 with a Quadro RTX 4000, 8 GB VRAM. Everything below is in NOMAD's built-in Open WebUI, using its knowledge bases, with gemma4:12b for chat and nomic-embed-text for embeddings.
1. Set Full Text Threshold to 0
Default is 50000 characters. Anything under that gets injected whole instead of retrieved. With one 11 KB file attached I was burning 4,880 input tokens per message out of an 8,192 window. It looked like retrieval was working. It wasn't, the whole file was just being pasted in. Add twenty more files and nothing fits.
Setting it to 0 forces real retrieval. You know it's working when citation markers like [1] show up in the answer.
2. Turn on Hybrid Search and Enrich Hybrid Search Text
Semantic search alone misses exact strings, and technical docs are full of them: ports, container names, file paths. Hybrid adds keyword matching. Enrich adds filenames and section headers to what gets searched.
3. Write every fact as a full sentence with the subject first
This was the biggest one. I asked what port a service runs on and got the wrong number, because my notes had a bare list:
It grabbed the neighbor. Rewritten as "Kolibri, the kids school software, runs on port 8310," it answered correctly every time.
No sentence should depend on the heading above it or the sentence before it. Chunking splits them apart.
4. One topic per file, named for the topic
Filenames become searchable text. A question about Kolibri hits kolibri.md.
5. Keep the system prompt short
I had a 715-token system prompt full of ports and paths, duplicating what the documents already said. Cutting it to 96 tokens produced longer, more complete answers with citations.
Instruction load is the cost, not the prompt content. On a code review task, one rule scored 2.00 of 4, five rules scored 1.20, and the single phrase "Be direct and concise" alone scored 1.00. A plain "you are a helpful assistant" scored 2.00.
6. Check whether think mode is on
Turning it off on gemma took mean score from 0.79 to 0.94, and command recall from 125 seconds to under a second.
The limit worth knowing: small models don't find problems nobody pointed at. Across four models and thirty runs on a function with four planted bugs, none found more than two. What they do well is read a document you hand them and answer from it. Build for that.
All reactions