惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Last Watchdog
The Last Watchdog
博客园_首页
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
美团技术团队
小众软件
小众软件
V
V2EX
博客园 - Franky
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Attack and Defense Labs
Attack and Defense Labs
S
Security Affairs
Simon Willison's Weblog
Simon Willison's Weblog
I
Intezer
T
The Exploit Database - CXSecurity.com
有赞技术团队
有赞技术团队
S
Schneier on Security
人人都是产品经理
人人都是产品经理
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
K
Kaspersky official blog
PCI Perspectives
PCI Perspectives
AI
AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
罗磊的独立博客
O
OpenAI News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Register - Security
The Register - Security
V
Vulnerabilities – Threatpost
GbyAI
GbyAI
博客园 - 【当耐特】
C
Cisco Blogs
大猫的无限游戏
大猫的无限游戏
Help Net Security
Help Net Security
Google DeepMind News
Google DeepMind News
S
Securelist
Application and Cybersecurity Blog
Application and Cybersecurity Blog
P
Proofpoint News Feed
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
L
LangChain Blog
SecWiki News
SecWiki News
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V2EX - 技术
V2EX - 技术
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
L
LINUX DO - 热门话题
Cisco Talos Blog
Cisco Talos Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How to Build a Local Agentic Search Pipeline That Actually Gets Facts Right
Alan West · 2026-05-03 · via DEV Community

If you've spent any time building with local LLMs, you've probably hit the same wall I have: your model confidently tells you something that is completely, verifiably wrong. Ask it about a recent API change, a specific library version, or any fact that requires up-to-date knowledge, and you're rolling dice.

The core problem isn't that these models are dumb. It's that they're frozen in time. And for anything requiring factual accuracy — think developer tools, research assistants, or internal knowledge bases — that's a dealbreaker.

But recently, the local LLM community has been closing this gap fast. A post on r/LocalLLaMA demonstrated a fully local agentic search setup reportedly hitting 95.7% on OpenAI's SimpleQA benchmark, running on a single RTX 3090. That's competitive with cloud APIs, and it's running in someone's office. Let's break down how this kind of pipeline works and how you can build one yourself.

Why Vanilla RAG Falls Short for Factual Questions

Before we get into agentic search, let's talk about why the simpler approach — basic retrieval-augmented generation (RAG) — doesn't cut it for high factual accuracy.

Standard RAG works like this: embed a query, find similar chunks in a vector store, stuff them into the context window, and hope for the best. The problems are well-documented:

  • Single-shot retrieval misses context. If the answer requires synthesizing information across multiple sources, one retrieval pass won't get you there.
  • Chunk boundaries break facts. Your crucial detail might be split across two chunks, and the retriever only grabbed one.
  • No verification loop. The model has no way to say "I'm not confident in this, let me look again."

For SimpleQA-style questions — short, factual, verifiable — these limitations matter a lot. You need something smarter.

The Agentic Search Pattern

Agentic search fixes this by giving the model a tool-use loop. Instead of one retrieval pass, the model can:

  1. Decide it needs to search for something
  2. Formulate a specific query
  3. Read the results
  4. Decide if it has enough info or needs to search again
  5. Synthesize a final answer with citations

This is the same pattern behind Perplexity and similar products, but running entirely on your hardware. The key insight is that even a moderately-sized model can orchestrate this loop effectively if you structure the agent correctly.

Here's a simplified version of what the agent loop looks like:

import json

def agentic_search(query, llm, search_fn, max_iterations=5):
    messages = [
        {"role": "system", "content": SYSTEM_PROMPT},
        {"role": "user", "content": query}
    ]

    for i in range(max_iterations):
        response = llm.chat(messages, tools=SEARCH_TOOLS)

        if response.tool_calls:
            for call in response.tool_calls:
                # Model decided it needs more info
                search_query = call.arguments["query"]
                results = search_fn(search_query)
                messages.append({"role": "tool", "content": results})
        else:
            # Model is confident enough to answer
            return response.content

    return "Could not determine a confident answer."

Enter fullscreen mode Exit fullscreen mode

The magic is in letting the model decide when it knows enough. A well-tuned model will search two or three times for complex questions and answer immediately for simple ones.

Running a 27B Model on a Single 3090

A 27B parameter model at full precision needs ~54GB of VRAM. An RTX 3090 has 24GB. So how does this work? Quantization.

With 4-bit quantization (Q4_K_M or similar), that 27B model shrinks to roughly 15-16GB, leaving headroom for KV cache and the search context. Here's how to serve it with llama.cpp:

# Download a Q4_K_M quantized model (check Hugging Face for available quants)
# Then serve it with llama-server
./llama-server \
    -m ./models/your-27b-model-Q4_K_M.gguf \
    --port 8080 \
    --n-gpu-layers 99 \
    --ctx-size 32768 \
    --chat-template chatml

Enter fullscreen mode Exit fullscreen mode

A few things to note:

  • --n-gpu-layers 99 offloads everything to the GPU. With Q4 on 24GB, you should have enough room.
  • --ctx-size 32768 gives you a decent context window for search results. You can go higher if your model supports it, but watch your VRAM.
  • The Qwen model family supports tool/function calling natively, which is critical for the agent loop.

Alternatively, if you prefer a Python-native stack, vllm handles quantized models well:

from vllm import LLM, SamplingParams

llm = LLM(
    model="your-model-path",
    quantization="awq",       # or gptq, depending on your quant
    gpu_memory_utilization=0.9,
    max_model_len=32768,
    enable_prefix_caching=True  # helps with repeated search contexts
)

Enter fullscreen mode Exit fullscreen mode

The Search Backend

Your search component needs to be fast and return clean, relevant text. You have a few options:

  • SearXNG — self-hosted metasearch engine. This is the fully local option. It aggregates results from multiple search engines and returns them in a clean API format. Runs in Docker, no API keys needed.
  • Brave Search API — has a generous free tier and returns well-structured results. Not fully local, but the search itself isn't where your privacy concerns usually lie.
  • Local index with Tantivy or Meilisearch — if you're searching over a known corpus (docs, codebase, internal wiki), a local search index is faster and more reliable.

For the agentic loop to work well, you want to return snippets, not full pages. Parse the results and keep only the relevant paragraphs. This saves context space and reduces noise.

System Prompt Engineering (This Part Actually Matters)

The system prompt for your search agent needs to do three things:

  1. Tell the model when to search. Be explicit: "If you are not certain about a factual claim, use the search tool before answering."
  2. Tell it when to stop. Without this, some models will search in circles. Add something like: "Once you have found a consistent answer from at least one reliable source, provide your final answer."
  3. Enforce citation discipline. "Always indicate which search result supports your answer."

Here's a minimal but effective system prompt:

You are a factual research assistant with access to a search tool.

Rules:
- If you are unsure about ANY factual claim, search before answering.
- Formulate specific, targeted search queries. Avoid vague terms.
- You may search up to 5 times per question.
- Once you have a well-supported answer, respond concisely.
- If search results conflict, note the disagreement.
- Never guess. If you cannot find the answer, say so.

Enter fullscreen mode Exit fullscreen mode

That last line is crucial. On benchmarks like SimpleQA, saying "I don't know" when you actually don't know is scored favorably. Models that hedge correctly instead of hallucinating see significant score improvements.

Why This Works So Well Now

Three things have converged to make local agentic search viable:

  • Better tool-calling in open models. The latest generation of open-weight models (Qwen, Llama, Mistral) have been specifically trained on function-calling data. They reliably produce structured tool calls without constant coaxing.
  • Quantization without quality collapse. Modern quantization techniques (AWQ, GGUF Q4_K_M) preserve model quality surprisingly well. The gap between FP16 and Q4 has shrunk to a few percentage points on most benchmarks.
  • Mature serving stacks. llama.cpp and vLLM both handle tool calling, streaming, and context management reliably now. Two years ago, this was held together with duct tape.

Practical Tips From Setting This Up

A few things I've learned the hard way:

  • Prefill your KV cache with the system prompt if your serving framework supports it. The system prompt stays the same across queries, so caching it saves real time.
  • Cap your search iterations. Five is a good default. Without a cap, edge cases can make your model search endlessly and burn through your context window.
  • Monitor VRAM during long sessions. The KV cache grows with context length. If you're stuffing multiple search results into one conversation, you can OOM on queries that seem fine individually.
  • Test with SimpleQA yourself. The dataset is publicly available from OpenAI. It's a great way to measure whether your changes are actually improving factual accuracy or just making you feel better.

The Bigger Picture

A year ago, getting reliable factual answers from a local model felt like a pipe dream. You either used cloud APIs or accepted the hallucinations. The fact that the community is now hitting cloud-competitive accuracy on consumer hardware is a genuine inflection point.

Is it perfect? No. A 27B quantized model with agentic search is still slower than hitting an API endpoint, and there are edge cases where it'll stumble. But for privacy-sensitive workloads, offline environments, or just not wanting a per-token bill, this is real and it works.

The bottleneck has shifted from model quality to engineering. How you structure the agent loop, how you process search results, and how you prompt the model matters more than raw parameter count. And that's the kind of problem developers are good at solving.