Dev.to
Optimizing RAG at Scale: Chunking, Retrieval, and the Bayesian Search That Cut Latency 40%
Optimizing RAG at Scale: Chunking, Retrieval, and the Bayesian Search That Cut Latency 40% How we moved from "semantic search + hope" to a measured, tunable retrieval pipeline with 95% recall@10 The RAG Reality Check Everyone ships RAG the same way: chunk by 512 tokens, embed with text-embedding-3-small , top-k=5, stuff into context. It works for demos. Then you hit production: Legal contracts: 512 tokens splits clauses mid-sentence API docs: 1000-token chunks drown signal in noise Customer tickets: Conversational context needs overlap, not fixed windows Latency: 500ms embedding + 200ms vector search + 300ms LLM = 1s+ per query We rebuilt our retrieval layer from first principles. Here's what actually moves metrics. Chunking: One Size Fits None # rag/chunking.py from abc import ABC , abstractmethod from dataclasses import dataclass @dataclass class Chunk : text : str metadata : dict token_count : int chunk_id : str class ChunkingStrategy ( ABC ): @abstractmethod def chunk ( self , document : str , metadata : dict ) -> list [ Chunk ]: ... class FixedTokenChunker ( ChunkingStrategy ): """ Baseline. Good for homogeneous content. """ def __init__ ( self , chunk_size = 512 , overlap = 50 ): self . chunk_size = chunk_size self . overlap = overlap class RecursiveChunker ( ChunkingStrategy ): """ Respects structure: markdown headers, code blocks, paragraphs. """ def __init__ ( self , separators = [ " \n ## " , " \n ### " , " \n\n " , " \n " , " " ], chunk_size = 512 ): self . separators = separators self . chunk_size = chunk_size class SemanticChunker ( ChunkingStrategy ): """ Uses embedding similarity to find natural boundaries. """ def __init__ ( self , model = " text-embedding-3-small " , threshold = 0.7 ): self . model = model self . threshold = threshold class AgenticChunker ( ChunkingStrategy ): """ LLM decides boundaries. Expensive but highest quality for complex docs. """ def __init__ ( self , model = " gpt-4o-mini " ): self . model = model Our production config by
Imus
2026-07-20 23:43
👁 4
查看原文 →
Dev.to
Building Production-Grade LLM Evaluation Pipelines: From Vibes to Metrics
Building Production-Grade LLM Evaluation Pipelines: From Vibes to Metrics How we replaced "looks good to me" with automated evaluation catching 92% of hallucinations before deployment The Problem: Why "Vibe Checks" Fail in Production Three months ago, our team shipped a RAG-based customer support assistant. It worked great in testing — we'd ask it questions, read the answers, and say "yeah, that looks right." Then it hit production. A customer asked about their billing cycle. The assistant confidently cited a policy that didn't exist. Another asked about API rate limits and got numbers from a competitor's documentation. By the time we caught it, 500+ users had seen hallucinated responses. The post-mortem was brutal: we had zero automated evaluation . Our test process was literally "ask 5 questions, read answers, thumbs up." What Production Evaluation Actually Needs Academic benchmarks (MMLU, HellaSwag) don't tell you if your system works for your use case. Production evaluation needs: Domain-specific judges — Your criteria, not generic "helpfulness" Speed — Evaluation must run in CI/CD, not overnight Regression detection — Know immediately when a prompt change breaks things CI/CD integration — Block merges that degrade quality Golden dataset management — Versioned, stratified, growing test cases Architecture: The Evaluation Pipeline ┌─────────────┐ ┌──────────────┐ ┌────────────────────┐ ┌──────────────┐ │ Test Cases │────▶│ LLM Under │────▶│ Judge Ensemble │────▶│ Metrics & │ │ (Golden Set)│ │ Test │ │ - Faithfulness │ │ Regression │ └─────────────┘ └──────────────┘ │ - Instruction F. │ │ Detection │ │ - JSON Schema │ └──────┬───────┘ │ - Custom LLM │ ▼ └────────────────────┘ ┌──────────────┐ │ Dashboard/ │ │ PR Comments │ └──────────────┘ Core Abstractions # eval/base.py @dataclass ( frozen = True ) class TestCase : id : str input : dict [ str , Any ] expected : dict [ str , Any ] | None = None tags : list [ str ] = field ( default_factory = list ) # ["edge-case",
Imus
2026-07-20 23:43
👁 4
查看原文 →
Dev.to
Resume Optimization for US Data Engineering from WeChat Mini-Programs
Why Your WeChat Mini-Program Work Is Actually Relevant US data engineering interviews prioritize hands-on experience with data pipelines, SQL, and scalable storage. WeChat mini-programs, though often seen as front-end tools, generate and process substantial backend data. If you designed the logic behind user actions, session management, or real-time updates, you already have transferable skills. The key is to stop describing the mini-program as a "feature" and start describing it as a "data system." Recruiters don't care about WeChat's UI components; they care about how you moved, transformed, and stored data. The Core Translation: From Mini-Program to Data Engineering When rewriting your resume, map each mini-program task to a standard data engineering function: User interaction logic → Event-driven data pipeline (e.g., Kafka, AWS Kinesis, or custom queues) WeChat cloud functions → Serverless compute (e.g., AWS Lambda, Azure Functions) Database reads/writes via WeChat API → NoSQL or relational database operations (e.g., MongoDB, MySQL, DynamoDB) Session tracking or analytics → ETL pipeline extracting user behavior data into a warehouse Do not use WeChat-specific terms like "wx.request" or "Mini Program SDK" without explaining the data they handled. Replace them with equivalent English terms. A Quick Side-by-Side Translation Table WeChat Term US Data Engineering Equivalent WeChat Cloud Database Managed NoSQL database (like MongoDB Atlas) Mini Program Backend with Cloud Functions Serverless data processing (AWS Lambda) User login & session management Authentication pipeline with token storage Real-time message push Event-driven notification system Reshaping Your Bullet Points: Before and After Generic bullet points kill your chances. Here is a concrete rewrite that turns a typical WeChat mini-program description into a data engineering achievement. Before (Chinese-English hybrid, vague): "Developed a WeChat mini-program for e-commerce with 50k users. Used wx.request
PrismResume
2026-07-20 23:42
👁 5
查看原文 →
Reddit r/programming
How Generalized Inverted Index works internally in Postgre SQL
Regular Indexing works on a column level; it indexes the entire column value, but if you want to index each value in one row, then the GIN indexing technique is used. GIN can index each element of JSON stored in a JSONB field How Postgres creates a GIN file physically, what is the format of that file, how that file is retrieved in RAM while fetching records, what data types are used, and how Postgres calculates the exact address of an element of JSON are all explained in the article submitted by /u/Ok_Stomach6651 [link] [留言]
/u/Ok_Stomach6651
2026-07-20 23:40
👁 2
查看原文 →
Dev.to
The Bug I Fixed Nine Times Before I Finally Killed It For Good
This is a submission for DEV's Summer Bug Smash: Smash Stories powered by Sentry . 🎭 The Recurring Villain If you've built WordPress sites long enough, you know this bug. It doesn't show up as an error in your console. It doesn't throw a fatal exception. It just quietly sits there, page after page, client after client — and it's called video bloat . Nine years into web development, I lost count of how many times a client sent me a site with a message like "it's just... slow." And nine times out of ten, when I opened DevTools and checked the waterfall, the story was the same: three, four, sometimes ten embedded YouTube videos, each one dragging in its own iframe, its own set of scripts, its own chunk of megabytes — all loading the second the page rendered, whether the visitor scrolled past them or not. One video embed alone can pull in 500KB–1MB+ before a user even presses play. Multiply that by a landing page stacked with testimonials, product demos, and a hero video, and you've got a page that fights your Core Web Vitals before it's even finished loading. 🔁 The Manual Fix (Every. Single. Time.) For years, my solution was the same tedious ritual: Find every video embed on the page. Replace the iframe with a static thumbnail image. Write a bit of custom JavaScript to swap the thumbnail for the real embed on click or scroll. Repeat it for YouTube. Repeat it again for Vimeo, because Vimeo's oEmbed API works differently. Repeat it again for self-hosted <video> tags, because now you're dealing with <source> tags instead of iframes. Test it across whatever page builder the client was using — Elementor, Divi, WPBakery, or straight-up Gutenberg blocks — because every one of them nests the video markup slightly differently. It worked. But it was never reusable. Every project meant writing the lazy-load script again, half from memory, half copy-pasted from my own old projects, tweaked just enough to fit the new theme's markup. It was the same bug, wearing a different site's c
Kushang Tailor
2026-07-20 23:39
👁 5
查看原文 →
Dev.to
Everything Claude Code: How One AI Assistant Becomes a Full Engineering Team
Everything Claude Code: How One AI Assistant Becomes a Full Engineering Team Most developers use AI coding assistants in the same way. They open a repository and type: Build this feature. The assistant reads a few files, generates code, and reports that the task is finished. Sometimes the result is impressive. Sometimes it solves the wrong problem with perfectly formatted code. The issue is not always the intelligence of the model. The issue is the workflow around it. A single prompt often expects one AI assistant to behave like: a product planner a software architect a frontend developer a backend developer a security engineer a test engineer a debugger a code reviewer a release manager Real engineering teams do not work that way. They divide responsibility. One person plans. Another implements. Someone reviews security. Someone tests edge cases. Someone challenges the architecture. The final result improves because different people examine the same work from different angles. That is the idea behind Everything Claude Code , often shortened to ECC . ECC is an open-source collection of specialized AI agents, reusable skills, commands, security tooling, hooks, memory systems, and development workflows designed to turn Claude Code into something closer to an AI software engineering team. Instead of asking one general-purpose assistant to do everything in one pass, ECC separates software development into focused roles. That architectural idea is more important than any individual command. This article explains how ECC works, why developers are excited about it, how to install only what you need, and what security boundaries you should establish before giving any AI agent access to a real codebase. What Is Everything Claude Code? Everything Claude Code is not a new language model. It does not replace Claude. It is a workflow and configuration layer built around Claude Code. Think of Claude Code as one highly capable engineer. ECC attempts to turn that engineer into a co
Techifive
2026-07-20 23:37
👁 4
查看原文 →
HackerNews
A 600-acre AI data center could cost some Wisconsin residents their land
1vuio0pswjnm7
2026-07-20 23:36
👁 2
查看原文 →
Ars Technica
AliExpress hit with record $625M fine after failing to make EU-ordered fixes
Online retailer AliExpress says it's shocked by largest DSA fine yet.
Ashley Belanger
2026-07-20 23:32
👁 4
查看原文 →
HackerNews
Show HN: DeepSQL – A self-hostable DBA agent for Postgres and MySQL
Hi HN - I'm Venkat, founder of Stayflexi (YC), CMU CS grad and Ex-Oracle Query Engine team (patents in core databases) DeepSQL started as an internal tool to stop our own databases from becoming the bottleneck they were becoming (13,000+ hotels in production). It worked well enough that we're releasing it. DeepSQL is an AI agent that operates a database the way a senior DBA and Data Engineer would 1. Fixes slow queries (we cutdown DB spend by 4x) 2. Fixes DB bloat (blocks unnecessary schema chan
venkat971
2026-07-20 23:32
👁 1
查看原文 →
Engadget
How long is a new iPhone actually supposed to last?
Apple devices tend to be pretty durable, and the average lifespan of a new iPhone seems to be fairly consistent.
staff@engadget.com (Adnan Ahmed)
2026-07-20 23:30
👁 5
查看原文 →
HackerNews
Jaron Lanier: there is no AI (2023)
simonebrunozzi
2026-07-20 23:28
👁 2
查看原文 →
TechCrunch
YouTube clarifies policies around AI slop and upsetting videos
YouTube has updated its monetization policies to more clearly define the kinds of AI-generated and low-quality videos that can’t earn ad revenue.
Sarah Perez
2026-07-20 23:23
👁 3
查看原文 →
HackerNews
Trial Lawyers Lobby Against Autonomous Vehicles
duringmath
2026-07-20 23:20
👁 2
查看原文 →
TechCrunch
Inference startup Infinity raises $15M from Touring Capital, OpenAI and Athropic researchers
AI infrastructure company Infinity announced Monday a $15 million raise at a $100 million valuation from investors including Touring Capital, Principal VC, and researchers from companies such as OpenAI and Anthropic.
Dominic-Madori Davis
2026-07-20 23:15
👁 3
查看原文 →
Engadget
Avengers: Doomsday finally has a real trailer
After too many weird teasers, Avengers: Doomsday finally has a real trailer.
staff@engadget.com (Lawrence Bonk)
2026-07-20 23:14
👁 4
查看原文 →
HackerNews
Netflix Paid $587M for Ben Affleck's AI Startup InterPositive
caseysoftware
2026-07-20 23:05
👁 2
查看原文 →
TechCrunch
Hackers stole ‘significant’ amount of data from tech firm relied on by thousands of US hospitals and pharmacies
Edinburgh-based tech firm Craneware said customer data was stolen during a cyberattack. The company makes software that thousands of U.S. hospitals, pharmacies, and clinics rely on for billing patients, potentially exposing health data.
Zack Whittaker
2026-07-20 23:01
👁 4
查看原文 →
The Verge AI
Dr. Jill Lepore on why AI backlash is vital for the future
Today, I’m talking with Harvard professor and New Yorker staff writer Dr. Jill Lepore about her new book, The Rise and Fall of the Artificial State, which comes out on August 25. Jill is one of the best writers there is at identifying institutional patterns in history, and Decoder is a show about systems, so […]
Nilay Patel
2026-07-20 23:00
👁 4
查看原文 →
The Verge AI
The AirPods Max 2 are down to their second-best price
There are a ton of deals available to shop today thanks to Best Buy’s “Black Friday in July” sale lasting all week. The sale typically aligns closely with Prime Day each year, but of course, Amazon’s shopping holiday happened much earlier than we expected. So it’s nice to have some deals in July. One of […]
Cameron Faulkner
2026-07-20 22:41
👁 4
查看原文 →
HackerNews
Controlling Reasoning Effort in LLMs
ibobev
2026-07-20 22:35
👁 2
查看原文 →