Evaluation-Driven Refactoring: How W&B Improved Their LLM Documentation Assistant Through Systematic Testing

weights_&_biases · Tech · 2024 · source Agentic: no · promotional bias: low · summary-only (no fetched source) · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: LLM documentation assistant reliability and latency

Weights & Biases needed to refactor Wandbot, a RAG documentation assistant, because document parsing, retrieval speed, and redundant LLM calls made the production assistant too slow and inefficient.

Constraints:

Architecture

W&B refactored Wandbot's RAG pipeline by moving vector storage from FAISS to ChromaDB, optimizing chunk sizes, introducing LangChain Expression Language for asynchronous processing, and parallelizing API calls. The team drove the refactor with approximately 50 evaluations so changes to parsing, retrieval, and response synthesis could be judged against correctness and latency rather than intuition.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  documentation-corpus["Documentation corpus"] --> parsing-and-chunking-pipeline["Parsing and chunking pipeline"]
  parsing-and-chunking-pipeline --> chromadb-vector-store["ChromaDB vector store"]
  chromadb-vector-store --> rag-response-synthesizer["RAG response synthesizer"]
  rag-response-synthesizer --> client-application-surfaces["Client application surfaces"]
  rag-response-synthesizer --> evaluation-suite["Evaluation suite"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Documentation corpus W&B technical documentation ingested by Wandbot. Parsing and chunking pipeline
Parsing and chunking pipeline Processes documents and tunes chunk sizes for retrieval quality. ChromaDB vector store
ChromaDB vector store Stores embeddings after the migration from FAISS. RAG response synthesizer
RAG response synthesizer Retrieves documentation context and calls LLMs to answer user questions. Client application surfaces, Evaluation suite
Client application surfaces Slack, Discord, Zendesk, and other user-facing locations where Wandbot answers documentation questions. —
Evaluation suite Measures answer correctness, latency, and regressions across refactor candidates. —

Data flow

Documentation is parsed, chunked, embedded, and stored in a vector database. User questions from Slack, Discord, Zendesk, or other client surfaces trigger retrieval, response synthesis, and evaluation of correctness and speed. Refactor changes were tested against the evaluation set before being accepted.

“The Wandbot system is a Retrieval Augmented Generation (RAG) pipeline that ingests documentation, stores it in a vector database, and uses LLM-based response synthesis”summary, stated
“The system was deployed across multiple client applications including Slack, Discord, and Zendesk”summary, stated

Why this architecture

The refactor targeted latency and efficiency bottlenecks while using evaluations to protect correctness. Moving vector storage, optimizing chunks, and parallelizing/asynchronizing calls addressed the known slow retrieval and redundant LLM-call problems in the RAG pipeline.

“transitioned from FAISS to ChromaDB for vector storage, implemented asynchronous processing using LangChain Expression Language (LECL), optimized chunk sizes, and parallelized API calls.”summary, stated
“Through systematic evaluation-driven development”summary, stated

Models used: Wandbot · RAG · FAISS · ChromaDB · LangChain Expression Language · LLM-based response synthesis

Scale

Alternatives considered (roads not taken)

Keep the original FAISS-based RAG pipeline.

Rejected because: The existing pipeline suffered from parsing quality issues, slow retrieval, and redundant LLM calls.

“Document parsing issues in the data ingestion pipeline were causing quality problems”summary, stated

Refactor without systematic evaluation.

Rejected because: The team needed to verify that latency improvements did not damage answer correctness.

“aimed to address performance inefficiencies while maintaining or improving accuracy.”summary, stated

Patterns

rag-retrieval (documentation assistant)

Wandbot retrieves W&B documentation from a vector database and synthesizes answers with an LLM.

“Retrieval Augmented Generation (RAG) pipeline that ingests documentation, stores it in a vector database”summary, stated

eval-driven-development (refactoring control)

The team used about 50 evaluations to compare correctness and latency through the refactor.

“Through systematic evaluation-driven development”summary, stated

latency-optimization (production assistant)

Asynchronous processing and parallel API calls reduced response latency substantially.

“parallelized API calls”summary, stated

retrieval-ranking (chunking and vector retrieval)

Chunk-size optimization and vector-store migration were used to improve retrieval quality and speed.

“optimized chunk sizes”summary, stated

Tradeoffs

Migrate vector storage.

Chose ChromaDB over FAISS.

Rationale: The migration was part of a broader effort to improve retrieval speed and production maintainability.

“transitioned from FAISS to ChromaDB for vector storage”summary, stated

Spend effort on evaluation before and during refactor.

Chose Approximately 50 evaluations over Performance tuning by intuition alone.

Rationale: The team needed correctness and latency evidence before accepting architectural changes.

“involved approximately 50 evaluations and significant debugging”summary, stated

Gotchas (what bit them)

Refactoring a RAG assistant exposed hidden complexity.

Root cause: Parsing, retrieval, and LLM-call inefficiencies interacted in ways that were not solved by a single code change.

Resolution: The team used systematic evaluation and debugging across vector storage, chunking, async processing, and parallel calls.

“hidden complexities of seemingly straightforward refactoring work.”summary, stated

Document parsing problems reduced answer quality.

Root cause: The ingestion pipeline produced low-quality parsed content for retrieval.

Resolution: The refactor addressed the parsing and ingestion pipeline as part of the broader RAG redesign.

“Document parsing issues in the data ingestion pipeline were causing quality problems”summary, stated

Redundant LLM calls hurt response latency.

Root cause: The original response-generation path involved iterative, redundant calls.

Resolution: W&B parallelized API calls and used asynchronous processing.

“Iterative and redundant LLM ca”summary, stated

Evaluation

W&B used systematic evaluation-driven refactoring, with about 50 evaluations and significant debugging, to measure answer correctness and response latency before accepting the new Wandbot architecture.

Metrics: Answer correctness · Response latency · Evaluation count · Retrieval speed · Document parsing quality

“improved answer correctness from 72% to 81% while reducing response latency by 84%”summary, stated

Outcomes

This is summary-only due to missing source cache, but the summary gives concrete before/after metrics and evaluation count.

“improved answer correctness from 72% to 81% while reducing response latency by 84% (from ~492 seconds to ~80 seconds per response).”summary, stated