Knowledge Graph Builder App Local deployment

I am trying to deploy locally Knowledge Graph Builder App using instructions at

Here are my environment
MacBook Pro M3 18GB
macOS 15.1.1
Neo4j Desktop 1.6.1
created a sample database with APOC 5.24.2

Successfully installed frontend:
cd frontend
yarn
yarn run dev

For backend: no error
cd backend
python -m venv envName
source envName/bin/activate
pip install -r requirements.txt

until:
uvicorn score:app --reload

error message:
/Users/peterchan/llm-graph-builder/backend/envName/lib/python3.10/site-packages/pydantic/_internal/fields.py:161: UserWarning: Field "model_name" has conflict with protected namespace "model".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = ().
warnings.warn(
2024-12-09 13:22:50,887 - Python-dotenv could not parse statement starting at line 28
/Users/peterchan/llm-graph-builder/backend/src/shared/common_fn.py:89: LangChainDeprecationWarning: The class HuggingFaceEmbeddings was deprecated in LangChain 0.2.2 and will be removed in 1.0. An updated version of the class exists in the :class:~langchain-huggingface package and should be used instead. To use it run pip install -U :class:~langchain-huggingface and import as from :class:~langchain_huggingface import HuggingFaceEmbeddings``.
embeddings = SentenceTransformerEmbeddings(

I am an archivist with very limited technical skills. I need to run a knowledge graph app locally because the data I am using is restricted by privacy and copyrights. Any help will be very much appreciated.

I updated the code from github which was updated 11 hrs ago. The previous are gone. But, I got following errors when I start "http://localhost:5173/" in a tab,

in Frontend:
warn - The safelist pattern /^(hover:)?n-text-(palette|dark|light|primary|danger|warning|success|blueberry|mint|neutral)-/ doesn't match any Tailwind CSS classes.

warn - The safelist pattern /^(hover:)?n-bg-(palette|dark|light|primary|danger|warning|success|blueberry|mint|neutral)-/ doesn't match any Tailwind CSS classes.

warn - The safelist pattern /^(active:)?n-bg-(palette|dark|light|primary|danger|warning|success|blueberry|mint|neutral)-/ doesn't match any Tailwind CSS classes.

warn - The safelist pattern /^(hover:)?n-border-(palette|dark|light|primary|danger|warning|success|blueberry|mint|neutral)-/ doesn't match any Tailwind CSS classes.

(node:15207) ExperimentalWarning: CommonJS module /Users/peterchan/llm-graph-builder/frontend/node_modules/tailwindcss/lib/lib/load-config.js is loading ES Module /Users/peterchan/llm-graph-builder/frontend/tailwind.config.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use node --trace-warnings ... to show where the warning was created)
file:///Users/peterchan/llm-graph-builder/frontend/tailwind.config.js:11
presets:[require('@neo4j-ndl/base').tailwindConfig],
^

ReferenceError: require is not defined
at file:///Users/peterchan/llm-graph-builder/frontend/tailwind.config.js:11:11
at ModuleJobSync.runSync (node:internal/modules/esm/module_job:395:35)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:329:47)
at loadESMFromCJS (node:internal/modules/cjs/loader:1376:24)
at Module._compile (node:internal/modules/cjs/loader:1528:5)
at Object..js (node:internal/modules/cjs/loader:1698:10)
at Module.load (node:internal/modules/cjs/loader:1303:32)
at Function._load (node:internal/modules/cjs/loader:1117:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
at Module.require (node:internal/modules/cjs/loader:1325:12)
at require (node:internal/modules/helpers:136:16)
at /Users/peterchan/llm-graph-builder/frontend/node_modules/tailwindcss/lib/lib/load-config.js:54:27
at loadConfig (/Users/peterchan/llm-graph-builder/frontend/node_modules/tailwindcss/lib/lib/load-config.js:58:6)
at getTailwindConfig (/Users/peterchan/llm-graph-builder/frontend/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:71:116)
at /Users/peterchan/llm-graph-builder/frontend/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:100:92
at /Users/peterchan/llm-graph-builder/frontend/node_modules/tailwindcss/lib/processTailwindFeatures.js:46:11
at plugins (/Users/peterchan/llm-graph-builder/frontend/node_modules/tailwindcss/lib/plugin.js:38:69)
at LazyResult.runOnRoot (/Users/peterchan/llm-graph-builder/frontend/node_modules/postcss/lib/lazy-result.js:329:16)
at LazyResult.runAsync (/Users/peterchan/llm-graph-builder/frontend/node_modules/postcss/lib/lazy-result.js:258:26)
at LazyResult.async (/Users/peterchan/llm-graph-builder/frontend/node_modules/postcss/lib/lazy-result.js:160:30)
at LazyResult.then (/Users/peterchan/llm-graph-builder/frontend/node_modules/postcss/lib/lazy-result.js:404:17)

Node.js v23.3.0
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.

In Bankend:
/Users/peterchan/llm-graph-builder/backend/src/shared/common_fn.py:19: SyntaxWarning: invalid escape sequence '/'
if re.match('(?:https?://)?(?:www.)?youtu.?be(?:.com)?/?.*(?:watch|embed)?(?:.*v=|v/|/)([\w-_]+)&?',yt_url.strip()):
2024-12-11 14:16:44,181 - PyTorch version 2.5.1 available.
2024-12-11 14:16:46,098 - Use pytorch device_name: mps
2024-12-11 14:16:46,098 - Load pretrained SentenceTransformer: all-MiniLM-L6-v2
2024-12-11 14:16:48,388 - Embedding: Using Langchain HuggingFaceEmbeddings , Dimension:384
2024-12-11 14:16:48,391 - USER_AGENT environment variable not set, consider setting it to identify your requests.
2024-12-11 14:16:48,647 - Use pytorch device_name: mps
2024-12-11 14:16:48,647 - Load pretrained SentenceTransformer: all-MiniLM-L6-v2
2024-12-11 14:16:49,988 - Embedding: Using Langchain HuggingFaceEmbeddings , Dimension:384
[nltk_data] Downloading package punkt to /Users/peterchan/nltk_data...
[nltk_data] Package punkt is already up-to-date!
2024-12-11 14:16:50,272 - Use pytorch device_name: mps
2024-12-11 14:16:50,272 - Load pretrained SentenceTransformer: all-MiniLM-L6-v2
2024-12-11 14:16:51,929 - Embedding: Using Langchain HuggingFaceEmbeddings , Dimension:384
INFO: Started server process [16408]
INFO: Waiting for application startup.
INFO: Application startup complete.

Now, no error in both frontend and backend.

However, I have This site can’t be reached
localhost refused to connect.
for http://localhost:5173/

I installed the same package in an Intel mac and it works. I think the code need changes for M3 mac.

I install node 20 and it works now.

1 Like

Hey, I am trying the same thing. I am deploying the knowledge graph builder to run locally because of the privacy issues with my data. How did you do that??

There are instructions for local deployment: GitHub - neo4j-labs/llm-graph-builder: Neo4j graph construction from unstructured data using LLMs

I installed a local instance of the Knowledge Graph app. I can load files using "Drag and Drop" and the "Web Sources" tab. However, in the Preview Graph, only "Document & Chuck" appear and no entities. I used Graph Enhancement to add "movies" as a predefined schema, reprocess the file, and the result is still missing entities. I am wondering what went wrong.

There are also some more installation instructions here, besides the readme, which we just updated.

I want to use other LLMs via Ollama and put the following in .env file
LLM_MODEL_CONFIG_ollama_llama3="llama3,http :// localhost:11434"
Unfortunately, llama3 does not appear in the LLM Models in the bottom left-hand corner.
I tried LLM_MODEL_CONFIG_ollama_llama3="llama3,http :// host.docker.internal:11434" as well and got the same result.

I also try this and failed as well:
LLM_MODEL_CONFIG_ollama_<model_name>
#example
LLM_MODEL_CONFIG_ollama_llama3=${LLM_MODEL_CONFIG_ollama_llama3-llama3,
http:// host.docker.internal:11434}

I found this in backend terminal:
Failed to create GDS driver: The Graph Data Science library is not correctly installed on the Neo4j server.
Please refer to https: //neo4j.com/docs/graph-data-science/current/installation/.

2024-12-13 12:58:38,088 - Failed to create communities: The Graph Data Science library is not correctly installed on the Neo4j server.
Please refer to https: // Installation - Neo4j Graph Data Science.

I used https:/ /github.com/neo4j-labs/llm-graph-builder.git to install the app. Any suggestion on how to fix this issue?

I installed GDS Library via Neo4j desktop. But still no entity show.