Building Production-Scale AI Search with Knowledge Graphs, MCP, and DSPy

dropbox · Tech · 2026 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.5 (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 AI search and agent context over fragmented work content

Dropbox needed Dash to search, answer, and run agentic queries over proprietary work content scattered across many SaaS applications, while staying fast, ACL-compliant, relevant, and practical within LLM context-window limits.

Constraints:

Architecture

Dropbox Dash is built around a context engine. Custom connectors crawl third-party apps, normalize content into formats such as markdown, extract metadata and embeddings, understand multimodal media where needed, model cross-app relationships into graph-derived knowledge bundles, store chunks, embeddings, and contextual graph representations in secure lexical/vector stores, and apply ranking plus ACL personalization. For agents, Dropbox wraps indexes as MCP-style super tools, stores large tool results locally rather than in LLM context, routes complex queries to narrower sub-agents, evaluates retrieval relevancy with LLM judges aligned to humans, and uses DSPy to optimize judge and platform prompts across the Dash stack.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  work-user[Work user] --> dropbox-dash[Dropbox Dash]
  dropbox-dash --> context-engine[Context engine]
  dropbox-dash --> agentic-query-layer[Agentic query layer]
  third-party-apps[Third-party apps] --> connectors[Connectors]
  connectors --> content-normalization[Content normalization]
  content-normalization --> content-understanding[Content understanding]
  content-understanding --> knowledge-graph-builder[Knowledge graph builder]
  knowledge-graph-builder --> people-model[People model]
  knowledge-graph-builder --> knowledge-bundles[Knowledge bundles]
  content-understanding --> secure-data-stores[Secure data stores]
  knowledge-bundles --> lexical-bm25-index[Lexical BM25 index]
  knowledge-bundles --> vector-store[Vector store]
  secure-data-stores --> lexical-bm25-index
  secure-data-stores --> vector-store
  lexical-bm25-index --> ranking-pipeline[Ranking pipeline]
  vector-store --> ranking-pipeline
  people-model --> ranking-pipeline
  ranking-pipeline --> dropbox-dash
  context-engine --> mcp-super-tool[MCP super tool]
  mcp-super-tool --> lexical-bm25-index
  mcp-super-tool --> vector-store
  mcp-super-tool --> local-tool-result-store[Local tool-result store]
  agentic-query-layer --> mcp-super-tool
  agentic-query-layer --> sub-agent-classifier[Sub-agent classifier]
  sub-agent-classifier --> narrow-sub-agents[Narrow sub-agents]
  ranking-pipeline --> llm-judge[LLM judge]
  human-evaluators[Human evaluators] --> llm-judge
  llm-judge --> dspy-optimizer[DSPy optimizer]
  dspy-optimizer --> prompt-stack[Prompt stack]
  prompt-stack --> agentic-query-layer
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Work user Person searching and asking agentic questions across work content. Dropbox Dash
Dropbox Dash Unified AI search and agent interface for work content across Dropbox and third-party apps. Work user, Context engine, Agentic query layer
Third-party apps External SaaS systems containing proprietary organizational content and access-control rules. Connectors
Connectors Custom crawlers and integrations that ingest content while respecting app-specific APIs, rate limits, ACLs, and permissions. Third-party apps, Content normalization
Content normalization Pipeline that standardizes incoming files into normalized text formats such as markdown. Connectors, Content understanding
Content understanding Extraction and enrichment layer for titles, metadata, links, embeddings, transcription, and multimodal understanding. Content normalization, Knowledge graph builder, Secure data stores
Knowledge graph builder Relationship modeling across apps, people, meetings, attachments, transcripts, notes, and projects. Content understanding, Knowledge bundles, People model
People model Canonical identity layer for resolving people across connected apps. Knowledge graph builder, Ranking pipeline
Knowledge bundles Asynchronously staged summaries or embeddings of graph relationships sent through the normal index pipeline. Knowledge graph builder, Lexical BM25 index, Vector store
Secure data stores Storage layer for embeddings, chunks, contextual graph representations, and ACL-aware retrieval inputs. Content understanding, Lexical BM25 index, Vector store, Ranking pipeline
Lexical BM25 index Lexical retrieval index that Dropbox found very effective with relevant signals. Secure data stores, Ranking pipeline, MCP super tool
Vector store Dense vector storage supporting semantic retrieval and hybrid search. Secure data stores, Ranking pipeline, MCP super tool
Ranking pipeline Multiple ranking passes that personalize retrieved results and enforce ACL policy. Lexical BM25 index, Vector store, People model, Dropbox Dash, LLM judge
Context engine Unified retrieval and context platform made from connectors, understanding, graph bundles, stores, indexes, and ranking. Dropbox Dash, Agentic query layer, MCP super tool
Agentic query layer Agent platform layer that uses context-engine APIs, tools, and sub-agents to answer work queries. Dropbox Dash, Context engine, MCP super tool, Sub-agent classifier
MCP super tool Consolidated retrieval tool that wraps the index to reduce MCP tool-definition overhead. Agentic query layer, Lexical BM25 index, Vector store, Local tool-result store
Local tool-result store Local storage for large tool results that should not be placed directly in the LLM context window. MCP super tool, Agentic query layer
Sub-agent classifier Classifier that chooses a narrow sub-agent and smaller tool set for complex agentic queries. Agentic query layer, Narrow sub-agents
Narrow sub-agents Specialized agents with narrower tool sets for complex agentic queries. Sub-agent classifier, Agentic query layer
LLM judge Relevancy judge scoring retrieved information against queries and human labels. Ranking pipeline, Human evaluators, DSPy optimizer
Human evaluators Engineers and evaluators who label documents and judge disagreement with the LLM judge. LLM judge
DSPy optimizer Prompt optimizer used to improve LLM judge and broader Dash prompts against eval outcomes. LLM judge, Prompt stack
Prompt stack Collection of Dash prompts across ingest, judges, offline evals, and the online agentic platform. DSPy optimizer, Agentic query layer

Data flow

Dash ingests content from third-party apps through custom connectors, normalizes files into markdown-like formats, extracts metadata, links, titles, embeddings, and multimodal understanding, then models relationships across meetings, people, documents, transcripts, and projects. Embeddings, chunks, and graph-derived knowledge bundles flow into secure lexical and vector stores. Query-time ranking personalizes and ACL-filters retrieved results. Agentic queries call the context engine through consolidated MCP super tools, keep large tool results out of the LLM context, and route complex tasks to narrower sub-agents. Retrieval quality is measured with human labels, LLM judges, NDCG, prompt tuning, and DSPy optimization.

5 supporting quotes
“It connects to all your third-party apps and brings it into one place, so you can search, get answers, and do the agentic queries”article, stated
“we normalize a lot of the different files that come in and get it into a format like markdown. Then, we’re looking at extracting key information. We're going to be looking at titles, metadata, trying to extract links, and generate different embeddings. For”article, stated
“all that information (embeddings, chunks, contextual graph representations) flows into our highly secure data stores”article, stated
“we apply multiple ranking passes on any retrieved results so they are personalized and ACL’d to you. Altogether,”article, stated
“around a tool. Let's call it a super tool. And so instead of 5-10 different retrieval tools, we just have one. This helps a ton with cleaning things up overall. * Modeling data within knowledge graphs can significantly cut our token usage as well, because you're really just getting”article, stated

Why this architecture

Dropbox chose a heavy index/context-engine architecture because Dash needs company-wide shared content, enrichment at ingestion time, offline ranking experiments, fast query performance, ACL enforcement, graph-derived context, and controllable agent context windows. Federated retrieval was easier to start, but the team judged it too dependent on heterogeneous APIs and too costly in tokens for complex MCP/chatbot usage.

5 supporting quotes
“over this amount of information. On the flip side, with index-based retrieval, you do now have access to those company connectors. And because you have time on your side, you can pre-process that content and create these really interesting enriched data sets that don't exist on their own. You”article, stated
“you can pre-process that content and create these really interesting enriched data sets that don't exist on their own.”article, stated
“content and create these really interesting enriched data sets that don't exist on their own. You can also do a lot more offline ranking experiments. You can try different methods to improve your recall, and it’s very, very fast. But it's also a ton of work—and a lot of”article, stated
“more offline ranking experiments. You can try different methods to improve your recall, and it’s very, very fast. But it's also a ton of work—and a lot of custom work. This is not for the faint of heart. You have to write a lot of custom”article, stated
“using a lot of chatbots today with MCP, you're going to see that token count go up and up. It takes a lot of tokens to reason over this amount of information. On the flip side, with index-based retrieval, you do now have access to those company connectors. And because you have”article, stated

Models used: LLMs · CLIP-based models · Multimodal models · OpenAI o3 · DSPy-optimized models · Planning LLM · Sub-agent models

Scale

Alternatives considered (roads not taken)

Federated retrieval

Rejected because: It is easy to start and fresh, but depends on varied API speed, quality, ranking, and access limits, and requires heavy query-time post-processing.

3 supporting quotes
“ingestion time? That's index-based retrieval. And there are pros and cons to each approach. Federated retrieval is very easy to get up and running. You don't have to worry about storage costs. The data is mostly fresh. You can keep adding more MCP servers and new connectors.”article, stated
“You're at the mercy of all these different APIs or MCP servers which are going to differ in speed, quality, and ranking.”article, stated
“company-wide connectors—meaning you can’t access content that’s shared across the whole company. And you have to do a lot of work on-the-fly in the post-processing. Once the data comes back, you have to merge information and potentially do re-ranking. And if you're using a lot of chatbots”article, stated

Graph database for knowledge graphs

Rejected because: Latency, query patterns, and hybrid retrieval integration were challenging.

“characteristics. And the other key insight here is we're not storing these graphs in a graph database. We did experiment with that. The latency and query pattern were a challenge. Trying to figure out that hybrid retrieval was a challenge. And so we ended up building these graphs in a more unique”article, stated
“The latency and query pattern were a challenge. Trying to figure out that hybrid retrieval was a challenge. And so we ended up building these graphs in a more unique way. We’re staging it more asynchronously, we're building out these relationships, and then”article, stated

Many separate MCP retrieval tools

Rejected because: Tool definitions consume valuable context-window space and degrade chat/agent effectiveness.

“MCP tool definitions, in particular, take up valuable real estate in your context window.”article, stated
“We've got our index, and we can wrap that around a tool. Let's call it a super tool. And so instead of 5-10 different retrieval tools, we just have one. This helps a ton with cleaning things up overall. * Modeling data within knowledge graphs can significantly cut our token”article, stated

Put full tool results into the LLM context

Rejected because: Tool results can be huge, so Dropbox stores them locally and avoids filling the context window.

“Tool results come back with a huge amount of context, so we actually choose to store that locally. We do not put that in the LLM context window. * Finally, we use a lot of sub-agents for very complex agentic queries, and have a classifier effectively pick”article, stated
“results come back with a huge amount of context, so we actually choose to store that locally. We do not put that in the LLM context window. * Finally, we use a lot of sub-agents for very complex agentic queries, and have a classifier effectively pick the sub-agent”article, stated

Manual prompt whack-a-mole

Rejected because: With dozens of prompts and many engineers, hand-editing strings for edge cases breaks at scale.

“then there's an edge case, this chat session didn't work. So you go in and fix it, but then something else breaks”article, stated
“it's very powerful to just define things in a more of a programmatic way and let these tools spit out the actual prompt themselves.”article, stated

Patterns

rag-retrieval (context-engineering)

Dash builds a context engine that retrieves proprietary work content and graph context for search, answers, and agentic queries.

“ Altogether, this is what we call our context engine. And once you have that, you can introduce APIs on top of it and [build entire products like”article, stated
“It connects to all your third-party apps and brings it into one place”article, stated

hybrid-search (retrieval)

Dropbox combines BM25 lexical retrieval with dense vector storage and hybrid ranking.

“Today we use both a lexical index—using BM25—and then store everything as dense vectors in a vector store.”article, stated
“While this allows us to do hybrid retrieval, we found BM25 was very effective on its own with some relevant signals.”article, stated

retrieval-ranking (retrieval)

The system applies multiple personalized, ACL-aware ranking passes and uses NDCG and judge scores to improve relevance.

“we apply multiple ranking passes on any retrieved results so they are personalized and ACL’d to you.”article, stated
“we use normalized discounted cumulative gain (NDCG) a lot to score the results to retrieve.”article, stated

llm-as-judge (evaluation)

Dropbox scores retrieved information for relevance with an LLM judge and iteratively reduces disagreement with human labels.

“That's where you want to use LLMs as a judge.”article, stated
“How accurate can we get our judge to match what a human will do?”article, stated

tool-use-orchestration (agent-architecture)

Dash wraps the index as a super tool and uses classifiers/sub-agents to keep each agent's tool set narrow.

“* We've got our index, and we can wrap that around a tool. Let's call it a super tool. And so instead of 5-10 different retrieval tools, we just have one.”article, stated
“have a classifier effectively pick the sub-agent with a much more narrow set of tools.”article, stated

context-compaction (context-engineering)

Dropbox reduces context pressure by graph-bundling relationships, consolidating tools, and keeping large tool results out of the LLM context.

“Modeling data within knowledge graphs can significantly cut our token usage as well”article, stated
“We do not put that in the LLM context window. * Finally, we use a lot of sub-agents for very complex agentic queries, and have a classifier effectively pick the sub-agent with a much more narrow set of tools.”article, stated

eval-driven-development (evaluation)

Human labels, judge disagreement, prompt tuning, model upgrades, and DSPy optimization form a measurement-driven retrieval-improvement loop.

3 supporting quotes
“And so we had a bunch of our engineers label a ton of documents to see how much of a disagreement there was between the human and the LLM as a judge.”article, stated
“Then, we just upgraded the model itself to OpenAI’s o3. It's a reasoning model, far more powerful, and guess what?”article, stated
“So by bringing in DSPy, we got even better results overall. It might be impossible to get to zero disagreements.”article, stated

model-routing (model-operations)

The platform expects different planning and sub-agent models, with DSPy helping regenerate prompts for model switching.

“you just don't have one giant LLM. You're going to have a planning LLM, you're going to have all these smaller sub-agents”article, stated
“anytime you bring in a new model, you have to spend a bunch of time optimizing the prompt again.”article, stated

Tradeoffs

Choose index-based retrieval

Chose Pre-processing content at ingestion time over Federated query-time retrieval.

Rationale: Indexing is much more work, but it enables company-wide content, enriched datasets, offline ranking experiments, and fast query-time retrieval.

3 supporting quotes
“That's index-based retrieval. And there are pros and cons to each approach.”article, stated
“You can also do a lot more offline ranking experiments. You can try different methods to improve your recall, and it’s very, very fast.”article, stated
“This is not for the faint of heart. You have to write a lot of custom connectors. As for ingestion time, you're going to have freshness issues if you're not good with understanding rate limits.”article, stated

Use BM25 alongside vectors

Chose Lexical BM25 plus dense vector storage over Pure vector-only retrieval.

Rationale: Hybrid retrieval is supported, but Dropbox found BM25 alone highly effective with the right signals.

“Today we use both a lexical index—using BM25—and then store everything as dense vectors in a vector store.”article, stated
“we found BM25 was very effective on its own with some relevant signals.”article, stated

Represent graph context as knowledge bundles

Chose Asynchronous graph-derived bundles passed through the index pipeline over Serving directly from a graph database.

Rationale: The bundle approach avoided graph database latency and hybrid-query challenges while still adding relationship context.

“And so we ended up building these graphs in a more unique way. We’re staging it more asynchronously, we're building out these relationships, and then we create these knowledge bundles.”article, stated
“we actually just send it on through the exact same index pipeline that we have for all the other content.”article, stated

Consolidate MCP retrieval

Chose One index-backed super tool and narrow sub-agents over Many retrieval tools exposed directly to the LLM.

Rationale: This reduces tool-definition context overhead and gives complex queries a smaller, more relevant tool set.

“And so instead of 5-10 different retrieval tools, we just have one. This helps a ton with cleaning things up overall.”article, stated
“have a classifier effectively pick the sub-agent with a much more narrow set of tools.”article, stated

Let the judge retrieve context too

Chose RAG as a judge over A judge relying only on precomputed or pretrained knowledge.

Rationale: Workplace acronyms and local context may be unknown to the judge, so it sometimes needs retrieval before scoring relevance.

“Sometimes, the judge needs to go get that context. And so, this is a little tongue-in-cheek, but we call this RAG as a judge.”article, stated
“And so, this is a little tongue-in-cheek, but we call this RAG as a judge. It can't just be using pre-computed information.”article, stated

Use DSPy for prompt optimization

Chose Programmatic prompt optimization over evals over Manual prompt-string editing for every edge case and model switch.

Rationale: DSPy improved LLM-judge results, helped manage dozens of prompts, and makes model switching faster.

“It helps optimize your prompts. It tries to get the most accurate information based on a set of evals.”article, stated
“But with DSPy, you just plug the model in, define your goals, and out spits the prompt”article, stated

Gotchas (what bit them)

LLMs cannot answer work questions if proprietary content is outside their reach.

Root cause: Work content is scattered across walled gardens and SaaS applications.

Resolution: Use connectors and a context engine to bring third-party work content into one searchable, ACL-aware place.

“they don’t have access to your content. All of your work content is proprietary.”article, stated
“It connects to all your third-party apps and brings it into one place”article, stated

Connectors are not commodity plumbing.

Root cause: Every app has its own rate limits, API quirks, ACLs, and permissions.

Resolution: Invest in custom crawlers and connector engineering before relying on downstream retrieval quality.

“It’s not easy. Everything has its own rate limit, each has its own unique API quirks, each has its own ACL and permission system”article, stated
“But getting that right is essential and getting all that content in one place is the goal. Next, we're doing a lot of content understanding—and in certain cases, enriching the content itself.”article, stated

MCP can rot the context window.

Root cause: Tool definitions and returned retrieval content quickly consume context budget.

Resolution: Cap context, consolidate retrieval into super tools, use graph context, store large tool results locally, and route to narrow sub-agents.

3 supporting quotes
“MCP tool definitions, in particular, take up valuable real estate in your context window.”article, stated
“We’re noticing quite a bit of degradation in the effectiveness of our chat and agents (very classic context rot).”article, stated
“Really guard your context window. * Investing in effective LLM judges is incredibly important. A lot of times that initial prompt is all people do.”article, stated

Graph databases were not the practical retrieval substrate.

Root cause: Latency, query patterns, and hybrid retrieval were hard to make work.

Resolution: Build graph relationships asynchronously into knowledge bundles that flow through the same index pipeline.

3 supporting quotes
“we're not storing these graphs in a graph database. We did experiment with that.”article, stated
“The latency and query pattern were a challenge. Trying to figure out that hybrid retrieval was a challenge. And so we ended up building these graphs in a more unique way.”article, stated
“We’re staging it more asynchronously, we're building out these relationships, and then we create these knowledge bundles. So again, it's not necessarily a graph, but think of it almost like an embedding—like a summary of that graph.”article, stated

Human click signals disappear when retrieval serves an LLM instead of a person.

Root cause: Chat systems retrieve context for the model, so humans no longer directly click retrieved documents to indicate relevance.

Resolution: Use LLM-as-judge plus human evaluator labels to score relevancy and train improvement loops.

“In the world of chat, you're still retrieving results, but it's not for the human. It's for this large language model.”article, stated
“And so you no longer have those humans to help us out. So what do you do? That's where you want to use [LLMs as a judge](https:”article, stated

Prompt editing becomes whack-a-mole at stack scale.

Root cause: Many prompts and many engineers create regressions when edge-case fixes are hardcoded as text strings.

Resolution: Use programmatic prompt optimization with DSPy and eval-defined objectives.

“we might have 5 to 15 different engineers tweaking these prompts”article, stated
“then something else breaks, and it becomes a bit of a whack-a-mole.”article, stated

Evaluation

Dropbox evaluates retrieval and agent context quality through NDCG scoring, human document labels, LLM-as-judge relevancy scoring, disagreement analysis, prompt tuning, model upgrades such as OpenAI o3, RAG-assisted judges, and DSPy prompt optimization. Prompt optimizers are especially applied where rubrics and eval outcomes are crisp, such as LLM-as-judge.

Metrics: NDCG · Human/LLM judge disagreement rate · One-to-five relevance scores · Human thumbs up/down feedback · Human evaluator labels · Prompt optimization eval outcomes · Model-upgrade judge agreement · Retrieval recall · Context-window token usage · Query latency

5 supporting quotes
“we use normalized discounted cumulative gain (NDCG) a lot to score the results to retrieve.”article, stated
“judge how relevant a piece of information is between, say, one and five”article, stated
“The first prompt for our judge wasn’t bad—8% disagreed—but the lower, the better.”article, stated
“Disagreements with the humans went down further. Finally, a big problem with using an LLM as a judge in a work context is that it doesn't know things like acronyms.”article, stated
“Again, that's a prime place to think about DSPy right now, because LLMs as a judge have very crystal clear rubrics and evals. You know exactly what the outcome should be.”article, stated

Outcomes

The source reports 50+ tabs and 50+ SaaS accounts as the motivating user problem, a roughly 100K-token context cap, simple MCP queries taking up to 45 seconds versus raw index retrieval within seconds, consolidation from 5-10 retrieval tools to one super tool, 8% initial judge disagreement, over 30 prompts, 5-15 engineers editing prompts, and several years of work by a large engineering team.

5 supporting quotes
“We do find the index is superior. It is a lot of work, so don’t approach this lightly.”article, stated
“While this allows us to do hybrid retrieval, we found BM25 was very effective on its own with some relevant signals. It’s an amazing workhorse for building out an index.”article, stated
“But just by doing this people-based result we saw some really nice wins. The architecture itself is complicated.”article, stated
“So by bringing in DSPy, we got even better results overall. It might be impossible to get to zero disagreements.”article, stated
“* Prompt optimizers do work at scale. They work at any scale, but they’re absolutely essential at scale. My final, overall takeaway is the classic software engineering concept of:”article, stated