[{"data":1,"prerenderedAt":1124},["ShallowReactive",2],{"post-rag-graphrag-connect-ai-data-en":3,"surround-/en/blog/rag-graphrag-connect-ai-data-en":1114,"post-translations-25":1119},{"id":4,"title":5,"body":6,"canonical_id":1094,"category":1095,"date_created":1096,"date_updated":1097,"description":1098,"extension":1099,"head":1100,"image":1101,"lang":1102,"layout":1103,"meta":1104,"navigation":1105,"ogImage":1100,"path":1106,"reading_time":1107,"robots":1100,"schemaOrg":1100,"seo":1108,"sitemap":1110,"stem":1112,"__hash__":1113},"blog/en/blog/25.rag-graphrag-connect-ai-data.md","RAG and GraphRAG: How to Connect AI to Your Data",{"type":7,"value":8,"toc":1065},"minimark",[9,22,33,40,43,48,51,58,61,66,69,98,101,105,108,111,183,186,190,193,196,199,212,220,223,268,271,275,278,282,285,296,299,302,306,309,312,315,318,345,349,352,355,366,369,372,376,379,393,396,399,402,405,409,412,419,430,469,472,475,479,482,485,496,499,503,506,509,512,523,526,530,533,540,568,571,595,598,608,612,615,618,634,660,663,667,670,674,677,688,691,695,702,709,712,716,719,726,771,774,778,781,798,801,805,808,811,815,907,911,914,917,928,931,939,942,950,954,960,964,1061],[10,11,12,16,17,21],"p",{},[13,14,15],"strong",{},"RAG"," (",[18,19,20],"em",{},"Retrieval-Augmented Generation",") is a software architecture pattern that allows an AI application, such as an AI chatbot, to search your own content before answering. Instead of relying only on the knowledge of its model, it retrieves relevant passages and adds them to its context.",[10,23,24,25,32],{},"This is the principle I use in ",[13,26,27],{},[28,29,31],"a",{"href":30},"/en/blog/from-idea-to-saas-why-building-begonia-pro-local-seo","Begonia.pro",", my local SEO SaaS. Its AI chatbot searches the Begonia.pro blog articles and website content to provide accurate and up-to-date information, without the model having been retrained on Begonia's content.",[10,34,35,36,39],{},"Another RAG-derived architecture recently caught my attention: ",[13,37,38],{},"GraphRAG",", which I am currently testing. This technique does more than search for passages similar to a question. It also uses the relationships between concepts, entities, and documents.",[10,41,42],{},"In this article, I will explain how these two solutions for AI applications work, how to implement them, and when to choose one over the other.",[44,45,47],"h2",{"id":46},"rag-retrieve-before-generating","RAG: retrieve before generating",[10,49,50],{},"The term RAG comes from a research paper published in 2020. The principle is to supplement the knowledge learned by the model with an external source that the application queries when it needs to answer.",[10,52,53,54,57],{},"This source can be a vector database, a search engine, a SQL database, or an API. ",[13,55,56],{},"RAG therefore does not necessarily mean using a vector database."," The essential part is retrieving relevant information and adding it to the model's context.",[10,59,60],{},"A standard RAG implementation separates two pipelines.",[62,63,65],"h3",{"id":64},"the-indexing-pipeline-prepares-the-knowledge","The indexing pipeline prepares the knowledge",[10,67,68],{},"Before a user asks a question, the application prepares its sources:",[70,71,72,76,79,86,89,95],"ol",{},[73,74,75],"li",{},"collect the relevant pages, articles, files, or records;",[73,77,78],{},"extract and clean their content;",[73,80,81,82,85],{},"split them into coherent passages called ",[18,83,84],{},"chunks",";",[73,87,88],{},"retain their metadata: title, URL, language, date, and access rights;",[73,90,91,92,85],{},"transform each passage into a numerical representation, or ",[18,93,94],{},"embedding",[73,96,97],{},"store the text, its metadata, and its embedding in an index.",[10,99,100],{},"An embedding transforms text into a numerical vector designed to capture its meaning. Semantic search can therefore retrieve passages related to a question even when they use different words. For example, it may connect a question about visibility on Google Maps with content about local SEO.",[62,102,104],{"id":103},"the-response-pipeline-searches-before-calling-the-llm","The response pipeline searches before calling the LLM",[10,106,107],{},"When a question arrives, the application searches for relevant passages, ranks them, and sends the best ones to the model along with the question. The answer can then cite the sources it used.",[10,109,110],{},"The full process can be summarized as follows:",[112,113,118],"pre",{"className":114,"code":115,"language":116,"meta":117,"style":117},"language-mermaid shiki shiki-themes enchanter-dark","flowchart LR\n    A[\"Authorized documents\"] --> B[\"Split into passages\"]\n    B --> C[\"Create embeddings\"]\n    C --> D[(\"Index\")]\n    E[\"Question\"] --> F[\"Search\"]\n    D --> F\n    F --> G[\"Relevant passages\"]\n    G --> H[\"LLM\"]\n    E --> H\n    H --> I[\"Answer with sources\"]\n","mermaid","",[119,120,121,129,135,141,147,153,159,165,171,177],"code",{"__ignoreMap":117},[122,123,126],"span",{"class":124,"line":125},"line",1,[122,127,128],{},"flowchart LR\n",[122,130,132],{"class":124,"line":131},2,[122,133,134],{},"    A[\"Authorized documents\"] --> B[\"Split into passages\"]\n",[122,136,138],{"class":124,"line":137},3,[122,139,140],{},"    B --> C[\"Create embeddings\"]\n",[122,142,144],{"class":124,"line":143},4,[122,145,146],{},"    C --> D[(\"Index\")]\n",[122,148,150],{"class":124,"line":149},5,[122,151,152],{},"    E[\"Question\"] --> F[\"Search\"]\n",[122,154,156],{"class":124,"line":155},6,[122,157,158],{},"    D --> F\n",[122,160,162],{"class":124,"line":161},7,[122,163,164],{},"    F --> G[\"Relevant passages\"]\n",[122,166,168],{"class":124,"line":167},8,[122,169,170],{},"    G --> H[\"LLM\"]\n",[122,172,174],{"class":124,"line":173},9,[122,175,176],{},"    E --> H\n",[122,178,180],{"class":124,"line":179},10,[122,181,182],{},"    H --> I[\"Answer with sources\"]\n",[10,184,185],{},"The large language model (LLM) still generates the answer. RAG does not guarantee that it will tell the truth: it gives the model more accurate and up-to-date context.",[44,187,189],{"id":188},"the-begoniapro-rag-system-as-an-example","The Begonia.pro RAG system as an example",[10,191,192],{},"On Begonia.pro, I publish content about local SEO: Google Business Profiles, reviews, how to optimize a business website, and visibility in traditional search engines or AI systems.",[10,194,195],{},"With RAG, a question such as “How should I complete my Google Business Profile?” triggers a search through Begonia.pro's content. The model receives the most relevant passages with their titles and URLs, then builds its answer from that context.",[10,197,198],{},"This system provides precise answers based on reliable, up-to-date information while citing its sources. It is used in two features of my SaaS:",[200,201,202,205],"ul",{},[73,203,204],{},"The Begonia.pro chatbot in the user interface",[73,206,207,208,211],{},"The MCP server and its ",[119,209,210],{},"search_local_seo_knowledgebase"," tool for agents",[10,213,214,215,219],{},"I explained in ",[28,216,218],{"href":217},"/en/blog/mcp-server-saas-feedback","my experience building MCP servers for my SaaS products"," why I prefer exposing targeted search instead of sending an entire knowledge base to the agent.",[10,221,222],{},"The two uses complement each other:",[224,225,226,242],"table",{},[227,228,229],"thead",{},[230,231,232,236,239],"tr",{},[233,234,235],"th",{},"Surface",[233,237,238],{},"Who controls the search?",[233,240,241],{},"Where does the answer appear?",[243,244,245,257],"tbody",{},[230,246,247,251,254],{},[248,249,250],"td",{},"Begonia.pro chatbot",[248,252,253],{},"The application",[248,255,256],{},"In the SaaS",[230,258,259,262,265],{},[248,260,261],{},"MCP tool",[248,263,264],{},"A compatible agent",[248,266,267],{},"In ChatGPT, Claude, Codex, or another client",[10,269,270],{},"The search engine remains the same. Only the interface and the system calling it change.",[44,272,274],{"id":273},"a-first-rag-implementation-should-remain-simple","A first RAG implementation should remain simple",[10,276,277],{},"To understand how to build a RAG system, follow the information journey: define the questions to handle, prepare the content, index it, retrieve useful passages, and send them to the model.",[62,279,281],{"id":280},"_1-start-with-concrete-questions","1. Start with concrete questions",[10,283,284],{},"Before building the system, I list the questions the AI chatbot will need to answer. For Begonia.pro, they might include:",[200,286,287,290,293],{},[73,288,289],{},"“How should I choose the primary category for my Google Business Profile?”",[73,291,292],{},"“How should I respond to a negative review?”",[73,294,295],{},"“What should I improve to rank better in search engines?”",[10,297,298],{},"I also add a question whose answer does not exist in the content. The chatbot must then recognize that it does not have enough information.",[10,300,301],{},"This list simply defines what the RAG system must be able to do. It then helps verify whether the system retrieves the right passages and answers correctly from those sources.",[62,303,305],{"id":304},"_2-prepare-passages-that-retain-their-meaning","2. Prepare passages that retain their meaning",[10,307,308],{},"Chunking directly affects search quality.",[10,310,311],{},"A chunk that is too long may mix several topics. A chunk that is too short may lose the information needed to understand what the text is about.",[10,313,314],{},"For Markdown articles, I prefer to follow the editorial structure: title, introduction, sections, and paragraphs. Each passage should make sense without requiring the reader to guess what appeared three paragraphs earlier.",[10,316,317],{},"Each passage should retain at least the document identifier, title, section, canonical URL, language, and update date. This metadata is used to filter the search and provide accurate citations.",[319,320,324,325],"div",{"className":321},[322,323],"text-center","mx-auto","\n    ",[326,327,328,329,328,334,328,338,324],"picture",{},"\n      ",[330,331],"source",{"srcSet":332,"type":333},"/img/blog/illustration/rag-chunking.avif","image/avif",[330,335],{"srcSet":336,"type":337},"/img/blog/illustration/rag-chunking.webp","image/webp",[339,340],"img",{"src":341,"alt":342,"loading":343,"className":344},"/img/blog/illustration/rag-chunking.jpg","Illustration comparing an oversized chunk, undersized chunks, and balanced chunks for RAG","lazy",[323],[62,346,348],{"id":347},"_3-index-the-passages","3. Index the passages",[10,350,351],{},"Once the passages are ready, the application sends them to an embedding model. For each passage, the model produces a vector: a series of numbers representing its meaning. Two passages about similar topics will therefore have similar vectors, even if they do not use exactly the same words.",[10,353,354],{},"The application then stores three elements in the index:",[200,356,357,360,363],{},[73,358,359],{},"the vector used for search;",[73,361,362],{},"the original text that will be sent to the LLM;",[73,364,365],{},"metadata such as the title, URL, language, or date.",[10,367,368],{},"During the initial indexing process, the entire corpus is processed. Later, only the affected passages need to be updated when content is added or modified. When content is deleted, its passages should be removed from the index.",[10,370,371],{},"At this stage, the LLM is not generating any answers. The goal is simply to prepare an index that the application can search quickly when a question arrives.",[62,373,375],{"id":374},"_4-search-select-then-generate","4. Search, select, then generate",[10,377,378],{},"When a question arrives, the application transforms it into an embedding using the same model that indexed the passages. The index then compares this vector with those in the database and ranks the results by similarity.",[10,380,381,382,385,386,389,390,392],{},"The application requests the first ",[119,383,384],{},"k"," results, known as the ",[13,387,388],{},"top-k",". With a ",[119,391,388],{}," of 5, for example, it retrieves the five highest-ranked passages and adds them to the LLM's context along with the question and their sources.",[10,394,395],{},"There is no ideal value for every RAG system. Too few passages may leave out useful information. Too many increase the number of tokens and can add noise to the context. I would start with a small value and adjust it using the test questions defined earlier.",[10,397,398],{},"Before calling the LLM, the application can also remove results that do not meet the language, access rights, or minimum relevance requirements. For private documents, this control must happen before the passages are sent to the model. The LLM therefore receives only the selected passages and must indicate when those sources are insufficient to answer.",[10,400,401],{},"Vector search can be combined with keyword search such as BM25. Embeddings capture the overall meaning, while keywords remain useful for a product name, acronym, or exact phrase.",[10,403,404],{},"For a small, well-structured corpus, this initial ranking may be enough. If tests show that the right passage is retrieved but regularly appears behind less useful results, adding a second ranking stage can help.",[62,406,408],{"id":407},"_5-optional-improve-ranking-with-a-cross-encoder","5. Optional: improve ranking with a cross-encoder",[10,410,411],{},"This step is an advanced optimization, not a requirement for building a RAG system.",[10,413,414,415,418],{},"The vector search described so far generally uses a ",[13,416,417],{},"bi-encoder",". It transforms the question and passages into vectors separately, then compares their similarity. This method is fast because passage embeddings were already calculated during indexing. However, it may select texts that discuss the right topic without answering the question precisely.",[10,420,421,422,425,426,429],{},"A ",[13,423,424],{},"cross-encoder"," works differently: it reads the question and a passage together to determine more precisely whether the passage answers the request. It repeats this operation for every result from the initial search, then ranks them again. This step is called ",[13,427,428],{},"reranking",".",[112,431,433],{"className":114,"code":432,"language":116,"meta":117,"style":117},"flowchart LR\n    A[\"Question\"] --> B[\"Bi-encoder or hybrid search\"]\n    B --> C[\"For example: 20 to 50 candidates\"]\n    C --> D[\"Cross-encoder\"]\n    D --> E[\"For example: 5 to 10 passages\"]\n    E --> F[\"LLM\"]\n    F --> G[\"Answer\"]\n",[119,434,435,439,444,449,454,459,464],{"__ignoreMap":117},[122,436,437],{"class":124,"line":125},[122,438,128],{},[122,440,441],{"class":124,"line":131},[122,442,443],{},"    A[\"Question\"] --> B[\"Bi-encoder or hybrid search\"]\n",[122,445,446],{"class":124,"line":137},[122,447,448],{},"    B --> C[\"For example: 20 to 50 candidates\"]\n",[122,450,451],{"class":124,"line":143},[122,452,453],{},"    C --> D[\"Cross-encoder\"]\n",[122,455,456],{"class":124,"line":149},[122,457,458],{},"    D --> E[\"For example: 5 to 10 passages\"]\n",[122,460,461],{"class":124,"line":155},[122,462,463],{},"    E --> F[\"LLM\"]\n",[122,465,466],{"class":124,"line":161},[122,467,468],{},"    F --> G[\"Answer\"]\n",[10,470,471],{},"The cross-encoder is only applied to a few dozen candidates because rereading every passage in the database would be too slow and expensive. Its goal is to reduce noise before sending the context to the LLM.",[10,473,474],{},"This optimization has two limitations: it adds latency and cannot retrieve a passage that was missing from the initial selection. The same questions should therefore be tested with and without reranking to determine whether the improvement is real.",[44,476,478],{"id":477},"how-can-you-verify-that-a-rag-system-works","How can you verify that a RAG system works?",[10,480,481],{},"A poor answer does not always come from the LLM. The information may be missing or outdated, the search may fail to retrieve the right passage, or the model may misuse the context it received.",[10,483,484],{},"Using the questions prepared at the beginning, I therefore check separately:",[200,486,487,490,493],{},[73,488,489],{},"whether the correct passage appears among the first results;",[73,491,492],{},"whether the answer remains faithful to the provided passages and cites the correct sources;",[73,494,495],{},"whether the chatbot recognizes that information is missing when no source can answer the question.",[10,497,498],{},"The same set of questions can then be used to compare each change: new chunking, hybrid search, reranking, or GraphRAG.",[44,500,502],{"id":501},"why-vector-rag-reaches-its-limits","Why vector RAG reaches its limits",[10,504,505],{},"Vector search retrieves content that is semantically similar to the question. It does not explicitly represent the relationships contained in the documents.",[10,507,508],{},"For example, three documents may indicate that a component depends on a service and that a failure of this service caused several incidents. Vector search may retrieve one or two passages and miss the complete chain.",[10,510,511],{},"This limitation mainly appears with:",[200,513,514,517,520],{},[73,515,516],{},"relational questions: “Which components depend on this service, and which documents describe them?”",[73,518,519],{},"multi-step questions: “Which incidents share the same cause, and which products were affected?”",[73,521,522],{},"global questions: “Which themes recur throughout this knowledge base?”",[10,524,525],{},"This is where GraphRAG comes in.",[44,527,529],{"id":528},"graphrag-adds-a-map-of-relationships","GraphRAG adds a map of relationships",[10,531,532],{},"GraphRAG refers to a family of architectures that use a graph to retrieve context.",[10,534,535,536,539],{},"In a ",[13,537,538],{},"knowledge graph",", information is represented by:",[200,541,542,545,565],{},[73,543,544],{},"nodes, such as a company, product, component, incident, or document;",[73,546,547,548,551,552,551,555,551,558,561,562,85],{},"relationships, such as ",[119,549,550],{},"DEPENDS_ON",", ",[119,553,554],{},"CAUSES",[119,556,557],{},"EXPLAINS",[119,559,560],{},"CITES",", or ",[119,563,564],{},"RELATES_TO",[73,566,567],{},"properties, such as a name, date, importance, or URL.",[10,569,570],{},"Information no longer exists only inside a paragraph. It can be expressed as a relationship that can be queried:",[112,572,574],{"className":114,"code":573,"language":116,"meta":117,"style":117},"flowchart LR\n    A[\"Web application\"] -- \"DEPENDS_ON\" --> B[\"Authentication service\"]\n    B -- \"CAUSED\" --> C[\"June 12 incident\"]\n    D[\"Architecture guide\"] -- \"EXPLAINS\" --> B\n",[119,575,576,580,585,590],{"__ignoreMap":117},[122,577,578],{"class":124,"line":125},[122,579,128],{},[122,581,582],{"class":124,"line":131},[122,583,584],{},"    A[\"Web application\"] -- \"DEPENDS_ON\" --> B[\"Authentication service\"]\n",[122,586,587],{"class":124,"line":137},[122,588,589],{},"    B -- \"CAUSED\" --> C[\"June 12 incident\"]\n",[122,591,592],{"class":124,"line":143},[122,593,594],{},"    D[\"Architecture guide\"] -- \"EXPLAINS\" --> B\n",[10,596,597],{},"The system can start from an entity detected in the question, follow its relationships, and retrieve the associated passages.",[10,599,600,601,604,605,607],{},"However, the term has two meanings that must be distinguished. ",[13,602,603],{},"Graph RAG"," refers to the general architecture pattern that uses a graph for retrieval. ",[13,606,38],{}," is also the name of Microsoft Research's open-source implementation, which provides its own indexing and search method.",[44,609,611],{"id":610},"microsofts-graphrag-implementation-goes-from-local-to-global","Microsoft's GraphRAG implementation goes from local to global",[10,613,614],{},"Microsoft GraphRAG transforms documents into entities, relationships, and communities. It then summarizes these groups at several levels and also creates embeddings for certain types of search.",[10,616,617],{},"This preparation enables several query modes.",[319,619,324,621],{"className":620},[322,323],[326,622,328,623,328,626,328,629,324],{},[330,624],{"srcSet":625,"type":333},"/img/blog/illustration/graphrag-local-global-search.avif",[330,627],{"srcSet":628,"type":337},"/img/blog/illustration/graphrag-local-global-search.webp",[339,630],{"src":631,"alt":632,"loading":343,"className":633},"/img/blog/illustration/graphrag-local-global-search.jpg","Illustration of local, global, and progressive searches in a knowledge graph",[323],[200,635,636,642,648,654],{},[73,637,638,641],{},[13,639,640],{},"Local Search"," combines the graph and source passages for a targeted question.",[73,643,644,647],{},[13,645,646],{},"Global Search"," summarizes community reports to answer questions about the entire corpus.",[73,649,650,653],{},[13,651,652],{},"DRIFT Search"," starts with a general view, then progressively explores related details.",[73,655,656,659],{},[13,657,658],{},"Basic Search"," provides simple vector search as a point of comparison.",[10,661,662],{},"This implementation therefore solves a more specific problem than simply “making RAG better”: producing a question-focused summary when the answer depends on a large part of the corpus.",[44,664,666],{"id":665},"how-to-implement-a-graphrag-approach","How to implement a GraphRAG approach",[10,668,669],{},"For illustration, I use Microsoft's GraphRAG architecture as the reference.",[62,671,673],{"id":672},"_1-check-whether-the-need-justifies-a-graph","1. Check whether the need justifies a graph",[10,675,676],{},"I would start by preparing a few questions that vector RAG struggles to answer:",[200,678,679,682,685],{},[73,680,681],{},"which incidents share the same technical dependency?",[73,683,684],{},"which decisions affected several products or teams?",[73,686,687],{},"which themes recur across all customer feedback?",[10,689,690],{},"These questions require connecting several pieces of information or summarizing a large portion of the documents. If a standard RAG system already answers them correctly, the graph may not be necessary.",[62,692,694],{"id":693},"_2-prepare-the-documents","2. Prepare the documents",[10,696,697,698,701],{},"As in a standard RAG system, documents are split into passages. Microsoft calls them ",[13,699,700],{},"TextUnits",". Each passage remains linked to its original document so the source can be retrieved and cited.",[10,703,704,705,708],{},"You must also specify the important elements to identify in these texts. These are the ",[13,706,707],{},"entities",": for example, people, companies, products, services, or incidents. Their nature depends on the content and the questions the application must answer.",[10,710,711],{},"If these entities and their relationships already exist in the company's data, Microsoft GraphRAG can use that graph instead of extracting them from documents.",[62,713,715],{"id":714},"_3-build-the-graphrag-index","3. Build the GraphRAG index",[10,717,718],{},"An LLM reads each passage to identify entities and describe their relationships. For example, it may determine that a product depends on a service and that this service is mentioned in several incidents.",[10,720,721,722,725],{},"GraphRAG then groups closely related entities into ",[13,723,724],{},"communities"," and generates a summary for each group. These summaries provide an overview of the corpus, while the original passages preserve the details. Embeddings then make it possible to retrieve elements related to a question.",[112,727,729],{"className":114,"code":728,"language":116,"meta":117,"style":117},"flowchart TB\n    A[\"Documents\"] --> B[\"Passages\"]\n    B --> C[\"Entities and relationships\"]\n    C --> D[\"Groups of related entities\"]\n    D --> E[\"Group summaries\"]\n    B --> F[\"GraphRAG index\"]\n    C --> F\n    E --> F\n",[119,730,731,736,741,746,751,756,761,766],{"__ignoreMap":117},[122,732,733],{"class":124,"line":125},[122,734,735],{},"flowchart TB\n",[122,737,738],{"class":124,"line":131},[122,739,740],{},"    A[\"Documents\"] --> B[\"Passages\"]\n",[122,742,743],{"class":124,"line":137},[122,744,745],{},"    B --> C[\"Entities and relationships\"]\n",[122,747,748],{"class":124,"line":143},[122,749,750],{},"    C --> D[\"Groups of related entities\"]\n",[122,752,753],{"class":124,"line":149},[122,754,755],{},"    D --> E[\"Group summaries\"]\n",[122,757,758],{"class":124,"line":155},[122,759,760],{},"    B --> F[\"GraphRAG index\"]\n",[122,762,763],{"class":124,"line":161},[122,764,765],{},"    C --> F\n",[122,767,768],{"class":124,"line":167},[122,769,770],{},"    E --> F\n",[10,772,773],{},"This preparation is more involved than for a standard RAG system because it requires several analyses and summaries from the LLM. Microsoft therefore recommends starting with a small corpus.",[62,775,777],{"id":776},"_4-choose-the-search-mode-that-fits-the-question","4. Choose the search mode that fits the question",[10,779,780],{},"Once the index has been built, the search mode should match the type of question:",[200,782,783,788,793],{},[73,784,785,787],{},[13,786,640],{}," is designed for a targeted question about a person, product, or another specific element. It retrieves entities related to the question, then gathers their relationships and relevant source passages.",[73,789,790,792],{},[13,791,646],{}," is designed for questions about the document set as a whole, such as “What are the main themes?” It uses community summaries to build a general answer.",[73,794,795,797],{},[13,796,652],{}," starts with an overview, then progressively explores certain points through more targeted searches.",[10,799,800],{},"There is therefore no single GraphRAG path. A targeted question about an entity does not require the same search process as a request about the main themes of the entire knowledge base.",[62,802,804],{"id":803},"_5-compare-the-results-on-a-small-corpus","5. Compare the results on a small corpus",[10,806,807],{},"I would first test GraphRAG on a few documents whose content I know well. The project also includes simple vector search, which is useful for comparing its results with Local and Global Search.",[10,809,810],{},"I would use the same questions to compare answer quality, data preparation costs, and response time. I would also verify that the extracted entities and relationships match the source documents. This comparison shows whether the graph provides a real benefit before extending GraphRAG to an entire knowledge base.",[44,812,814],{"id":813},"rag-or-graphrag-how-should-you-choose","RAG or GraphRAG: how should you choose?",[224,816,817,829],{},[227,818,819],{},[230,820,821,824,827],{},[233,822,823],{},"Need",[233,825,826],{},"Vector or hybrid RAG",[233,828,38],{},[243,830,831,842,852,863,874,885,896],{},[230,832,833,836,839],{},[248,834,835],{},"Retrieve a passage that directly answers the question",[248,837,838],{},"Very suitable",[248,840,841],{},"Often unnecessary",[230,843,844,847,849],{},[248,845,846],{},"Search using synonyms",[248,848,838],{},[248,850,851],{},"Possible",[230,853,854,857,860],{},[248,855,856],{},"Connect several entities or documents",[248,858,859],{},"Limited without orchestration",[248,861,862],{},"Suitable",[230,864,865,868,871],{},[248,866,867],{},"Answer a global question about the entire corpus",[248,869,870],{},"Difficult",[248,872,873],{},"A central use case for Microsoft GraphRAG",[230,875,876,879,882],{},[248,877,878],{},"Add and update documents",[248,880,881],{},"Relatively simple",[248,883,884],{},"More expensive to extract and reconcile",[230,886,887,890,893],{},[248,888,889],{},"Explain why one piece of information is connected to another",[248,891,892],{},"Not very explicit",[248,894,895],{},"Traversable relationships",[230,897,898,901,904],{},[248,899,900],{},"Initial cost and complexity",[248,902,903],{},"Moderate",[248,905,906],{},"High",[44,908,910],{"id":909},"what-i-am-currently-testing-with-graphrag","What I am currently testing with GraphRAG",[10,912,913],{},"GraphRAG caught my attention because of its promise to retrieve relationships that vector search does not find. I am currently testing it in a prototype without having integrated it into any of my live projects yet.",[10,915,916],{},"I want to verify three points:",[70,918,919,922,925],{},[73,920,921],{},"does a graph retrieve relationships spread across several documents more effectively?",[73,923,924],{},"does it provide a more complete answer to multi-step questions and global summaries?",[73,926,927],{},"does this improvement justify the indexing cost, update complexity, and additional response time?",[10,929,930],{},"I am comparing these tests with vector RAG, then with a version using hybrid search and reranking. If the latter performs just as well, the graph is not justified.",[10,932,933,934,938],{},"This is how I approach the role of a ",[28,935,937],{"href":936},"/en/blog/product-engineer-new-role-ai","Product Engineer in the age of AI",": start with the problem, build the smallest useful version, measure it, then add complexity only when it genuinely improves the product.",[10,940,941],{},"For most document-based chatbots, I would therefore start with a good RAG system. GraphRAG becomes interesting when questions require following relationships or summarizing an entire corpus. The best architecture is still the one that retrieves the right evidence at the right time and at an acceptable cost.",[10,943,944,945,949],{},"📌 Do you want to connect a chatbot or AI feature to your product data? I can help you define the use case, build the retrieval pipeline, and measure its quality as part of a complete ",[28,946,948],{"href":947},"/en/services/product-engineering","Product Engineering"," approach.",[44,951,953],{"id":952},"frequently-asked-questions-about-rag-and-graphrag","Frequently asked questions about RAG and GraphRAG",[955,956],"faq-accordion",{":items":957,"className":958},"[{\"question\":\"What is RAG in artificial intelligence?\",\"answer\":\"RAG, or Retrieval-Augmented Generation, is an architecture pattern that retrieves information from an external source before providing it to a language model. The LLM then generates its answer from the question, instructions, and retrieved context.\"},{\"question\":\"What is the difference between RAG and GraphRAG?\",\"answer\":\"A standard RAG system often retrieves passages through semantic similarity or keyword search. GraphRAG also uses a graph to represent and follow relationships between entities, concepts, and documents. It is especially useful when the answer depends on several relationships or a global view of a document collection.\"},{\"question\":\"Do you need a vector database for RAG?\",\"answer\":\"No. A vector database is a common way to implement retrieval, but a RAG system can use a lexical search engine, SQL database, API, graph, or several retrievers together. The essential principle is retrieving information before generation.\"},{\"question\":\"Does GraphRAG replace vector RAG?\",\"answer\":\"Not necessarily. The two approaches are often combined: vector search finds passages related to the question, while the graph expands the search toward relevant entities and relationships. The original passages remain useful for preserving nuance and providing citations.\"},{\"question\":\"When should you use GraphRAG?\",\"answer\":\"GraphRAG becomes relevant for relational questions, multi-step reasoning, data already structured as a network, and summaries covering an entire corpus. For a FAQ or documentation where each answer fits within a few passages, a well-evaluated hybrid RAG system often remains simpler.\"},{\"question\":\"Does RAG prevent hallucinations?\",\"answer\":\"No. RAG provides sources to the model, but the model may still ignore a passage, misinterpret it, or add information that is not present. Citations, abstention, permission controls, and retrieval and faithfulness evaluations are still necessary.\"}]",[959],"mt-6",[44,961,963],{"id":962},"sources","Sources",[200,965,966,976,984,992,999,1006,1013,1021,1029,1037,1045,1053],{},[73,967,968,969,429],{},"Patrick Lewis et al., ",[28,970,975],{"href":971,"rel":972,"target":974},"https://arxiv.org/abs/2005.11401",[973],"nofollow","\\_blank","“Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”",[73,977,978,979,429],{},"Microsoft Research, ",[28,980,983],{"href":981,"rel":982,"target":974},"https://www.microsoft.com/en-us/research/publication/from-local-to-global-a-graph-rag-approach-to-query-focused-summarization/",[973],"“From Local to Global: A Graph RAG Approach to Query-Focused Summarization”",[73,985,986,987,429],{},"Microsoft GraphRAG, ",[28,988,991],{"href":989,"rel":990,"target":974},"https://microsoft.github.io/graphrag/index/default_dataflow/",[973],"indexing pipeline documentation",[73,993,986,994,429],{},[28,995,998],{"href":996,"rel":997,"target":974},"https://microsoft.github.io/graphrag/query/overview/",[973],"search mode documentation",[73,1000,986,1001,429],{},[28,1002,1005],{"href":1003,"rel":1004,"target":974},"https://microsoft.github.io/graphrag/index/byog/",[973],"using an existing graph",[73,1007,986,1008,429],{},[28,1009,1012],{"href":1010,"rel":1011,"target":974},"https://microsoft.github.io/graphrag/get_started/",[973],"getting started guide and indexing cost warning",[73,1014,1015,1016,429],{},"Microsoft, ",[28,1017,1020],{"href":1018,"rel":1019,"target":974},"https://learn.microsoft.com/en-us/azure/architecture/ai-ml/guide/rag/rag-information-retrieval",[973],"guide to retrieval and reranking in a RAG solution",[73,1022,1023,1024,429],{},"Anthropic, ",[28,1025,1028],{"href":1026,"rel":1027,"target":974},"https://www.anthropic.com/engineering/contextual-retrieval",[973],"“Contextual Retrieval”",[73,1030,1031,1032,429],{},"Sentence Transformers, ",[28,1033,1036],{"href":1034,"rel":1035,"target":974},"https://www.sbert.net/examples/sentence_transformer/applications/retrieve_rerank/README.html",[973],"“Retrieve & Re-Rank” guide covering bi-encoders and cross-encoders",[73,1038,1039,1040,429],{},"AWS, ",[28,1041,1044],{"href":1042,"rel":1043,"target":974},"https://docs.aws.amazon.com/prescriptive-guidance/latest/writing-best-practices-rag/introduction.html",[973],"best practices for writing source documents for RAG",[73,1046,1047,1048,429],{},"Neo4j, ",[28,1049,1052],{"href":1050,"rel":1051,"target":974},"https://neo4j.com/docs/neo4j-graphrag-python/current/user_guide_rag.html",[973],"GraphRAG for Python documentation",[73,1054,1055,1056,429],{},"Shahul Es et al., ",[28,1057,1060],{"href":1058,"rel":1059,"target":974},"https://arxiv.org/abs/2309.15217",[973],"“RAGAS: Automated Evaluation of Retrieval Augmented Generation”",[1062,1063,1064],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":117,"searchDepth":131,"depth":131,"links":1066},[1067,1071,1072,1079,1080,1081,1082,1083,1090,1091,1092,1093],{"id":46,"depth":131,"text":47,"children":1068},[1069,1070],{"id":64,"depth":137,"text":65},{"id":103,"depth":137,"text":104},{"id":188,"depth":131,"text":189},{"id":273,"depth":131,"text":274,"children":1073},[1074,1075,1076,1077,1078],{"id":280,"depth":137,"text":281},{"id":304,"depth":137,"text":305},{"id":347,"depth":137,"text":348},{"id":374,"depth":137,"text":375},{"id":407,"depth":137,"text":408},{"id":477,"depth":131,"text":478},{"id":501,"depth":131,"text":502},{"id":528,"depth":131,"text":529},{"id":610,"depth":131,"text":611},{"id":665,"depth":131,"text":666,"children":1084},[1085,1086,1087,1088,1089],{"id":672,"depth":137,"text":673},{"id":693,"depth":137,"text":694},{"id":714,"depth":137,"text":715},{"id":776,"depth":137,"text":777},{"id":803,"depth":137,"text":804},{"id":813,"depth":131,"text":814},{"id":909,"depth":131,"text":910},{"id":952,"depth":131,"text":953},{"id":962,"depth":131,"text":963},"25","ai","2026-08-20T07:00:00.000Z","2026-08-22T07:00:00.000Z","RAG (Retrieval-Augmented Generation) is a software architecture pattern that allows an AI application, such as an AI chatbot, to search your own content before answering. Instead of relying only on the knowledge of its model, it retrieves relevant passages and adds them to its context.","md",null,"/img/blog/blog25.jpg","en","page",{},true,"/en/blog/rag-graphrag-connect-ai-data",14,{"description":1109,"title":5},"RAG and GraphRAG explained simply: vector search, knowledge graphs, implementation methods, and hands-on experience.",{"loc":1106,"lastmod":1111},"2026-08-22T09:00:00+02:00","en/blog/25.rag-graphrag-connect-ai-data","SnI5F-AYSwG1ryb0-Fs6Iq6sielsJZoz48UFRrNxGl8",[1100,1115],{"title":1116,"path":1117,"stem":1118,"children":-1},"Google Sheets Canvas: The AI Battle Is Also About Distribution","/en/blog/google-sheets-canvas-ai-distribution","en/blog/24.google-sheets-canvas-ai-distribution",[1120,1121],{"path":1106,"lang":1102},{"path":1122,"lang":1123},"/fr/blog/rag-graphrag-connecter-ia-donnees","fr",1787397379492]