Scaling Enterprise RAG with Advanced Vector Search Migration

danswer · Tech · 2024 · source Agentic: no · promotional bias: med · source-backed · 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: enterprise RAG search infrastructure

Danswer needed to scale enterprise RAG search across organizational knowledge sources when its previous vector database could not support hybrid ranking, recency decay, or multi-vector document indexing.

Constraints:

Architecture

Danswer migrated its core enterprise RAG retrieval layer to Vespa. Vespa enabled normalized hybrid search across vector and keyword signals, flexible time-decay ranking functions over document freshness, and multi-vector-per-document indexing so different section sizes can be searched without duplicating whole documents.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  A["Enterprise knowledge sources"] --> B["Danswer ingestion"]
  B --> C["Vespa index"]
  C --> D["Hybrid search ranking"]
  C --> E["Multi-vector document representation"]
  D --> F["RAG context retriever"]
  E --> F
  F --> G["LLM answer layer"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Enterprise knowledge sources Google Drive, Slack, Salesforce, and other organizational content systems. Danswer ingestion
Danswer ingestion Connects disparate knowledge sources and prepares documents for indexing. Enterprise knowledge sources, Vespa index
Vespa index Search index supporting hybrid search, ranking functions, and multiple vectors per document. Danswer ingestion, Hybrid search ranking, Multi-vector document representation
Hybrid search ranking Normalizes and combines vector, keyword, and time-decay relevance signals. Vespa index, RAG context retriever
Multi-vector document representation Indexes multiple section/context-size embeddings without duplicating documents. Vespa index, RAG context retriever
RAG context retriever Retrieves relevant context for LLM responses. Hybrid search ranking, Multi-vector document representation, LLM answer layer
LLM answer layer Generates search/chat answers over retrieved enterprise context. RAG context retriever

Data flow

Danswer ingests organizational knowledge sources such as Google Drive, Slack, and Salesforce, indexes documents with hybrid keyword/vector representations and multiple embeddings per document in Vespa, ranks results with custom boost/decay functions, and passes retrieved context to the LLM for a search/chat interface.

3 supporting quotes
“We connect all of the disparate knowledge sources of a team (like Google Drive, Slack, Salesforce, etc.)”article, stated
“The way we do this is by retrieving relevant context before passing it to the LLM (Retrieval Augmented Generation - RAG for short).”article, stated
“Vespa allows for an easy normalization across multiple search types and finally allowed us to achieve the accuracy we wanted.”article, stated

Why this architecture

Danswer moved to Vespa because enterprise RAG needed more than pure vector search: team-specific keywords, stale-document decay, multiple vectors per document, and internet-scale search features that still worked for self-hosted deployments.

3 supporting quotes
“As we scaled to large enterprise scales of data, we discovered that our needs for fine tuning our search pipeline started to exceed the capabilities of our previous vector DB.”article, stated
“a lot of team specific terms were critical for providing a quality experience to our users.”article, stated
“Since Danswer is largely a self-hosted software (for data security purposes), the savings on resources allows for more teams to use Danswer”article, stated

Models used: LLMs for chat/search answers · vector embedding models · late-interaction models such as ColBERT

Scale

Alternatives considered (roads not taken)

Vector-only search

Rejected because: It missed team-specific terms that had no general English semantic representation.

“We previously used a vector only search but we discovered that a lot of team specific terms were critical”article, stated

Separate keyword and vector search engines

Rejected because: Separate systems caused weighting issues because signals could not be considered together.

“we added a keyword search that was completely separate from the vector component. But this led to issues of weighting when the two could not be considered together.”article, stated

Post-processing time decay after initial search

Rejected because: The workaround lost accuracy once document scale reached several million.

“applying the time decay after the initial search as a post processing step), but these workarounds often suffered in accuracy once the scale of documents increased past several million.”article, stated

Patterns

rag-retrieval (retrieval)

Danswer retrieves enterprise context before passing it to the LLM.

“retrieving relevant context before passing it to the LLM (Retrieval Augmented Generation - RAG for short).”article, stated

hybrid-search (retrieval)

Vespa normalizes and combines keyword and vector search signals.

“Vespa allows for an easy normalization across multiple search types and finally allowed us to achieve the accuracy we wanted.”article, stated

retrieval-ranking (retrieval)

Danswer uses custom ranking functions including time-decay relevance over document freshness.

“Luckily Vespa has one of the most flexible syntaxes in terms of ranking functions and there were even plenty of examples of this exact use case which make the implementation really easy.”article, stated

cost-aware-routing (operations)

Multi-vector-per-document indexing reduced resource requirements for self-hosted customers.

“This optimization prevents duplication of documents for every section and every chunk size which greatly reduces the resources necessary to serve the document index.”article, stated

Tradeoffs

Search engine

Chose Vespa over previous vector DB and separate keyword/vector engines.

Rationale: Vespa supports normalized hybrid search, custom ranking, multiple vectors per document, and internet-scale operation.

“Of the most established projects, we were looking at OpenSearch, ElasticSearch, Weaviate and Vespa. Vespa was the clear leader in several ways”article, stated

Document representation

Chose multiple vector embeddings per document over duplicating documents for every section/chunk size.

Rationale: The multi-vector approach captures both broad and detailed context while reducing serving resources.

“This means every document is split into different sections for processing and each pass has a different size context.”article, stated

Self-hosted search platform

Chose resource-efficient index design over resource-heavy duplication.

Rationale: Self-hosted customers may lack powerful servers or expensive cloud budgets.

“more teams to use Danswer even if they don’t have access to powerful servers or large budgets for expensive cloud instances.”article, stated

Gotchas (what bit them)

Pure vector search missed important internal terms.

Root cause: Names like internal project or team terms had no useful general-English semantic representation.

Resolution: Add keyword search and then migrate to Vespa to combine keyword and vector signals cleanly.

“Internal names like “Meechum” or “Foundry” were common but had no general English representation that the deep learning models could capture.”article, stated

Stale duplicate documents created conflicting answers.

Root cause: Internal documents are not always cleaned up, leaving multiple versions with conflicting information.

Resolution: Apply flexible time-based decay ranking at search time.

“Since internal documents aren’t always cleaned up correctly, it’s fairly common to run into multiple versions of the same document with conflicting information.”article, stated

Search flexibility increased system complexity.

Root cause: Vespa exposes rich configuration, deployment, and query/indexing options.

Resolution: Use Vespa for core retrieval while moving Danswer Cloud toward Vespa Cloud to offload operational complexity.

“The downside of flexibility is that there is inherently more complexity with all of the configuration, deployment and even query/indexing options.”article, stated

Evaluation

Danswer evaluated the migration through search accuracy, ability to combine keyword/vector signals, ranking flexibility, scale past millions of documents, and resource requirements for self-hosted deployments.

Metrics: search accuracy · hybrid normalization quality · ranking-function flexibility · document-scale accuracy · resource footprint

“Vespa allows for an easy normalization across multiple search types and finally allowed us to achieve the accuracy we wanted.”article, stated
“these workarounds often suffered in accuracy once the scale of documents increased past several million.”article, stated

Outcomes

The source is a vendor/platform article, but it names the migration tradeoffs and feature requirements clearly.

“Vespa allows for an easy normalization across multiple search types and finally allowed us to achieve the accuracy we wanted.”article, stated
“This optimization prevents duplication of documents for every section and every chunk size which greatly reduces the resources necessary to serve the document index.”article, stated