Get Started With GraphRAG: Neo4j’s Ecosystem Tools


Get Started With GraphRAG: Neo4j Ecosystem Tools

We’re excited to introduce new resources for GenAI applications: Neo4j GraphRAG Ecosystem Tools. These open-source tools make it easy to get started with GenAI applications grounded with knowledge graphs, which help improve response quality and explainability and accelerate app development and adoption.

GraphRAG combines retrieval-augmented generation (RAG) with knowledge graphs to solve critical LLM issues like hallucination and lack of domain-specific context. Knowledge graphs provide the contextual memory LLMs need to reliably answer questions and serve as trusted agents in complex workflows—and unlike most RAG solutions, which only offer access to fragments of textual data, GraphRAG integrates structured and semi-structured information into the retrieval process.

These new tools will help you create a knowledge graph from unstructured text and use that graph—or an existing graph database—to retrieve relevant information for generative tasks via both vector and graph search.

Neo4j's GraphRAG Ecosystem

You can use the tools to kickstart GenAI development, integrate them into your own systems, or use them as a reference template for building your own custom implementations. The current implementations use our LangChain integrations for Python and Javascript, but you can also build them with other languages and frameworks.

In this post, we give an overview of the LLM Knowledge Graph Builder, NeoConverse, and GenAI framework integrations.

Quickly Turn Unstructured Text Into a Knowledge Graph

The Neo4j Knowledge Graph Builder can seem magical—just load unstructured text to produce a structured graph that surfaces hidden entities and relationships within the data. It works with PDFs, Word documents, YouTube transcripts, Wikipedia pages, and many other kinds of unstructured text.

Neo4j Knowledge Graph Builder

If you’re new to graph technology, you can use the Knowledge Graph Builder to easily create graphs from familiar domain information. More experienced graph developers might use it to kickstart new projects. You can use the Graph Builder online. If you do not have a Neo4j instance, you can create a free Neo4j Aura database.

In addition to extracting source documents and their chunks and embeddings as the lexical graph, the Graph Builder extracts the graph of entities and their relationships and connects them to the chunks.

To see the unstructured and structured contextual data behind the answers, you can visualize and question the ingested data. And because we use GraphRAG behind the scenes for every vector search result, we can fetch the associated entities and provide them to the LLM to generate an answer.

Information retrieval.

The Graph Builder front-end is a React application that uses the Neo4j design system (via the Needle Starter Kit) and the recently published Neo4j Visualization Library. The backend uses the LangChain integrations for the interactions with Neo4j, the knowledge graph extraction, and the GraphRAG search that combines vector search with graph retrieval queries. Written in Python, it uses FastAPI and runs as containers on Google Cloud Run.

You can use the LangChain integrations in your own code, as shown below, for knowledge graph construction:

from langchain_experimental.graph_transformers import LLMGraphTransformer
from langchain_openai import ChatOpenAI
from langchain_community.graphs import Neo4jGraph

graph = Neo4jGraph()
llm = ChatOpenAI(temperature=0, model_name="gpt-4o")

kg_transformer = LLMGraphTransformer( llm=llm,
  allowed_nodes=["Person", "Country", "Company"],
  allowed_relationships=["LOCATED_IN","WORKED_AT"])

results = kg_transformer.convert_to_graph_documents(documents)
graph.add_graph_documents(results)

To learn more about the Knowledge Graph Builder, find the source code, and see walkthrough videos, check out our Graph Builder page. Better yet, try it yourself with your own files. You can also watch the short demo video here:

Watch the Knowledge Graph Builder Demo

Query Your Graph Using Natural Language

Our NeoConverse tool uses the structure of an existing knowledge graph to generate Cypher graph queries from a user’s question and then executes them against the Neo4j database. Those query results are used to generate a text or chart response. (You can test out NeoConverse at your convenience)

Here’s the NeoConverse flow:

    1. User selects the dataset and if they want responses as text or chart.
    2. User asks the question.
    3. The system extracts the database schema from the database and combines it with the user question to generate a prompt for the configured LLM.
    4. The LLM generates a Cypher query to execute against the database.
    5. The query is validated and executed.
    6. The query results are sent to the LLM with the user question and a specific prompt to either generate a response as markdown text or configuration for the charting library.

The NeoConverse Flow

NeoConverse comes with several pre-configured datasets to demonstrate its capabilities. For each, you can see a schema of the database and example questions (click on the vertical ellipsis). You can also configure additional datasets in NeoConverse to connect to your own Neo4j database.

NeoConverse pre-configured datasets.

To read more about NeoConverse, and find additional videos, blog posts, and the link to the GitHub repository, head over to our NeoConverse page.


Kickstart GenAI Development:


Use Your Preferred LLM Frameworks

Neo4j integrates seamlessly with most open-source GenAI ecosystem libraries for Python, JavaScript, Java, and .Net.

Use your favorite LLM framework with Neo4j.

We’ve integrated with LangChain Python and LangChain JavaScript to provide vector and graph search, text-to-cypher, conversational memory, knowledge graph construction, advanced RAG templates, and much more.

Our LlamaIndex integrations include Cypher search, vector search, knowledge graph representation and construction, and text-to-cypher querying. We recently collaborated with the LlamaIndex team on a full revamp of the knowledge graph integration for both construction and querying.

For Deepset’s Haystack, we got a valuable community contribution for vector search and Cypher querying, and we’ll be adding more capabilities soon.

In the Java space, we’ve integrated vector search into Spring AI and LangChain4j. We’ve also implemented Neo4j support for semantic memory in Semantik Kernel. Finally, in DSPy, we’ve added a Neo4j-based Retriever Module that makes use of the Neo4j vector index.

Many of these integration pages point to relevant starter kit implementations that explain how to build GraphRAG applications on the Edgar SEC filings dataset.

Advance Your Skills for GraphRAG and GenAI Development

For a deeper dive into the Neo4j GraphRAG tools and GenAI ecosystem, take a look at our GenAI ecosystem pages.

The pages provide much more detail on Neo4j GenAI features like embedding generation and vector search, as well as information on our cloud-native GenAI integrations with Google (Vertex AI), AWS (Bedrock), and Azure (OpenAI)—including a video tutorial for each service.

You’ll also find example GenAI projects, including GraphRAG demos, NeoConverse, and the Knowledge Graph Builder in action, explaining the functionality behind each tool.

Hands-on learning opportunities are available as well. We’ve collaborated with Deeplearning AI on a knowledge graph course that walks you through building graph-powered GenAI applications.

We also teach GenAI app development in depth in our free GraphAcademy courses.


Kickstart GenAI Development: