Home / Articles

Neo4j LLM Graph Builder: From Documents to Queryable Knowledge Graphs

Neo4j LLM Graph Builder from clone to a queryable knowledge graph: backend and frontend config, credentials, a sample ingest, and fixes for APOC and TLS.

Publisher: REACTAPP.TOP8 min read1845 words

This article is published in English.

Sources: Building Knowledge Graphs from Documents with Neo4j LLM Graph Builder

This walkthrough rebuilds the path from raw materials to a working system for: Building Knowledge Graphs from Documents with Neo4j LLM Graph Builder. The focus is operable steps, explicit checks, and code that you can drop into a repo without guessing intent. For Overview, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph.

Prerequisites

For Prerequisites, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Model nodes and relationships for the questions you will ask, not for every noun in the document. Sparse, typed edges beat dense mystery graphs.

Step 1: Clone the Repository

For Step 1: Clone the Repository, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Model nodes and relationships for the questions you will ask, not for every noun in the document. Sparse, typed edges beat dense mystery graphs.

git clone https://github.com/neo4j-labs/llm-graph-builder.git
cd llm-graph-builder

Step 2: Configure and Run the Backend

For Step 2: Configure and Run the Backend, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Model nodes and relationships for the questions you will ask, not for every noun in the document. Sparse, typed edges beat dense mystery graphs. For Step 2: Configure and Run the Backend, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph.

cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
NEO4J_URI = "bolt://<hostname>:7687"
NEO4J_USERNAME = "neo4j"
NEO4J_PASSWORD = "<password>"
NEO4J_DATABASE = "neo4j"

LLM_MODEL_CONFIG_META_LLAMA3_1_8B="meta-llama/Meta-Llama-3.1-8B-Instruct,http://<hostname>:<port>/fast/v1,<API_KEY>"
LLM_MODEL_CONFIG_GEMINI_2_5_FLASH="gemini-2.5-flash"

TRACK_USER_USAGE="false"

Step 3: Configure and Run the Frontend

For Step 3: Configure and Run the Frontend, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Use constraints and indexes before bulk ingest. Uniqueness on business keys turns later merges into predictable upserts instead of duplicate storms.

cd frontend
sudo apt update && sudo apt install yarn -y
VITE_BACKEND_API_URL="https://backendgb.datamindslab.in"
VITE_LLM_MODELS="gemini_2.5_flash,meta_llama3_1_8b,diffbot,openai_gpt_5.4_mini,gemini_3.5_flash,anthropic_claude_4.5_haiku"
VITE_FRONTEND_HOSTNAME="https://graphbuilder.datamindslab.in"
yarn run dev

Step 4: Connect Database & LLM Credentials

For Step 4: Connect Database & LLM Credentials, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Use constraints and indexes before bulk ingest. Uniqueness on business keys turns later merges into predictable upserts instead of duplicate storms.

Step 5: Ingest a Sample Document and Generate a Graph

For Step 5: Ingest a Sample Document and Generate a Graph, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Use constraints and indexes before bulk ingest. Uniqueness on business keys turns later merges into predictable upserts instead of duplicate storms. For Step 5: Ingest a Sample Document and Generate a Graph, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph.

Sample Document text

For Sample Document text, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Inspect a sample neighborhood after the first batch. Cypher probes catch label drift and missing properties cheaper than end-to-end chat tests.

Processing Steps

For Processing Steps, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Inspect a sample neighborhood after the first batch. Cypher probes catch label drift and missing properties cheaper than end-to-end chat tests.

Nodes (Entities):        538
Relationships (Edges):   1541
SiteScope
OBM
URL Monitor
CPU Monitor
Windows Server
Database
Service
Alert
Threshold
SiteScope --MONITORS--> Windows Server
SiteScope --CONNECTS_TO--> OBM
CPU Monitor --GENERATES--> Alert
Database --HOSTS--> SiteScope

Graph Density — A useful metric is:

For Graph Density — A useful metric is:, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Inspect a sample neighborhood after the first batch. Cypher probes catch label drift and missing properties cheaper than end-to-end chat tests.

1541 relationships / 538 nodes
≈ 2.86 relationships per node

For Graph Density — A useful metric is:, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph.

Token Usage

For Token Usage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Model nodes and relationships for the questions you will ask, not for every noun in the document. Sparse, typed edges beat dense mystery graphs.

422,085 tokens
422,085 tokens
≈ 300,000–350,000 words
≈ 800–1200 pages of processed content

Challenges Encountered

For Challenges Encountered, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Model nodes and relationships for the questions you will ask, not for every noun in the document. Sparse, typed edges beat dense mystery graphs.

Neo4j APOC Compatibility

For Neo4j APOC Compatibility, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion. Model nodes and relationships for the questions you will ask, not for every noun in the document. Sparse, typed edges beat dense mystery graphs. For Neo4j APOC Compatibility, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph.

SSL Certificate Issues

For SSL Certificate Issues, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Use constraints and indexes before bulk ingest. Uniqueness on business keys turns later merges into predictable upserts instead of duplicate storms.

Google Gemini Authentication

For Google Gemini Authentication, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Prefer small, testable units over sprawling scripts. When a step fails, the failure should point at a single responsibility rather than a tangled pipeline. Use constraints and indexes before bulk ingest. Uniqueness on business keys turns later merges into predictable upserts instead of duplicate storms.

Resource Management

For Resource Management, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state.

Conclusion

Operational checklist