From e4f18c3cbddefa841ceb9ef0c5004ad242d88604 Mon Sep 17 00:00:00 2001 From: Adam Cowley Date: Mon, 10 Nov 2025 16:49:21 +0000 Subject: [PATCH 1/7] module 1 review --- .../lessons/2-setup/lesson.adoc | 20 ++++--- .../lessons/1-extract-schema/lesson.adoc | 18 +++---- .../lessons/2-create-a-graph/lesson.adoc | 3 +- .../lessons/3-chunk-size/lesson.adoc | 3 +- .../lessons/5-structured-data/lesson.adoc | 16 +++--- .../lessons/4-resolving-entities/lesson.adoc | 3 +- tests/qa.test.js | 54 ++++++++++++------- 7 files changed, 68 insertions(+), 49 deletions(-) diff --git a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc index fc76ff3f9..d44963ad0 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc @@ -4,9 +4,9 @@ :branch: main -During this course, you will: +During this course, you will: -* Use the Neo4j link:https://neo4j.com/docs/neo4j-graphrag-python/current/[GraphRAG for Python ()`neo4j_graphrag`) package to create a knowledge graph from unstructured and structured data +* Use the Neo4j link:https://neo4j.com/docs/neo4j-graphrag-python/current/[GraphRAG for Python (`neo4j_graphrag`)^] package to create a knowledge graph from unstructured and structured data * Create vector and text to Cypher retrievers that use the knowledge graph to provide context to an LLM You must set up a development environment to run the code examples and exercises. @@ -16,11 +16,11 @@ include::../../../../../../shared/courses/codespace/get-started.adoc[] [%collapsible] .Develop on your local machine ==== -You will need link:https://python.org[Python] installed and the ability to install packages using `pip`. +You will need link:https://python.org[Python^] installed and the ability to install packages using `pip`. You may want to set up a virtual environment using link:https://docs.python.org/3/library/venv.html[`venv`^] or link:https://virtualenv.pypa.io/en/latest/[`virtualenv`^] to keep your dependencies separate from other projects. -Clone the link:{repository-link}[github.com/neo4j-graphacademy/genai-graphrag-python] repository: +Clone the link:{repository-link}[github.com/neo4j-graphacademy/genai-graphrag-python^] repository: [source,bash] ---- @@ -63,8 +63,9 @@ ifeval::[{course-completed}==true] .Course completed [IMPORTANT] +.Sandbox no longer available ==== -You have completed this course. +You have completed this course. The Neo4j sandbox instance is no longer available, you can create a Neo4j cloud instance using link:https://console.neo4j.io[Neo4j AuraDB^] ==== @@ -77,6 +78,12 @@ endif::[] You can test your setup by running `genai-graphrag-python/test_environment.py` - this will attempt to connect to the Neo4j sandbox and the OpenAI API. +[source,python] +.Test your setup +---- +python genai-graphrag-python/test_environment.py +---- + You will see an `OK` message if you have set up your environment correctly. If any tests fail, check the contents of the `.env` file. == Continue @@ -86,9 +93,6 @@ When you are ready, you can move on to the next task. read::Success - let's get started![] - -read::Continue[] - [.summary] == Lesson Summary diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc index 074b02b38..ec1dd25cd 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc @@ -7,8 +7,6 @@ The link:https://neo4j.com/docs/neo4j-graphrag-python/current/[GraphRAG for Pyth During this course you will use the `neo4j_graphrag` package to build a knowledge graph and retrievers to extract information from the graph using LLMs. -== - In this lesson you will review how a graph schema can be extracted from text using an LLM. == Using the SchemaFromTextExtractor @@ -21,13 +19,13 @@ Open `genai-graphrag-python/extract_schema.py` include::{repository-raw}/{branch}/genai-graphrag-python/extract_schema.py[] ---- -The code uses the `SchemaFromTextExtractor` class to extract a schema from a given text input. +The code uses the `SchemaFromTextExtractor` class to extract a schema from a given text input. The extractor: -. Creates a prompt instructing the LLM to: +. Creates a prompt instructing the LLM to: .. Identify entities and relationships in any given text -.. Format the output as JSON +.. Format the output as JSON . Passes the prompt and text to the LLM for processing . Parses the JSON response to create a schema object @@ -37,15 +35,15 @@ Given the text, _"Neo4j is a graph database management system (GDBMS) developed .Extracted Schema ---- node_types=( - NodeType(label='GraphDatabase), + NodeType(label='GraphDatabase), NodeType(label='Company') -) +) relationship_types=( RelationshipType(label='DEVELOPED_BY'), -) +) patterns=( ('GraphDatabaseManagementSystem', 'DEVELOPED_BY', 'Company') -) +) ---- Run the program and observe the output. You will see a more detailed schema based on the text provided. @@ -70,6 +68,6 @@ read::Continue[] In this lesson, you: * Learned how to extract a graph schema from unstructured text using an LLM. -* Explore how different text inputs can lead to different schema extractions. +* Explored how different text inputs can lead to different schema extractions. In the next lesson, you will create a knowledge graph construction pipeline using the `SimpleKGPipeline` class. \ No newline at end of file diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc index 17f7a3a30..0a0017ea1 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc @@ -17,6 +17,7 @@ The `SimpleKGPipeline` class provides a pipeline which implements a series of st image::images/kg_builder_pipeline.png["Pipeline showing these steps"] [TIP] +.Customizing the pipeline Typical default values are used for each step. Throughout the course will you learn how to customize each step to suit your requirements. == Create the knowledge graph @@ -85,7 +86,7 @@ The `SimpleKGPipeline` creates the following default graph model: image::images/kg-builder-default-model.svg["a graph model showing (Document)<[:FROM_DOCUMENT]-(Chunk)<-[:FROM_CHUNK]-(Entity)"] -The `Entity` nodes represent the entities extracted from the text chunks. Relevant properties are extract from the chunk and associated with the entity nodes. +The `Entity` nodes represent the entities extracted from the text chunks. Relevant properties are extract from the chunk and associated with the entity nodes. You can view the documents and chunks created in the graph using the following Cypher query: diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/lesson.adoc index fa3756726..ecf1d5024 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/lesson.adoc @@ -22,7 +22,7 @@ MATCH (n) DETACH DELETE n To modify the chunk size you will need to create a `FixedSizeSplitter` object and pass it to the `SimpleKGPipeline` when creating the pipeline instance: . Modify the `genai-graphrag-python/kg_builder.py` file to import the `FixedSizeSplitter` class and create an instance with a chunk size of 500 characters: -+ ++ [source, python] ---- include::{repository-raw}/{branch}/genai-graphrag-python/solutions/kg_builder_split.py[tag=import_text_splitter] @@ -31,6 +31,7 @@ include::{repository-raw}/{branch}/genai-graphrag-python/solutions/kg_builder_sp ---- + [NOTE] +.Chunk size and overlap The `chunk_size` parameter defines the maximum number of characters in each text chunk. The `chunk_overlap` parameter ensures that there is some overlap between consecutive chunks, which can help maintain context. . Update the `SimpleKGPipeline` instantiation to use the custom text splitter: + diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc index 1d71642a8..e067d770b 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc @@ -3,11 +3,12 @@ :order: 5 :branch: main -The knowledge graph graph you created is solely based on unstructured data extracted from documents. You may have access to structured data sources such as databases, CSV files, or APIs that contain valuable information relevant to your domain. +The knowledge graph graph you created is solely based on unstructured data extracted from documents. You may have access to structured data sources such as databases, CSV files, or APIs that contain valuable information relevant to your domain. Combining the structure and unstructured data can enhance the knowledge graph's richness and usefulness. [NOTE] +.Lexical and Domain Graphs The unstructured part of your graph is known as the link:https://graphrag.com/reference/knowledge-graph/lexical-graph/[Lexical Graph], while the structured part is known as the link:https://graphrag.com/reference/knowledge-graph/domain-graph/[Domain Graph]. == Load from CSV file @@ -86,7 +87,7 @@ MATCH (n) DETACH DELETE n == Explore the structured data -The structured data allows you to query the knowledge graph in new ways. +The structured data allows you to query the knowledge graph in new ways. You can find all lessons that cover a specific technology or concept: @@ -105,12 +106,9 @@ The knowledge graph allows you to summarizing the content of each lesson by spec .Summarize lesson content ---- MATCH (lesson:Lesson)<-[:PDF_OF]-(:Document)<-[:FROM_DOCUMENT]-(c:Chunk) -OPTIONAL MATCH (c)<-[:FROM_CHUNK]-(tech:Technology) -OPTIONAL MATCH (c)<-[:FROM_CHUNK]-(concept:Concept) -RETURN - lesson.name, - collect(DISTINCT tech.name) as technologies, - collect(DISTINCT concept.name) as concepts +RETURN lesson.name, + [ (c)-[:FROM_CHUNK]->(tech:Technology) | tech.name ] AS technologies, + [ (c)-[:FROM_CHUNK]->(concept:Concept) | concept.name ] AS concepts ---- Spend some time exploring the knowledge graph and experiment with adding additional data. @@ -123,7 +121,7 @@ include::questions/1-benefits.adoc[leveloffset=+2] [.summary] == Lesson Summary -In this lesson, you learned: +In this lesson, you learned: * About benefits of adding structured data to a knowledge graph. * How to load structured data from a CSV file. diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc index 9b1739b25..614d9fc37 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc @@ -17,9 +17,10 @@ You can disable entity resolution by setting the `perform_entity_resolution` par include::{repository-raw}/{branch}/genai-graphrag-python/examples/no_entity_resolution.py[tag=kg_builder] ---- -Disabling entity resolution will result in all identified entities being created as new nodes. +Disabling entity resolution will result in all identified entities being created as new nodes. [IMPORTANT] +.Multiple nodes for the same entity This may lead to multiple nodes representing the same real-world entity, == Post Processing Entity Resolution diff --git a/tests/qa.test.js b/tests/qa.test.js index 62321d641..151a7acd5 100644 --- a/tests/qa.test.js +++ b/tests/qa.test.js @@ -36,7 +36,6 @@ describe("QA Tests", () => { .filter((path) => exclude.some((folder) => !path.endsWith(folder))) .filter((path) => existsSync(join(path, "course.adoc"))); - if (process.env.COURSES) { const targetCourses = process.env.COURSES.split(",").map((c) => c.trim().toLowerCase() @@ -46,7 +45,8 @@ describe("QA Tests", () => { return targetCourses.some((term) => slug.includes(term)); }); console.log( - `Filtering QA tests to courses matching: ${coursePaths.join(", ")} (${coursePaths.length + `Filtering QA tests to courses matching: ${coursePaths.join(", ")} (${ + coursePaths.length })` ); } @@ -286,28 +286,44 @@ describe("QA Tests", () => { expect(content.length).toBeGreaterThanOrEqual(200); }); - // it("all admonitions should have titles", () => { - // const admonitionRegex = - // /^\[(TIP|NOTE|WARNING|CAUTION|IMPORTANT)\]/gm; - // const admonitions = [...lessonAdoc.matchAll(admonitionRegex)]; - - // for (const match of admonitions) { - // const startIndex = match.index; - // const afterAdmonition = lessonAdoc.substring(startIndex); - // const nextLines = afterAdmonition.split("\n").slice(1, 3); + it("should have at most one read button", () => { + const readButtonCount = [ + ...lessonAdoc.matchAll(/read::(.*)\[\]/g), + ].length; + expect(readButtonCount).toBeLessThanOrEqual(1); + }); - // const hasTitle = - // nextLines[0] && nextLines[0].trim().startsWith("."); - // expect(hasTitle).toBe(true); - // } - // }); + it("all admonitions should have titles", () => { + const admonitionRegex = + /^\[(TIP|NOTE|WARNING|CAUTION|IMPORTANT)\]/gm; + const admonitions = [...lessonAdoc.matchAll(admonitionRegex)]; + + for (const match of admonitions) { + const startIndex = match.index; + const afterAdmonition = lessonAdoc.substring(startIndex); + const nextLines = afterAdmonition.split("\n").slice(1, 3); + + const hasTitle = + nextLines[0] && nextLines[0].trim().startsWith("."); + if (!hasTitle) { + const firstNewlineIndex = afterAdmonition.indexOf("\n"); + const openingContent = afterAdmonition + .slice(firstNewlineIndex + 1) + .trim() + .slice(0, 100); + throw new Error( + `Admonition ${match[0]} does not have an action oriented title. Opening content: "${openingContent}..."` + ); + } + } + }); it("should be optional, mark as read or have one or more questions", () => { expect( optional || - hasReadButton || - includesSandbox || - questionPaths.length > 0 + hasReadButton || + includesSandbox || + questionPaths.length > 0 ).toBe(true); }); From 1f2a531db27d051b27c2585c4ca0f434b0c93359 Mon Sep 17 00:00:00 2001 From: Adam Cowley Date: Mon, 10 Nov 2025 16:57:50 +0000 Subject: [PATCH 2/7] module 1 review --- .../1-knowledge-graph-construction/lesson.adoc | 16 ++++++++-------- .../questions/1-steps.adoc | 2 +- .../1-introduction/lessons/2-setup/lesson.adoc | 4 ++-- .../lessons/1-extract-schema/lesson.adoc | 6 +++--- .../lessons/2-create-a-graph/lesson.adoc | 8 +++++--- .../questions/1-simple-kg-pipeline.adoc | 2 +- .../3-chunk-size/questions/1-chunk-size.adoc | 2 +- .../lessons/4-define-a-schema/lesson.adoc | 8 ++++---- .../questions/1-define-schema.adoc | 2 +- .../lessons/5-structured-data/lesson.adoc | 12 ++++++------ .../1-vector-cypher-retriever/lesson.adoc | 14 +++++++------- .../2-text-to-cypher-retriever/lesson.adoc | 4 ++-- .../questions/1-text2cypher.adoc | 2 +- .../lessons/1-loading-data/lesson.adoc | 2 +- .../lessons/2-splitting-text/lesson.adoc | 2 +- .../lessons/3-graph-config/lesson.adoc | 2 +- .../lessons/4-resolving-entities/lesson.adoc | 10 ++++++---- .../lessons/5-llm-configuration/lesson.adoc | 9 ++++++--- tests/qa.test.js | 16 ++++++++++++++++ 19 files changed, 73 insertions(+), 50 deletions(-) diff --git a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/1-knowledge-graph-construction/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/1-knowledge-graph-construction/lesson.adoc index 79815dd9a..a20252881 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/1-knowledge-graph-construction/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/1-knowledge-graph-construction/lesson.adoc @@ -1,12 +1,12 @@ -= Constructing Knowledge Graphs += Constructing knowledge graphs :type: lesson :order: 1 -In this lesson you will review the process of constructing knowledge graphs from unstructured text using an LLM. +In this lesson, you will review the process of constructing knowledge graphs from unstructured text using an LLM. == The construction process -Typically, you would follow these steps: +When constructing a knowledge graph from unstructured text, you typically follow these steps: . Gather the data . Chunk the data @@ -72,12 +72,12 @@ If you wanted to construct a knowledge graph based on the link:https://en.wikipe image::images/neo4j-wiki.png["A screenshot of the Neo4j wiki page"] . Split the text into **chunks**. + - Neo4j is a graph database management system (GDBMS) developed + Neo4j is a graph database management system (GDBMS) developed by Neo4j Inc. + {sp} + - The data elements Neo4j stores are nodes, edges connecting them, + The data elements Neo4j stores are nodes, edges connecting them, and attributes of nodes and edges... . Generate **embeddings** and **vectors** for each chunk. @@ -88,8 +88,8 @@ image::images/neo4j-wiki.png["A screenshot of the Neo4j wiki page"] + Send the text to the LLM with an appropriate prompt, for example: + - Your task is to identify the entities and relations requested - with the user prompt from a given text. You must generate the + Your task is to identify the entities and relations requested + with the user prompt from a given text. You must generate the output in a JSON format containing a list with JSON objects. Text: @@ -166,4 +166,4 @@ include::questions/1-steps.adoc[leveloffset=+1] In this lesson, you learned about how to construct a knowledge graph. -In the next lesson, you will setup your development environment to build knowledge graphs using Python and Neo4j. \ No newline at end of file +In the next lesson, you will set up your development environment to build knowledge graphs using Python and Neo4j. diff --git a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/1-knowledge-graph-construction/questions/1-steps.adoc b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/1-knowledge-graph-construction/questions/1-steps.adoc index ecc795459..db9368681 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/1-knowledge-graph-construction/questions/1-steps.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/1-knowledge-graph-construction/questions/1-steps.adoc @@ -1,5 +1,5 @@ [.question] -= 1. Knowledge graph construction steps += Knowledge Graph Construction Steps Which of the following steps could be considered **optional**? diff --git a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc index d44963ad0..10078aedd 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc @@ -1,4 +1,4 @@ -= Setup your development environment += Set up your development environment :type: lesson :order: 2 :branch: main @@ -96,6 +96,6 @@ read::Success - let's get started![] [.summary] == Lesson Summary -In this lesson, you setup your development environment to build a knowledge graph. +In this lesson, you prepared your development environment to build a knowledge graph. In the next module, you will create a knowledge graph from unstructured and structured data using an LLM. \ No newline at end of file diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc index ec1dd25cd..36bb86a7d 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc @@ -1,4 +1,4 @@ -= Extracting a Schema from Text += Extracting a schema from text :type: lesson :order: 1 :branch: main @@ -48,7 +48,7 @@ patterns=( Run the program and observe the output. You will see a more detailed schema based on the text provided. -This schema can be used to stored the data held within the text. +This schema can be used to store the data held within the text. image::images/neo4j_graphdatabase.svg["a graph schema with a Neo4j GraphDatabase node connected to a Neo4j Inc Company node via a DEVELOPED_BY relationship"] @@ -58,7 +58,7 @@ Experiment with different text inputs to see how the schema extraction varies ba * "The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France." * "Large Language Models (LLMs) are a type of artificial intelligence model designed to understand and generate human-like text." -When you're have experimented with the schema extraction you can continue. +When you have experimented with the schema extraction, you can continue. read::Continue[] diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc index 0a0017ea1..46881bcc7 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc @@ -1,4 +1,4 @@ -= Create a Graph += Create a graph :type: lesson :order: 2 :branch: main @@ -18,7 +18,9 @@ image::images/kg_builder_pipeline.png["Pipeline showing these steps"] [TIP] .Customizing the pipeline -Typical default values are used for each step. Throughout the course will you learn how to customize each step to suit your requirements. +==== +Typical default values are used for each step. Throughout the course, you will learn how to customize each step to suit your requirements. +==== == Create the knowledge graph @@ -86,7 +88,7 @@ The `SimpleKGPipeline` creates the following default graph model: image::images/kg-builder-default-model.svg["a graph model showing (Document)<[:FROM_DOCUMENT]-(Chunk)<-[:FROM_CHUNK]-(Entity)"] -The `Entity` nodes represent the entities extracted from the text chunks. Relevant properties are extract from the chunk and associated with the entity nodes. +The `Entity` nodes represent the entities extracted from the text chunks. Relevant properties are extracted from the chunk and associated with the entity nodes. You can view the documents and chunks created in the graph using the following Cypher query: diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/questions/1-simple-kg-pipeline.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/questions/1-simple-kg-pipeline.adoc index c472e98f8..ce114d0dc 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/questions/1-simple-kg-pipeline.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/questions/1-simple-kg-pipeline.adoc @@ -15,5 +15,5 @@ Think about what the SimpleKGPipeline does when you run it - it takes unstructur [TIP,role=solution] .Solution ==== -The SimpleKGPipeline class provides a pipeline which *implements a series of steps to create a knowledge graph from unstructured data*. These steps include loading text, splitting it into chunks, creating embeddings, extracting entities, and writing the data to Neo4j. +The SimpleKGPipeline class provides a pipeline which **implements a series of steps to create a knowledge graph from unstructured data**. These steps include loading text, splitting it into chunks, creating embeddings, extracting entities, and writing the data to Neo4j. ==== \ No newline at end of file diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/questions/1-chunk-size.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/questions/1-chunk-size.adoc index 4922ab696..750eab3a2 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/questions/1-chunk-size.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/questions/1-chunk-size.adoc @@ -15,5 +15,5 @@ Consider what happens to the level of detail and context when you make text chun [TIP,role=solution] .Solution ==== -The larger the chunk size, the more context the LLM has when extracting entities and relationships, but it may also lead to less granular data. This is the key trade-off - more context versus granularity of the extracted information. +**Larger chunks provide more context for entity extraction but result in less granular data**. The larger the chunk size, the more context the LLM has when extracting entities and relationships, but it may also lead to less granular data. This is the key trade-off - more context versus granularity of the extracted information. ==== \ No newline at end of file diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc index 8ed724d3e..602b1d57b 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc @@ -3,7 +3,7 @@ :order: 4 :branch: main -The knowledge graph you created is unconstrained, meaning that any entity or relationship can be created based on the data extracted from the text. This can lead to graph which are non-specific and maybe difficult to analyze and query. +The knowledge graph you created is unconstrained, meaning that any entity or relationship can be created based on the data extracted from the text. This can lead to graphs that are non-specific and may be difficult to analyze and query. In this lesson, you will modify the `SimpleKGPipeline` to use a custom schema for the knowledge graph. @@ -12,7 +12,7 @@ In this lesson, you will modify the `SimpleKGPipeline` to use a custom schema fo When you provide a schema to the `SimpleKGPipeline`, it will pass this information to the LLM instructing it to only identify those nodes and relationships. This allows you to create a more structured and meaningful knowledge graph. -You define a schema by expressing the desired nodes, relationships, or patterns you want to extract from the text. +You define a schema by expressing the desired nodes, relationships, or patterns you want to extract from the text. For example, you might want to extract the following information: @@ -23,7 +23,7 @@ For example, you might want to extract the following information: [TIP] .Iterate your schema ==== -You don't have to define nodes, relationships, and patterns all at once. You can start with just nodes or just relationships and expand your schema as needed. +You don't have to define nodes, relationships, and patterns all at once. You can start with just nodes or just relationships and expand your schema as needed. For example, if you only define nodes, the LLM will find any relationships between those nodes based on the text. @@ -137,7 +137,7 @@ Review the knowledge graph and observe how the defined schema has influenced the [source, cypher] .Documents, Chunks, and Entity counts ---- -RETURN +RETURN count{ (:Document) } as documents, count{ (:Chunk) } as chunks, count{ (:__Entity__) } as entities diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/questions/1-define-schema.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/questions/1-define-schema.adoc index 972fc1707..0b90dcd44 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/questions/1-define-schema.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/questions/1-define-schema.adoc @@ -15,5 +15,5 @@ Think about what happens when you don't provide a schema - the knowledge graph b [TIP,role=solution] .Solution ==== -Defining a schema allows you to *create a more structured and meaningful knowledge graph by constraining the entities and relationships* that are extracted. Without a schema, the knowledge graph is unconstrained, meaning any entity or relationship can be created, which can lead to graphs that are non-specific and difficult to analyze and query. +Defining a schema allows you to **create a more structured and meaningful knowledge graph by constraining entities and relationships** that are extracted. Without a schema, the knowledge graph is unconstrained, meaning any entity or relationship can be created, which can lead to graphs that are non-specific and difficult to analyze and query. ==== \ No newline at end of file diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc index e067d770b..9a763aac0 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc @@ -1,11 +1,11 @@ -= Add Structured Data to the Knowledge Graph += Add structured data to the knowledge graph :type: lesson :order: 5 :branch: main -The knowledge graph graph you created is solely based on unstructured data extracted from documents. You may have access to structured data sources such as databases, CSV files, or APIs that contain valuable information relevant to your domain. +The knowledge graph you created is solely based on unstructured data extracted from documents. You may have access to structured data sources such as databases, CSV files, or APIs that contain valuable information relevant to your domain. -Combining the structure and unstructured data can enhance the knowledge graph's richness and usefulness. +Combining the structured and unstructured data can enhance the knowledge graph's richness and usefulness. [NOTE] .Lexical and Domain Graphs @@ -13,7 +13,7 @@ The unstructured part of your graph is known as the link:https://graphrag.com/re == Load from CSV file -The repository contains a sample CSV file `genai-graphrag-python/data/docs.csv` which contains metadata about the lessons the document were created from. +The repository contains a sample CSV file `genai-graphrag-python/data/docs.csv` which contains metadata about the lessons the documents were created from. [source, csv] .Sample docs.csv @@ -24,7 +24,7 @@ genai-fundamentals_1-generative-ai_2-considerations.pdf,genai-fundamentals,1-gen ... ---- -You can use the csv file as input and a structure data source when creating the knowledge graph. +You can use the CSV file as input and a structured data source when creating the knowledge graph. Open `genai-graphrag-python/kg_structured_builder.py` and review the code. @@ -100,7 +100,7 @@ WHERE toLower(kg.name) CONTAINS "knowledge graph" RETURN DISTINCT toLower(kg.name), l.name, l.url ---- -The knowledge graph allows you to summarizing the content of each lesson by specific categories such as technologies and concepts: +The knowledge graph allows you to summarize the content of each lesson by specific categories such as technologies and concepts: [source, cypher] .Summarize lesson content diff --git a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/lesson.adoc index fd826a606..d28fbc966 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/lesson.adoc @@ -1,9 +1,9 @@ -= Vector + Cypher Retriever += Vector + Cypher retriever :type: lesson :order: 1 :branch: main -The chunks in the knowledge graph include vector embeddings that allow for similarity search based on vector distance. +The chunks in the knowledge graph include vector embeddings that allow for similarity search based on vector distance. You can create a vector retriever that uses these embeddings to find the most relevant chunks for a given query. @@ -24,7 +24,7 @@ OPTIONS {indexConfig: { }}; ---- -A vector index named `chunkEmbedding` will be created for nodes with a `Chunk` label, indexing the `embedding` property. +A vector index named `chunkEmbedding` will be created for nodes with a `Chunk` label, indexing the `embedding` property. The index is configured to 1536 dimensions (as provided by the `text-embedding-ada-002` embedding model) and use cosine similarity for distance calculations. You can search the vector index by creating an embedding for a search term: @@ -41,7 +41,7 @@ RETURN node.text, score ---- [IMPORTANT] -.OpenAI Token +.OpenAI token ==== You will need to update the `$token` with your OpenAI API key. ==== @@ -72,14 +72,14 @@ The retriever is configured to use the `chunkEmbedding` vector index you just cr include::{repository-raw}/{branch}/genai-graphrag-python/solutions/vector_cypher_rag.py[tag=retriever] ---- -When you run the code: +When you run the code: . The `VectorCypherRetriever` uses the vector index to find chunks similar to the query: + _"Where can I learn more about knowledge graphs?"_ -. The `GraphRAG` pipelines passes the text from those chunks as context to the LLM. +. The `GraphRAG` pipeline passes the text from those chunks as context to the LLM. . The response from the LLM is printed: -+ ++ _You can learn more about knowledge graphs in the Neo4j blog post linked here: link:https://neo4j.com/blog/what-is-knowledge-graph[What Is a Knowledge Graph?^]_ You can print the context passed to the LLM by adding the following to the end of the code: diff --git a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/lesson.adoc index abc57be8a..cfd70a98c 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/lesson.adoc @@ -1,4 +1,4 @@ -= Text to Cypher Retriever += Text to Cypher retriever :type: lesson :order: 2 :branch: main @@ -44,7 +44,7 @@ The context shows that the LLM generated and executed the following Cypher query MATCH (t:Technology) RETURN count(t) AS technologyCount ---- -The following data was return from the knowledge graph and passed as context to the LLM: +The following data was returned from the knowledge graph and passed as context to the LLM: [source, python] ---- diff --git a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/questions/1-text2cypher.adoc b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/questions/1-text2cypher.adoc index f2adb3b38..c9b1adf86 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/questions/1-text2cypher.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/questions/1-text2cypher.adoc @@ -15,5 +15,5 @@ Think about what makes text-to-cypher different from vector retrieval - what typ [TIP,role=solution] .Solution ==== -Text2CypherRetriever is used when you want to get precise information from the knowledge graph using natural language questions. It generates and executes Cypher queries to answer specific questions like "How many lessons are in a course?", "What concepts are covered in a module?", or "How do technologies relate to each other?". This is different from vector retrieval, which finds similar content, or entity extraction, which processes raw documents. +**Text2CypherRetriever is used when you want to get precise information from the knowledge graph using natural language questions**. It generates and executes Cypher queries to answer specific questions like "How many lessons are in a course?", "What concepts are covered in a module?", or "How do technologies relate to each other?". This is different from vector retrieval, which finds similar content, or entity extraction, which processes raw documents. ==== \ No newline at end of file diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/1-loading-data/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/1-loading-data/lesson.adoc index 5d3d3085a..6aeb8792e 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/1-loading-data/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/1-loading-data/lesson.adoc @@ -115,4 +115,4 @@ read::Continue[] In this lesson, you learned how to create custom data loaders. -In the next lesson, you will how to integrate custom chunking and text splitting strategies into the knowledge graph pipeline. \ No newline at end of file +In the next lesson, you will learn how to integrate custom chunking and text splitting strategies into the knowledge graph pipeline. \ No newline at end of file diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc index 401237302..506c2283d 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc @@ -1,4 +1,4 @@ -= Splitting Text into Chunks += Splitting text into chunks :type: lesson :order: 2 :optional: true diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/3-graph-config/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/3-graph-config/lesson.adoc index 12503d55e..8a6e6bcd0 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/3-graph-config/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/3-graph-config/lesson.adoc @@ -55,6 +55,6 @@ read::Continue[] [.summary] == Lesson Summary -In this lesson, you learned how to create a graph configuration to changes the structure of the lexical graph. +In this lesson, you learned how to create a graph configuration to change the structure of the lexical graph. In the next lesson, you will learn about different models and approaches for resolving entities. \ No newline at end of file diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc index 614d9fc37..f3948b2dd 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc @@ -1,4 +1,4 @@ -= Entity Resolution += Entity resolution :type: lesson :order: 4 :optional: true @@ -21,7 +21,9 @@ Disabling entity resolution will result in all identified entities being created [IMPORTANT] .Multiple nodes for the same entity -This may lead to multiple nodes representing the same real-world entity, +==== +This may lead to multiple nodes representing the same real-world entity. +==== == Post Processing Entity Resolution @@ -29,8 +31,8 @@ The `neo4j_graphrag` library includes additional link:https://neo4j.com/docs/neo For example: -* The link:https://neo4j.com/docs/neo4j-graphrag-python/current/api.html#spacysemanticmatchresolver`[`SpacySemanticMatchResolver`^] uses the link:https://spacy.io/[`spaCy`^] library to find and resolves entities with same label and similar set of textual properties. -* The link:https://neo4j.com/docs/neo4j-graphrag-python/current/api.html#fuzzymatchresolver`[`FuzzyMatchResolver`^] finds and resolves entities with the same label and similar set of textual properties using link:https://rapidfuzz.github.io/RapidFuzz/[RapidFuzz^] for fuzzy matching. +* The link:https://neo4j.com/docs/neo4j-graphrag-python/current/api.html#spacysemanticmatchresolver[`SpacySemanticMatchResolver`^] uses the link:https://spacy.io/[`spaCy`^] library to find and resolve entities with the same label and similar set of textual properties. +* The link:https://neo4j.com/docs/neo4j-graphrag-python/current/api.html#fuzzymatchresolver[`FuzzyMatchResolver`^] finds and resolves entities with the same label and similar set of textual properties using link:https://rapidfuzz.github.io/RapidFuzz/[RapidFuzz^] for fuzzy matching. Post processing of entities can result in a more concise knowledge graph with fewer duplicate entities but with the risk of incorrectly merging distinct entities. diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/5-llm-configuration/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/5-llm-configuration/lesson.adoc index fa0444211..cb18615bd 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/5-llm-configuration/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/5-llm-configuration/lesson.adoc @@ -1,4 +1,4 @@ -= LLM Configuration += LLM configuration :type: lesson :order: 5 :optional: true @@ -33,9 +33,12 @@ llm = OpenAILLM( ---- [TIP] -.Model Parameters -Through `model_params` you can change how by model responds by adjusting model parameters such as `temperature` and `response_format`. +.Model parameters +==== +Through `model_params` you can change how the model responds by adjusting model parameters such as `temperature` and `response_format`. + The parameters available will depend on the specific LLM you are using. +==== You can also create your own LLM adapter by inheriting from the link:https://neo4j.com/docs/neo4j-graphrag-python/current/api.html#llminterface[LLMInterface^] class. diff --git a/tests/qa.test.js b/tests/qa.test.js index 151a7acd5..d7d907c05 100644 --- a/tests/qa.test.js +++ b/tests/qa.test.js @@ -156,6 +156,10 @@ describe("QA Tests", () => { expect(exists).toBe(true); }); + it("should end with a newline", () => { + expect(courseAdoc.endsWith("\n")).toBe(true); + }); + for (const modulePath of modulePaths) { const moduleSlug = modulePath.split(sep).reverse()[0]; const moduleAdocPath = join(modulePath, "module.adoc"); @@ -221,6 +225,10 @@ describe("QA Tests", () => { expect(lessonPaths.length).toBeGreaterThan(0); }); + it("should end with a newline", () => { + expect(moduleAdoc.endsWith("\n")).toBe(true); + }); + for (const lessonPath of lessonPaths) { const lessonSlug = lessonPath.split(sep).reverse()[0]; @@ -286,6 +294,10 @@ describe("QA Tests", () => { expect(content.length).toBeGreaterThanOrEqual(200); }); + it("should end with a newline", () => { + expect(lessonAdoc.endsWith("\n")).toBe(true); + }); + it("should have at most one read button", () => { const readButtonCount = [ ...lessonAdoc.matchAll(/read::(.*)\[\]/g), @@ -400,6 +412,10 @@ describe("QA Tests", () => { expect(asciidoc).toContain("\n[TIP,role=solution]"); }); + it("should end with a newline", () => { + expect(asciidoc.endsWith("\n")).toBe(true); + }); + if (isVerificationQuestion) { describe("Verify Question", () => { it("should have a valid verify.cypher", async () => { From 3cf2ff03263e7b50555fa6b34f2924ee70ca6452 Mon Sep 17 00:00:00 2001 From: Adam Cowley Date: Mon, 10 Nov 2025 16:58:28 +0000 Subject: [PATCH 3/7] module 1 review --- asciidoc/courses/genai-graphrag-python/course.adoc | 2 +- .../modules/1-introduction/lessons/2-setup/lesson.adoc | 2 +- .../lessons/1-extract-schema/lesson.adoc | 2 +- .../lessons/2-create-a-graph/lesson.adoc | 2 +- .../2-create-a-graph/questions/1-simple-kg-pipeline.adoc | 2 +- .../2-knowledge-graph-pipeline/lessons/3-chunk-size/lesson.adoc | 2 +- .../lessons/3-chunk-size/questions/1-chunk-size.adoc | 2 +- .../lessons/4-define-a-schema/lesson.adoc | 2 +- .../lessons/4-define-a-schema/questions/1-define-schema.adoc | 2 +- .../lessons/5-structured-data/lesson.adoc | 2 +- .../lessons/5-structured-data/questions/1-benefits.adoc | 2 +- .../3-retrieval/lessons/1-vector-cypher-retriever/lesson.adoc | 2 +- .../questions/1-graphrag-pipeline.adoc | 2 +- .../3-retrieval/lessons/2-text-to-cypher-retriever/lesson.adoc | 2 +- .../2-text-to-cypher-retriever/questions/1-text2cypher.adoc | 2 +- .../modules/4-customisation/lessons/1-loading-data/lesson.adoc | 2 +- .../4-customisation/lessons/2-splitting-text/lesson.adoc | 2 +- .../modules/4-customisation/lessons/3-graph-config/lesson.adoc | 2 +- .../4-customisation/lessons/4-resolving-entities/lesson.adoc | 2 +- .../4-customisation/lessons/5-llm-configuration/lesson.adoc | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/asciidoc/courses/genai-graphrag-python/course.adoc b/asciidoc/courses/genai-graphrag-python/course.adoc index 162f5917e..c4a48b5de 100644 --- a/asciidoc/courses/genai-graphrag-python/course.adoc +++ b/asciidoc/courses/genai-graphrag-python/course.adoc @@ -52,4 +52,4 @@ How to: * [lessons]#16 lessons# * [challenges]#7 hands-on challenges# -* [quizes]#8 simple quizzes to support your learning# \ No newline at end of file +* [quizes]#8 simple quizzes to support your learning# diff --git a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc index 10078aedd..296e97225 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/lessons/2-setup/lesson.adoc @@ -98,4 +98,4 @@ read::Success - let's get started![] In this lesson, you prepared your development environment to build a knowledge graph. -In the next module, you will create a knowledge graph from unstructured and structured data using an LLM. \ No newline at end of file +In the next module, you will create a knowledge graph from unstructured and structured data using an LLM. diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc index 36bb86a7d..38be80545 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/1-extract-schema/lesson.adoc @@ -70,4 +70,4 @@ In this lesson, you: * Learned how to extract a graph schema from unstructured text using an LLM. * Explored how different text inputs can lead to different schema extractions. -In the next lesson, you will create a knowledge graph construction pipeline using the `SimpleKGPipeline` class. \ No newline at end of file +In the next lesson, you will create a knowledge graph construction pipeline using the `SimpleKGPipeline` class. diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc index 46881bcc7..e99e8b342 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc @@ -128,4 +128,4 @@ In this lesson, you: * Learned how to use the `SimpleKGPipeline` class. * Explored the graph model created by the pipeline. -In the next lesson, you will modify the chunk size used when splitting the text and define a custom schema for the knowledge graph. \ No newline at end of file +In the next lesson, you will modify the chunk size used when splitting the text and define a custom schema for the knowledge graph. diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/questions/1-simple-kg-pipeline.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/questions/1-simple-kg-pipeline.adoc index ce114d0dc..4e2eee64a 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/questions/1-simple-kg-pipeline.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/questions/1-simple-kg-pipeline.adoc @@ -16,4 +16,4 @@ Think about what the SimpleKGPipeline does when you run it - it takes unstructur .Solution ==== The SimpleKGPipeline class provides a pipeline which **implements a series of steps to create a knowledge graph from unstructured data**. These steps include loading text, splitting it into chunks, creating embeddings, extracting entities, and writing the data to Neo4j. -==== \ No newline at end of file +==== diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/lesson.adoc index ecf1d5024..e231dd2ad 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/lesson.adoc @@ -81,4 +81,4 @@ In this lesson, you: * Learned about the impact of chunk size on entity extraction * Modified the `SimpleKGPipeline` to use a custom chunk size with the `FixedSizeSplitter` -In the next lesson, you will define a custom schema for the knowledge graph. \ No newline at end of file +In the next lesson, you will define a custom schema for the knowledge graph. diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/questions/1-chunk-size.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/questions/1-chunk-size.adoc index 750eab3a2..0326aa7d7 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/questions/1-chunk-size.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/3-chunk-size/questions/1-chunk-size.adoc @@ -16,4 +16,4 @@ Consider what happens to the level of detail and context when you make text chun .Solution ==== **Larger chunks provide more context for entity extraction but result in less granular data**. The larger the chunk size, the more context the LLM has when extracting entities and relationships, but it may also lead to less granular data. This is the key trade-off - more context versus granularity of the extracted information. -==== \ No newline at end of file +==== diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc index 602b1d57b..17945e7a2 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc @@ -153,4 +153,4 @@ include::questions/1-define-schema.adoc[leveloffset=+2] In this lesson, you learned how to define a custom schema for the knowledge graph. -In the next lesson, you will learn how to add structured data to the knowledge graph. \ No newline at end of file +In the next lesson, you will learn how to add structured data to the knowledge graph. diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/questions/1-define-schema.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/questions/1-define-schema.adoc index 0b90dcd44..993fc67d2 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/questions/1-define-schema.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/questions/1-define-schema.adoc @@ -16,4 +16,4 @@ Think about what happens when you don't provide a schema - the knowledge graph b .Solution ==== Defining a schema allows you to **create a more structured and meaningful knowledge graph by constraining entities and relationships** that are extracted. Without a schema, the knowledge graph is unconstrained, meaning any entity or relationship can be created, which can lead to graphs that are non-specific and difficult to analyze and query. -==== \ No newline at end of file +==== diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc index 9a763aac0..15042eedb 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/lesson.adoc @@ -127,4 +127,4 @@ In this lesson, you learned: * How to load structured data from a CSV file. * How to create nodes from structured data and connect them to unstructured data nodes. -In the next module, you will create retrievers to query the knowledge graph. \ No newline at end of file +In the next module, you will create retrievers to query the knowledge graph. diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/questions/1-benefits.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/questions/1-benefits.adoc index d15befedb..cb61d113f 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/questions/1-benefits.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/5-structured-data/questions/1-benefits.adoc @@ -22,4 +22,4 @@ Adding structured data to a knowledge graph provides several benefits: 3. **Content summarization** - You can group and summarize content by categories, connecting lesson metadata with extracted concepts and technologies The incorrect option suggests that structured data improves entity extraction accuracy, but structured data doesn't directly affect the LLM's ability to extract entities from text - it provides additional context and relationships. -==== \ No newline at end of file +==== diff --git a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/lesson.adoc index d28fbc966..7083ef8c5 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/lesson.adoc @@ -128,4 +128,4 @@ In this lesson, you: * Used the `VectorCypherRetriever` to perform vector similarity search and Cypher retrieval. * Created a `GraphRAG` pipeline to generate responses with context from the knowledge graph. -In the next lesson, you will use the `Text2CypherRetriever` retriever to get information from the knowledge graph based on natural language questions. \ No newline at end of file +In the next lesson, you will use the `Text2CypherRetriever` retriever to get information from the knowledge graph based on natural language questions. diff --git a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/questions/1-graphrag-pipeline.adoc b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/questions/1-graphrag-pipeline.adoc index cea53ed44..68fcae6df 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/questions/1-graphrag-pipeline.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/1-vector-cypher-retriever/questions/1-graphrag-pipeline.adoc @@ -22,4 +22,4 @@ The GraphRAG pipeline follows these three main steps: 3. **Pass the context to an LLM** - Sends all the gathered context to the language model to generate a response to the original query The incorrect option about "generating multiple embeddings for different interpretations" is not part of the described pipeline. The pipeline generates one embedding for the user query and uses it to find similar chunks, rather than creating multiple interpretations. -==== \ No newline at end of file +==== diff --git a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/lesson.adoc index cfd70a98c..224c24708 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/lesson.adoc @@ -76,4 +76,4 @@ In this lesson, you: * Created a `GraphRAG` pipeline using the `Text2CypherRetriever`. * Used natural language questions to generate and execute Cypher queries against the knowledge graph. -In the next module you will explore how to customize the `SimpleKGPipeline` to create knowledge graphs for different types of data, scenarios, and use cases. \ No newline at end of file +In the next module you will explore how to customize the `SimpleKGPipeline` to create knowledge graphs for different types of data, scenarios, and use cases. diff --git a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/questions/1-text2cypher.adoc b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/questions/1-text2cypher.adoc index c9b1adf86..24794cb6b 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/questions/1-text2cypher.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/lessons/2-text-to-cypher-retriever/questions/1-text2cypher.adoc @@ -16,4 +16,4 @@ Think about what makes text-to-cypher different from vector retrieval - what typ .Solution ==== **Text2CypherRetriever is used when you want to get precise information from the knowledge graph using natural language questions**. It generates and executes Cypher queries to answer specific questions like "How many lessons are in a course?", "What concepts are covered in a module?", or "How do technologies relate to each other?". This is different from vector retrieval, which finds similar content, or entity extraction, which processes raw documents. -==== \ No newline at end of file +==== diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/1-loading-data/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/1-loading-data/lesson.adoc index 6aeb8792e..4edc5f0b7 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/1-loading-data/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/1-loading-data/lesson.adoc @@ -115,4 +115,4 @@ read::Continue[] In this lesson, you learned how to create custom data loaders. -In the next lesson, you will learn how to integrate custom chunking and text splitting strategies into the knowledge graph pipeline. \ No newline at end of file +In the next lesson, you will learn how to integrate custom chunking and text splitting strategies into the knowledge graph pipeline. diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc index 506c2283d..8b17a0d3d 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc @@ -107,4 +107,4 @@ read::Continue[] In this lesson, you learned how to create custom text splitters and integrate with LangChain text splitters. -In the next lesson, you will learn how to configure the lexical (unstructured) graph data model. \ No newline at end of file +In the next lesson, you will learn how to configure the lexical (unstructured) graph data model. diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/3-graph-config/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/3-graph-config/lesson.adoc index 8a6e6bcd0..da3f2dce7 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/3-graph-config/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/3-graph-config/lesson.adoc @@ -57,4 +57,4 @@ read::Continue[] In this lesson, you learned how to create a graph configuration to change the structure of the lexical graph. -In the next lesson, you will learn about different models and approaches for resolving entities. \ No newline at end of file +In the next lesson, you will learn about different models and approaches for resolving entities. diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc index f3948b2dd..5e4ccd1a9 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/4-resolving-entities/lesson.adoc @@ -47,4 +47,4 @@ read::Continue[] In this lesson, you learned about entity resolution strategies. -In the next lesson, you will learn how to use and configure different LLMs. \ No newline at end of file +In the next lesson, you will learn how to use and configure different LLMs. diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/5-llm-configuration/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/5-llm-configuration/lesson.adoc index cb18615bd..a17e1aef3 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/5-llm-configuration/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/5-llm-configuration/lesson.adoc @@ -86,4 +86,4 @@ read::Continue[] In this lesson, you learned about the options for configuring the LLM used in the knowledge graph pipeline, including selecting different LLM providers and customizing prompts. -In the next lesson, you will use what you have learned to create your own knowledge graph from your documents. \ No newline at end of file +In the next lesson, you will use what you have learned to create your own knowledge graph from your documents. From 0c6c708e996ec3797e4fe1771d230cdc4c54469c Mon Sep 17 00:00:00 2001 From: Adam Cowley Date: Mon, 10 Nov 2025 17:00:46 +0000 Subject: [PATCH 4/7] technical review --- .../lessons/2-create-a-graph/lesson.adoc | 2 +- .../lessons/4-define-a-schema/lesson.adoc | 2 +- .../4-customisation/lessons/2-splitting-text/lesson.adoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc index e99e8b342..3e60ef228 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/2-create-a-graph/lesson.adoc @@ -34,7 +34,7 @@ include::{repository-raw}/{branch}/genai-graphrag-python/kg_builder.py[] The code loads a single pdf file, `data/genai-fundamentals_1-generative-ai_1-what-is-genai.pdf`, and run the pipeline to create a knowledge graph in Neo4j. -The PDF document contains the content from the link:https://graphacademy.neo4j.com/courses/genai-fundamentals/[Neo4j & Generative AI Fundamentals^] course link:https://graphacademy.neo4j.com/courses/genai-fundamentals/1-generative-ai/1-what-is-genai/[What is Generative AI?^] lesson. +The PDF document contains the content from the link:https://graphacademy.neo4j.com/courses/genai-fundamentals/[Neo4j & Generative AI Fundamentals^] course, specifically the link:https://graphacademy.neo4j.com/courses/genai-fundamentals/1-generative-ai/1-what-is-genai/[What is Generative AI?^] lesson. Breaking down the code, you can see the following steps: diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc index 17945e7a2..b77326830 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc @@ -113,7 +113,7 @@ Review the `data/genai-fundamentals_1-generative-ai_1-what-is-genai.pdf` PDF doc == Process all the documents -When you are happy with the schema, you can modify the program to process all the PDF documents from the link:https://graphacademy.neo4j.com/courses/genai-fundamentals[GraphAcademy Neo4j and Generative AI Fundamentals course]: +When you are happy with the schema, you can modify the program to process all the PDF documents from the link:https://graphacademy.neo4j.com/courses/genai-fundamentals[Neo4j and Generative AI Fundamentals course^]: [source, python] .All PDFs diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc index 8b17a0d3d..d1330171a 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/lessons/2-splitting-text/lesson.adoc @@ -70,7 +70,7 @@ LangChain provides a variety of link:https://python.langchain.com/docs/concepts/ The `neo4j_graphrag` package includes a `LangChainTextSplitterAdapter` class that allows you to integrate LangChain text splitters with the `SimpleKGBuilder`. -You can use the https://python.langchain.com/api_reference/text_splitters/character/langchain_text_splitters.character.CharacterTextSplitter.html[LangChain `CharacterTextSplitter`^] to split text into paragraphs. +You can use the link:https://python.langchain.com/api_reference/text_splitters/character/langchain_text_splitters.character.CharacterTextSplitter.html[LangChain `CharacterTextSplitter`^] to split text into paragraphs. [source,python] ---- From 4f0f90170a5eaa5469d7292b064e5f467e618f65 Mon Sep 17 00:00:00 2001 From: Adam Cowley Date: Mon, 10 Nov 2025 17:03:47 +0000 Subject: [PATCH 5/7] module reviews --- asciidoc/courses/genai-graphrag-python/course.adoc | 2 +- .../genai-graphrag-python/modules/1-introduction/module.adoc | 2 +- .../genai-graphrag-python/modules/3-retrieval/module.adoc | 4 ++-- .../genai-graphrag-python/modules/4-customisation/module.adoc | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/asciidoc/courses/genai-graphrag-python/course.adoc b/asciidoc/courses/genai-graphrag-python/course.adoc index c4a48b5de..f7cf6d4fa 100644 --- a/asciidoc/courses/genai-graphrag-python/course.adoc +++ b/asciidoc/courses/genai-graphrag-python/course.adoc @@ -4,7 +4,7 @@ :duration: 2 hours :caption: Learn how to use Python and LLMs to convert unstructured data into knowledge graphs. :usecase: blank-sandbox -:key-points: Create a knowledge graph using Neo4j GraphRAG for Python, Model a knowledge graph of structure and unstructured data, Query a knowledge graph using retrievers, Customize the knowledge graph build process +:key-points: Create a knowledge graph using Neo4j GraphRAG for Python, Model a knowledge graph of structured and unstructured data, Query a knowledge graph using retrievers, Customize the knowledge graph build process :repository: neo4j-graphacademy/genai-graphrag-python :banner-style: light diff --git a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/module.adoc b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/module.adoc index c649401a9..78991440e 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/1-introduction/module.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/1-introduction/module.adoc @@ -8,7 +8,7 @@ Welcome to Constructing Knowledge Graphs with Neo4j GraphRAG for Python. In this module, you will: * Review the process of creating knowledge graphs from unstructured text. -* Setup a development environment to build your own knowledge graph. +* Set up a development environment to build your own knowledge graph. If you are ready, let's get going! diff --git a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/module.adoc b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/module.adoc index 178d07bf5..795fd58be 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/module.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/3-retrieval/module.adoc @@ -6,8 +6,8 @@ In this module, you will learn: -* How to use retrieval techniques to find relevant information from a knowledge graph -* How vector, vector + cypher, and text to cypher retrievers can be used to get relevant data from a knowledge graph +* How to use retrieval techniques to find relevant information from a knowledge graph. +* How vector, vector + cypher, and text to cypher retrievers can be used to get relevant data from a knowledge graph. [TIP] The link:https://graphacademy.neo4j.com/courses/genai-fundamentals[GraphAcademy Neo4j and Generative AI course^] includes more information on retrievers and how to use them with graphs. diff --git a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/module.adoc b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/module.adoc index 219bda88e..c0bb391f7 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/4-customisation/module.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/4-customisation/module.adoc @@ -9,9 +9,9 @@ You can provide your own implementations for components in the pipeline, or use In this optional module, you will learn how to modify the knowledge graph pipeline to suit your own use case, including: * Creating custom data loaders. -* Implementing a chunking and text splitting strategy. +* Implementing custom chunking and text splitting strategies. * Enhanced entity resolution. -* Using different LLMs and embedding models. +* Using different LLMs and embedding models. If you are ready, let's get going! From e45c13e4c09c7e100811f82247ff55fe8b9124f4 Mon Sep 17 00:00:00 2001 From: Martin O'Hanlon Date: Tue, 11 Nov 2025 10:26:28 +0000 Subject: [PATCH 6/7] add cursor commands --- README.adoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.adoc b/README.adoc index 91e15e893..36edd8e3d 100644 --- a/README.adoc +++ b/README.adoc @@ -143,6 +143,20 @@ You can skip certain time-consuming tests by setting environment variables: * `SKIP_LINK_CHECKS=true` - Skip validation of external links (GitHub repositories, lesson links) * `SKIP_CYPHER_CHECKS=true` - Skip Cypher query validation (file existence checks still run) +== Cursor QA checks + +You can use Cursor to run automated QA checks on the course content. + +Cursor prompts are stored in the `.cursor/` folder. + +To run the checks against a specific course , use the following commands: + +[source, text] +@review-lesson-content.mdc for @genai-graphrag-python +run and fix COURSES=graphrag-python npm run test qa +@technical-lesson-review.mdc +@review-course.mdc + == Contributing To create a new course or modify an existing course, please create a new branch and make your changes. From 218b6726201df58e8f1aef095275f31acdb76533 Mon Sep 17 00:00:00 2001 From: Martin O'Hanlon Date: Wed, 12 Nov 2025 15:36:21 +0000 Subject: [PATCH 7/7] rate limiting tip --- .../lessons/4-define-a-schema/lesson.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc index b77326830..3f1fe4ef1 100644 --- a/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc +++ b/asciidoc/courses/genai-graphrag-python/modules/2-knowledge-graph-pipeline/lessons/4-define-a-schema/lesson.adoc @@ -132,6 +132,12 @@ include::{repository-raw}/{branch}/genai-graphrag-python/solutions/kg_builder_sc ---- ==== +[TIP] +.OpenAI Rate Limiting? +==== +When using a free OpenAI API key, you may encounter rate limiting issues when processing multiple documents. You can add a `sleep` between document processing to mitigate this. +==== + Review the knowledge graph and observe how the defined schema has influenced the structure of the graph. [source, cypher]