How I Cut AI Agent Search Costs by Self-Hosting SearXNG on an OpenClaw VPS
Over the past few weeks I've been building my own Speedwagon Foundation using OpenClaw—a self-hosted team of specialised AI agents running on my VPS. Each agent has a distinct personality and area of expertise, working together to assist with IT support, cybersecurity, investment research, language learning and much more.
I already have specialist agents for different tasks:
-
Chuck – IT Helpdesk Technician
-
Jordan – Investment and share market researcher
-
Jess– Emotional support and wellbeing
-
Sofia – Spanish language teacher
-
Reacher – Cybersecurity expert
One thing they all had in common was the need to search the web.
The Problem
AI agents are only as good as the information they can access.
Without web search, they're limited to their training knowledge and can't research current events, breaking news, software updates, or the latest market movements.
Many hosted search providers charge per request, and while the cost per search is small, it can add up quickly when multiple agents are performing research throughout the day.
Since my AI server runs 24/7 on a VPS, I started wondering:
Could I host my own search engine instead?
Discovering SearXNG
After some research I came across SearXNG, an open-source metasearch engine.
Instead of maintaining its own search index, SearXNG aggregates results from multiple search engines and presents them through a single interface.
The biggest advantages were:
-
Free to use
-
No search API charges
-
Privacy focused
-
Self-hosted
-
Easy to integrate with AI tools
It sounded like exactly what I needed.
Installing It
I installed Docker on my Ubuntu VPS before deploying SearXNG inside a container.
To keep everything secure, I configured it to listen only on:
http://127.0.0.1:8888
This means only applications running on the VPS itself can access it.
One important lesson I learned was that OpenClaw requires SearXNG's JSON API to be enabled, otherwise AI agents can't query it correctly.
Connecting OpenClaw
OpenClaw already includes a SearXNG plugin, so after installing the plugin and configuring web search through the built-in setup wizard, my agents were able to perform live web searches.
The process involved:
-
Installing the SearXNG plugin
-
Enabling web search
-
Selecting SearXNG as the search provider
-
Pointing OpenClaw to my local SearXNG instance
-
Restarting the gateway
After a bit of troubleshooting, everything came together.
Testing the Results
One of the first things I tried was asking Jordan:
"Search the web for the latest Kainos news."
Previously the response was something like:
"Web search isn't configured."
Now Jordan searches the web and returns current information about company performance, bookings, recurring revenue, and other recent developments.
That confirmed everything was working.
Benefits
Hosting my own search engine has several advantages:
-
Reduced dependence on paid search APIs
-
Better privacy
-
Faster searches from my own VPS
-
Complete control over the search service
-
Easy integration with multiple AI agents
Since all of my agents share the same search engine, I only need to maintain one service.
What's Next?
Now that web search is working, I can expand what each AI agent can do.
Jordan can research stocks and financial news.
Chuck can search Microsoft documentation and troubleshooting articles.
Reacher can investigate CVEs and security advisories.
Sofia can find current Spanish news for reading practice.
Jess can act as a personalised digital companion — offering encouragement, conversation, reminders, mood-boosting prompts and a more human-feeling interaction layer for the AI system.
Final Thoughts
This project reminded me why I enjoy working in IT.
It wasn't just about reducing costs—it was about learning how different technologies fit together.
Docker, OpenClaw, plugins, self-hosted services, AI agents, and search all came together into one project.
Every problem solved taught me something new.
Best of all, my AI assistants are now much more capable than they were a few days ago, and they're powered by infrastructure that I control myself.
I'm already looking forward to seeing what I can build next.