WhoBuilt

When Vectors Break Down: Graph-Based RAG for Dense Enterprise Knowledge

Jul 22, 2025· 16 min· 42K views·Watch on YouTube

Speaker

Sam Julien, Writer’s director of developer relations, explains how Writer developed graph-based RAG for dense enterprise knowledge at an AI Engineer event organized by Swyx and Ben.

Why vector search fell short

Enterprise collections can contain terabytes of specialized documents with little variety in their language. Julien says keyword search and then vector search struggled with inaccurate chunk matches, such as confusing the Macintosh’s 1984 creation with a nearby reference to the Lisa in 1983. Similarity search also struggled to distinguish relevant details across thousands of documents about similar products, such as mobile phones.

Adapting graphs to the team’s constraints

Graph-based retrieval helped preserve relationships between text and provide more context, especially when combined with full-text and similarity search. Building structured graphs at scale proved costly, and the team found complex Cypher queries and graph structures difficult for their needs. Writer trained a specialized model to map data into nodes and edges, improved context-aware splitting, and stored graph data as JSON in a Lucene-based search engine.

Using research to refine retrieval

To address remaining retrieval challenges, the team revisited the original RAG paper and Fusion-in-Decoder, which encodes passages independently and combines their evidence in the decoder. Julien describes research on combining knowledge graphs with Fusion-in-Decoder, including two-stage passage ranking to improve efficiency. Writer implemented its own version, which Julien says helped reduce hallucinations.

Evaluating results and customer features

Writer compared its system, which combined knowledge graphs and Fusion-in-Decoder, with seven vector search systems on Amazon’s RobustQA dataset. Julien reports that Writer’s system had the highest accuracy and fastest response time in that benchmark. The graph structure also supports features that expose snippets, subqueries, and sources, and helps answer multihop questions and questions involving information split across pages.

Lessons from the development process

Julien says teams can use graph relationships in RAG through different implementations, including a graph database or a search engine. He highlights three lessons from Writer’s work: focus on customer needs, adapt solutions to the team’s expertise, and let research challenge assumptions.

Takeaways

  • Test retrieval on the shape of your data: dense collections with similar vocabulary can expose weaknesses that broad benchmarks miss.
  • Preserve relationships and surrounding context when splitting documents, especially when facts span chunks or pages.
  • Choose storage and graph tooling that fit your team’s skills and scale requirements; graph benefits do not require one implementation.
  • Revisit research and first principles when a chosen retrieval approach stops addressing the customer problem.
  • Evaluate retrieval systems on both accuracy and response time, then connect results to useful features such as source visibility and multihop answers.

Mentioned in this talk

Search inside this talk

What was claimed 8

  • built
    “enterprise models, like our Palmyra X5 model”
    YouTube
    Verified2 sources· Talk, Web· archived
  • previously at
    Sam Julien previously at Writer
    Product Manager
    “I’m Sam Julien, the director of developer relations at Writer.”
    YouTube
    Verified3 sources· Talk, Web· archived
  • built
    “practical evaluations, like our finance benchmark called Failsafe QA”
    YouTube
    Unverified1 source· Talk
  • built
    “domain-specific specialization, including models like Palmyra Med and Palmyra Fin”
    YouTube
    Unverified1 source· Talk
  • built
    “domain-specific specialization, including models like Palmyra Med”
    YouTube
    Unverified1 source· Talk
  • built
    “enterprise models, like our Palmyra X5 model”
    YouTube
    Unverified1 source· Talk
  • metric
    Writer: Best accuracy and fastest response time among seven vector search systems in a benchmark using Amazon's RobustQA dataset
    “Last year, we benchmarked using Amazon’s RobustQA dataset”
    YouTube
    Unverified1 source· Talk
  • feature
    Knowledge graph: Supports multihop questions across multiple documents and topics
    “knowledge graphs handle multihop questions, reasoning across multiple documents and topics”
    YouTube
    Unverified1 source· Talk

Related talks