AI-ENGINEERING
    advanced

    GraphRAG

    AI Engineer path · lesson 76 of 124
    The idea
    Flat RAG hands you three index cards that each mention one fact. GraphRAG follows the strings pinned between them on a detective's board — DeepMind to its buyer to that buyer's CEO to the quote.
    How to use
    Run a multi-hop query and watch traversal follow edges across the knowledge graph to reach an answer plain RAG misses.
    QuestionWhat did the CEO of the company that acquired DeepMind say about AI safety?
    Traverse the knowledge graph
    locatedInownsacquired byceosaidDeepMindLondonGoogleYouTubeS. Pichai“safety first”
    Flat RAG — 3 disconnected chunks
    DeepMind is an AI research lab based in London.
    Google has acquired many AI companies over the years.
    A tech CEO recently emphasized putting “safety first”.

    No link between DeepMind → its acquirer → that company’s CEO → the quote. The model can’t bridge the hops.

    GraphRAG answer (connected context)

    Run the traversal to assemble the connected answer…

    Key insight

    Vector RAG found three correct facts but couldn’t connect them. GraphRAG walks the relationships — DeepMind → Google → Pichai → quote — ignoring off-path branches (London, YouTube). Relationships are the thing flat retrieval throws away.

    How GraphRAG answers a global question

    Sequence

    Order the GraphRAG indexing and query path.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    6. 6Drop a step here
    6 pieces left to place

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    Why can flat vector RAG fail on a multi-hop question?

    The short version

    Flat RAG hands you three index cards that each mention one fact. GraphRAG follows the strings pinned between them on a detective's board — DeepMind to its buyer to that buyer's CEO to the quote.

    In more depth

    GraphRAG

    Flat (vector) RAG returns top-k similar chunks independently; for a multi-hop question the pieces live in different chunks with no link. GraphRAG indexes entities and relationships into a knowledge graph (often LLM-extracted) and traverses from the question's entities across edges to gather a connected subgraph. Great for relational and global questions; cost is graph construction. Many systems combine vector recall with graph expansion.

    Interview Questions

    Microsoft
    Neo4j
    Google
    Microsoft
    Palantir
    Microsoft
    LinkedIn
    LinkedIn
    Palantir
    Microsoft

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required