Skip to content

Instantly share code, notes, and snippets.

@48Nauts-Operator
Created February 7, 2026 20:12
Show Gist options
  • Select an option

  • Save 48Nauts-Operator/2d77ecfe21623e3b6796378205992644 to your computer and use it in GitHub Desktop.

Select an option

Save 48Nauts-Operator/2d77ecfe21623e3b6796378205992644 to your computer and use it in GitHub Desktop.
Stop Sending Your AI's Search Queries to Big Tech — Self-hosted search with SearXNG

Stop Sending Your AI's Search Queries to Big Tech

Every time your AI agent searches the web, that query goes to Google, Brave, or Microsoft. Here's how to keep it private.


The Privacy Problem Nobody Talks About

Your AI assistant searches the web dozens of times a day. Each query reveals:

  • What you're researching
  • Your business interests
  • Your competitive analysis
  • Your personal questions

All of this goes straight to API providers who log everything.

The uncomfortable truth: Your AI's searches are more revealing than your browser history.


The Fix: Self-Hosted Search in 5 Minutes

SearXNG is a free, open-source metasearch engine. It aggregates results from Google, Bing, DuckDuckGo, and 70+ other sources — without them knowing who's searching.

Step 1: Run SearXNG

docker run -d -p 8080:8080 searxng/searxng

That's it. You now have private search at localhost:8080.

Step 2: Point Your AI at It

Instead of:

curl "https://api.brave.com/search?q=my+secret+query" \
  -H "X-Subscription-Token: xxx"

Use:

curl "http://localhost:8080/search?q=my+secret+query&format=json"

Same results. Zero tracking. No API key needed.


What Changes

Before After
Queries sent to Brave/Google Queries stay on your machine
$0.003 per search Free forever
They log your searches You control the logs
API key required No authentication needed

For Teams: Add Agent Tracking

If you run multiple AI agents, you probably want to know who searched what.

We built a simple registry:

Agent → API Key → Logged Search → SearXNG → Results

Each agent gets a key. Every search is logged locally. Full audit trail, zero external exposure.

Dashboard shows:

  • Which agent searched
  • What they searched for
  • When
  • How many results

All on your infrastructure.


The One-Liner Setup

docker run -d --name searxng -p 8080:8080 searxng/searxng

Test it:

curl "http://localhost:8080/search?q=test&format=json" | jq '.results[:3]'

Done. Your AI now has private web search.


Why This Matters

  1. Your queries are valuable data — Don't give them away
  2. Compliance — Some industries require data sovereignty
  3. Competitive intelligence — Your research is your edge
  4. It's free — No more API bills

Resources


Your AI's searches should be as private as your thoughts.


48nauts — Privacy-first AI infrastructure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment