LastSearch
Research infrastructure for AI agents with Grounded Intelligence — real-time web search, evidence extraction, verification, and structured citations. Every claim is backed by a URL. Every answer has a confidence score.
Agent → LastSearch → Internet → Verified answers + sourcesWebsite · Playground · API Docs · Alternatives · Discord
Package names: npm:
lastsearch· PyPI:lastsearch· LangChain:langchain-lastsearch— Previouslylastsearchandlastsearch. Old names still work and redirect automatically.
How It Works
search → fetch pages → neural rerank → extract claims → verify → cited answer (streamed)Every answer goes through a multi-step verification pipeline. No hallucination. Every claim is backed by a real source.
Verification & Confidence Scoring
Confidence scores are evidence-based — not LLM self-assessed. After the LLM extracts claims and sources, a post-extraction verification engine checks every claim against the actual source page text:
- Atomic claim decomposition — Compound claims are auto-split into individual verifiable facts. "Tesla had $96B revenue and 1.8M deliveries" becomes two atomic claims, each verified independently.
- Hybrid retrieval combining keyword and semantic matching — For each claim, keyword matching finds lexical matches and dense embeddings find semantic matches from source text. Rankings are fused to catch paraphrased evidence that keyword matching alone misses (e.g., "prevents fabricated answers" matching "reduces hallucinations"). Premium tier only, with graceful keyword-only fallback.
- Semantic evidence reranking — Top candidates per claim are reranked by a purpose-built verification model trained on 1.4M+ claim-evidence pairs that improves with every query. Selects the best supporting evidence, applies contradiction penalties and paraphrase boosts.
- Multi-provider search — Parallel search across multiple providers for broader source diversity. More independent sources = stronger cross-reference = higher confidence.
- Domain authority scoring — 10,000+ domains across 5 tiers (institutional
.gov/.edu→ major news → tech journalism → community → low-quality). Dynamic scoring that improves from real verification data. - Source quote verification — LLM-extracted quotes verified against actual page text using multi-strategy matching.
- Cross-source consensus — Each claim verified against all available page texts. Claims supported by 3+ independent domains get "strong consensus". Single-source claims flagged as "weak".
- Contradiction detection — Claim pairs analyzed for semantic conflicts using topic overlap and contradiction classification. Detected contradictions surfaced in the response and penalize confidence.
- Multi-pass consistency — In thorough mode, claims are cross-checked across independent extraction passes. Claims confirmed by both passes get boosted; inconsistent claims are penalized.
- Auto-calibrated confidence — Multi-factor confidence formula auto-adjusts from real user feedback. Predicted confidence aligns with actual accuracy over time. Factors: verification rate, domain authority, source count, consensus, domain diversity, claim grounding, source recency, and citation depth.
- Per-claim evidence retrieval — Weak claims get targeted search queries generated by LLM, then searched individually across all providers. Each claim gets its own evidence pool instead of sharing the same corpus.
- Counter-query verification — Verified claims are stress-tested with adversarial "what would disprove this?" search queries. If counter-evidence is found, claim confidence is penalized.
- Iterative confidence-gated retrieval — Thorough mode uses a confidence-gated loop: verify → if weak claims remain → generate targeted query → search → re-verify. Loops up to 3 iterations with early termination when queries repeat or confidence meets threshold.
- Live citation health — On thorough and deep, every cited URL is probed server-side and classified
live(resolves now),stale(link rot — archived once), ordead(no DNS, no archive — likely fabricated). Deep-research agents hallucinate a meaningful share of citation URLs; this makes "every citation resolves" a checkable guarantee. - Content integrity — Every fetched page is scanned on the raw DOM before text extraction. Hidden / non-rendered content (HTML comments,
display:none, off-screen, zero-font,hidden/aria-hidden, instruction-shaped meta/alt text, zero-width characters) — where ~70% of in-the-wild prompt injections live — is stripped so the extraction model never sees it, and instruction-shaped text is counted. Each source getsintegrity(risk: none|low|high), each result acontentRisksummary. Instruction-directed spans are then surgically redacted from the text handed to the extraction model (sanitizedSpans) — research shows removal beats blocking — while the rest of the page is kept. Passstrict: trueto excludehigh-risk sources entirely. Deterministic rules, no guard model; on the open eval set (36 benign pages: 12 synthetic hard-benign + 24 real) it produced 0 high-risk false positives — a count on a small set, not a guarantee (95% upper bound ≈ 8% at n=36); raw results ineval/. A signal for your agent's policy layer, not a guarantee — adaptive attacks can bypass any content filter. - Signed evidence record — Every stored result has a replayable evidence record at
GET /browse/evidence/{shareId}: a typed record (retrieval → verification → decision) binding each claim to its sources, each source to the SHA-256contentHashof the exact page text it was verified against, plus the canonical bytes that were signed, their hash, and an Ed25519 signature (public key atGET /browse/evidence/public-key; SDK:client.get_evidence(id)/LastSearch.verify_evidence(bundle, pem)). It attests what LastSearch retrieved, verified, and returned, and when — one evidentiary link for your audit trail, not a compliance guarantee.






