SShortSingh.
Back to feed

Engineering team cuts RAG pipeline latency 40% using Bayesian search and hybrid retrieval

0
·2 views

A development team overhauled their retrieval-augmented generation (RAG) pipeline after standard production deployments proved inadequate for legal, API, and support-ticket documents. The team replaced fixed 512-token chunking with document-type-specific strategies, including recursive, semantic, and LLM-guided chunking, achieving recall@10 scores between 91% and 97% across content types. They combined vector search with BM25 keyword search using Reciprocal Rank Fusion, then added a cross-encoder reranking stage that improved recall by 15% at a cost of just 50 milliseconds. A query transformation layer was also introduced to handle poorly phrased user queries before retrieval. Together, these changes reduced end-to-end query latency by 40% compared to the original pipeline.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

EAS 4 KiB file limit forces smarter multi-environment config for Expo apps

A developer building CannyCart, a voice-first shopping app using Amplify Gen 2 and Expo, hit a hard 4 KiB ceiling when trying to use EAS environment variables to deliver backend config files to different build profiles. The file in question, amplify_outputs.json, exceeded the limit at 4.5 KB because it embeds a full model_introspection schema that grows with every data model added. Unlike web builds on Amplify Hosting, EAS mobile builds run on Expo's servers without AWS credentials, meaning the config cannot be regenerated at build time and must be committed to the repository in advance. The developer resolved this by committing one amplify_outputs.json per environment and using an eas-build-pre-install hook to copy the correct file into place based on the active build profile. The workaround highlights a structural asymmetry between web and mobile CI pipelines when using Amplify Gen 2 backends.

0
ProgrammingDEV Community ·

Why Rust Beat Go for Uptimepage: No GC, Safer Concurrency

Developer Pavan built Uptimepage, an open-source uptime monitor and status page, choosing Rust over the more conventional Go for a specific technical reason. Because the tool's core promise is accurate millisecond-level timing, Go's garbage collector posed a risk of introducing random pauses that could distort reported metrics like p99 response times. Rust's lack of a garbage collector means memory is freed at predictable, developer-controlled points, eliminating hidden runtime delays from timing measurements. In load tests, the Rust-based service handled 50,000 concurrent checks while peaking at under one gigabyte of memory, with the live server idling at around 42 MiB. Beyond performance, Rust's compiler enforces safe concurrent access to shared data at compile time, preventing entire classes of data-race bugs that Go's tooling catches only optionally or at runtime.

0
ProgrammingDEV Community ·

How EIP-712 Enables Gas-Efficient Offchain OTC Order Signing and Settlement

Traditional onchain OTC order systems require a blockchain transaction for every quote, wasting gas even when offers go unfilled. A more efficient model, illustrated through the Typelex case study, allows market makers to create and sign structured orders offchain using the EIP-712 standard. The signed order is only submitted to the blockchain when both parties are ready to settle, meaning unused quotes never consume gas or occupy contract storage. The architecture incorporates offchain maker signatures, onchain verification, nonce-based replay protection, and support for both standard and smart-contract wallets. This approach is particularly suited to RFQ protocols and DAO treasury operations where multiple competing quotes are common but only one is ultimately executed.

0
ProgrammingDEV Community ·

First-Time Developer Builds B2B Apparel Site With Next.js and Strapi, Gets Real Inquiries

A first-time web developer built Cynida, a B2B apparel factory website, using Next.js 16, Strapi 5, Vercel, AWS Lightsail, and Cloudflare R2 for media storage. The project used a monorepo structure separating the storefront, CMS, and shared validation rules, with content modeled around wholesale buyer needs such as MOQ, fabrics, and lead times. The site attracted roughly eight to nine real buyer inquiries via WhatsApp within its first week of going live. Key technical challenges included tracing alt text through data mappers, configuring edge caching correctly across Cloudflare and Next.js, and reducing initial JavaScript load through deferred components. The developer used OpenAI's Codex as a collaborative tool throughout, crediting it less for writing code and more for helping identify the right questions at each stage of development.