LightRAG icon indicating copy to clipboard operation
LightRAG copied to clipboard

What's the correct approach for setup Graph UI for lightrag

Open Johnny987 opened this issue 10 months ago • 9 comments

I'm following this guide for setup: https://github.com/HKUDS/LightRAG/blob/main/lightrag_webui/README.md

  1. Done all the steps in the page and "bun run dev"
  2. Open http://localhost:5173
  3. Get the 'Backend Health Check Error'

I assume there should be a LightRag server running, so I tried setup using the below command:

python -m lightrag.api.lightrag_server \
  --llm-binding openai \
  --llm-binding-host https://api.openai.com/v1 \
  --llm-binding-API-key <my_api_key> \
  --llm-model gpt-4

I've neo4j docker running already, and configured NEO4J_URI, username and pwd in .env.example for in project root path. But still get the following error: neo4j.exceptions.ConfigurationError: URI scheme b'' is not supported. Supported URI schemes are ['bolt', 'bolt+ssc', 'bolt+s', 'neo4j', 'neo4j+ssc', 'neo4j+s']. Examples: bolt://host[:port] or neo4j://host[:port][?routing_context]

So am I did the right steps or anything else I miss? Is there a guide on how a user can start this server? Could you add this to the Graph UI guide? I believe this is a mandatory prerequisite before running the frontend webui, thanks

Johnny987 avatar Feb 19 '25 08:02 Johnny987

NOTE: Neo4j we have couple of issue. We are looking for someone have a look.

YanSte avatar Feb 19 '25 09:02 YanSte

NOTE: Neo4j we have couple of issue. We are looking for someone have a look.

Is Neo4j the must-have KG storage if I want to use the WebGUI, is there an alternative solution?

Johnny987 avatar Feb 19 '25 09:02 Johnny987

I think for now the only one that works for showing the graph is MongiDB and Neo4j, all other implementations (json/postgresql etc) are under construction and most of the methods that are required by the webui are not implemented yet (but they will all be implemented).

To make the webui work, you can read the actual documentation:

https://github.com/HKUDS/LightRAG/tree/main/lightrag/api

You can just install the lightrag with the [api] option which automatically gives you access to the lightrag_server command (no need to do python -m)

Also, make sure you have a config.ini file in your folder where you can set all the information of your Neo4j server.

Just read the doc, it contains everything.

ParisNeo avatar Feb 19 '25 09:02 ParisNeo

I think for now the only one that works for showing the graph is MongiDB and Neo4j, all other implementations (json/postgresql etc) are under construction and most of the methods that are required by the webui are not implemented yet (but they will all be implemented).

To make the webui work, you can read the actual documentation:

https://github.com/HKUDS/LightRAG/tree/main/lightrag/api

You can just install the lightrag with the [api] option which automatically gives you access to the lightrag_server command (no need to do python -m)

Also, make sure you have a config.ini file in your folder where you can set all the information of your Neo4j server.

Just read the doc, it contains everything.

Thanks it works, successfully started server by running: lightrag-server --llm-binding openai --llm-model GPT-4o-mini --embedding-binding openai --embedding-model text-embedding-3-small

but I got an error when I tried to upload a document in webui, Do you know what might be wrong?

Johnny987 avatar Feb 20 '25 02:02 Johnny987

Can you be more specific? There are multiple possible errors. Just show the log if possible please.

ParisNeo avatar Feb 20 '25 10:02 ParisNeo

Can you be more specific? There are multiple possible errors. Just show the log if possible please.

This is the error I saw in console:

ERROR:Error indexing file Test Book.txt: 'list' object has no attribute 'upsert'
ERROR:Traceback (most recent call last):
  File "/LightRAG/lightrag/api/lightrag_server.py", line 1228, in pipeline_index_file
    await rag.apipeline_process_enqueue_documents()
  File "/LightRAG/lightrag/lightrag.py", line 845, in apipeline_process_enqueue_documents
    self.text_chunks.upsert(chunks),
AttributeError: 'list' object has no attribute 'upsert'. Did you mean: 'insert'?

And frontend job always in progress.

BTW, now the records of uploaded documents in http://localhost:9621/webui/ page seems can't be deleted. There's a 'Clear' button, but it's not working.

Image

Johnny987 avatar Feb 20 '25 14:02 Johnny987

I try to upload one file test lightrag server by webui and get the same error as:

INFO:Number of batches to process: 1. INFO:Start processing batch 1 of 1. ERROR:Error indexing file book.txt: 'list' object has no attribute 'upsert' ERROR:Traceback (most recent call last): File "G:\git\LightRAG\lightrag\api\lightrag_server.py", line 1245, in pipeline_index_file await rag.apipeline_process_enqueue_documents() File "G:\git\LightRAG\lightrag\lightrag.py", line 737, in apipeline_process_enqueue_documents await asyncio.gather(*batches) File "G:\git\LightRAG\lightrag\lightrag.py", line 700, in batch self.text_chunks.upsert(chunks), ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute 'upsert'. Did you mean: 'insert'?

guocht avatar Feb 21 '25 12:02 guocht

What storage are you using? Can you please send the debug information at startup of your server?

ParisNeo avatar Feb 21 '25 13:02 ParisNeo

What storage are you using? Can you please send the debug information at startup of your server?

I'm using Neo4J for the storage(neo4j configuration was already set in config.ini) Attaching all the console output.

INFO:No new unique documents were found.
INFO:Successfully fetched and enqueued file: Book.txt
INFO:Number of batches to process: 1.
INFO:Start processing batch 1 of 1.
/LightRAG/lightrag/lightrag.py:700: RuntimeWarning: coroutine 'JsonKVStorage.upsert' was never awaited
  self.text_chunks.upsert(chunks),
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/LightRAG/lightrag/lightrag.py:700: RuntimeWarning: coroutine 'LightRAG._process_entity_relation_graph' was never awaited
  self.text_chunks.upsert(chunks),
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/LightRAG/lightrag/lightrag.py:700: RuntimeWarning: coroutine 'NanoVectorDBStorage.upsert' was never awaited
  self.text_chunks.upsert(chunks),
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/LightRAG/lightrag/lightrag.py:700: RuntimeWarning: coroutine 'JsonDocStatusStorage.upsert' was never awaited
  self.text_chunks.upsert(chunks),
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
ERROR:Error indexing file Book.txt: 'list' object has no attribute 'upsert'
ERROR:Traceback (most recent call last):
  File "/LightRAG/lightrag/api/lightrag_server.py", line 1245, in pipeline_index_file
    await rag.apipeline_process_enqueue_documents()
  File "/LightRAG/lightrag/lightrag.py", line 737, in apipeline_process_enqueue_documents
    await asyncio.gather(*batches)
  File "/LightRAG/lightrag/lightrag.py", line 700, in batch
    self.text_chunks.upsert(chunks),
AttributeError: 'list' object has no attribute 'upsert'. Did you mean: 'insert'?

Johnny987 avatar Feb 21 '25 14:02 Johnny987