On the machine

  1. Client documents and promptsstay on the machine
  2. Local modelsLM Studio and llama.cpp
  3. MCP tool-callingruns each retrieval step
  4. Self-hosted SearXNGthe gateway to the web
  5. Structured outputschema-validated; un-scrapable sources flagged for review

Public web

Web and academic sourcesreached through SearXNG
Search requests go out and pages come back. Client documents, prompts, and results stay on the machine.

The Problem: Private, Complete, Vendor-Independent Research

An attorney needs to research obscure people, entities, and matters fast — but the usual tools are cloud services that log queries, require accounts, and filter or refuse results. For privileged work that fails on two counts: client-sensitive queries can’t leave the machine, and a tool that quietly omits results because a hosted model’s content policy blocked them is worse than useless. Public cloud assistants have also repeatedly leaked shared conversations into Google search — ChatGPT, Grok, and Claude alike in 2025 — and consumer tiers train on user chats by default. The requirement: a research assistant that is vendor-independent, complete, private, permanent, and usable by someone who never touches a terminal.

Architecture & Stack

I architected and integrated the whole system from open parts: LM Studio (chat UI + model serving + a single on/off dial), llama.cpp (local inference), a self-hosted SearXNG metasearch instance (Docker), and an MCP (Model Context Protocol) tool-calling server that lets the model drive search as a tool. Everything runs on-device — no accounts, no API keys, no external logging. I ran a controlled multi-model bake-off to select the models on accuracy, speed, and reliability, and hardened the stack for reproducible, restart-safe operation.

Autonomous Retrieval & Structured Output

The agent runs multi-hour unattended retrieval across the web and academic databases (arXiv/PubMed/Scholar via SearXNG), returns results as clean, schema-validated structured data, and explicitly flags sources it can’t reach — paywalls, logins, PDFs — for manual review rather than silently dropping them. Most importantly, the models are not limited by a vendor’s content policy, so they do not shy away from certain topics, or entirely omit information.

Sovereignty, Privacy & Ongoing Consulting

Because it’s fully on-prem, privileged data never leaves the machine, and the capability is permanently the firm’s — no subscription, no vendor lock-in, no external kill switch, no exposure to a provider changing or removing features. The industry’s recurring shared-chat leaks, censorship, and default training-on-user-data are exactly the failure modes this design eliminates: there is no cloud copy to leak or train on, and nothing to stop the model from finding valuable information. I continue to support it as an independent consultant — model updates, tool updates, and refinements as needed.