-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Neo4J integration. #197
Neo4J integration. #197
Conversation
Excellent work! By the way, I wanted to ask if you have any plans to integrate Neo4j to create a visualization of the partial KG used during queries. What I mean is, currently the KG shows all the entities and relations, but when we perform a query, we only actually use a subset of entities and relations relevant to our query. If we could display the partial KG that highlights the specific entities and relations that Lightrag used to generate the answer, I think it would make the response more convincing and intuitive. |
Seems to me like this would be a dev time concern since there would be no use case to show a sub-graph in production. I'm focusing on production concerns atm, with an integration for a commercial Vector store next (Pinecone most likely). But You can probably capture the cypher queries using debug mode. I'll see if I can add a specific debug output in debug mode to show the subgraph(s) nodes/queries that were used to augment the response. Maybe I can return one executable query to select the subgraph(s). Then you'd just need to copy and paste in to Neo4J browswer. I do agree that this would be pretty useful for debugging. |
Thanks for your excellent work! |
you got it. happy to contribute.
…On Mon, Nov 4, 2024 at 7:50 AM zrguo ***@***.***> wrote:
Thanks for your excellent work!
—
Reply to this email directly, view it on GitHub
<#197 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABG7F37PUM7OAGQLNSTFFC3Z65URXAVCNFSM6AAAAABRCD5EH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJUGYZTKMRZHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Ken Wiltshire** |* Executive Engineer
NYC Metro Area
Direct (347) 675-5213
|
Integration pull for Neo4j. I kept changes to a single folder (KG). With minor edits in lightrag.py. Its using configurable start params. Steps are in the readme but here's all you'll need to do:
Then set up login credentials via Neo4J Browser @ http://localhost:7474/
export NEO4J_URI="neo4j://localhost:7687"
export NEO4J_USERNAME="[your Neo4J Username]"
export NEO4J_PASSWORD="[your Neo4J Password]"
run: python3 test_neo4j.py
rag = LightRAG(
working_dir=WORKING_DIR,
llm_model_func=gpt_4o_mini_complete, # Use gpt_4o_mini_complete LLM model
kg="Neo4JStorage", #<-----------override KG default
log_level="DEBUG" #<-----------override log_level default
)
The changes are non-dissruptive and non-breaking. Existing deployments that do not specify these start params and env vars will work the same and simply use the default values. One change to note is in lightrag.py, always_get_an_event_loop(), needed to use current loop opposed to a new one. I think this is how you would want it to work regardless.
Please review this PR and let me know if you need me to make any other changes to have it merged in. I believe you'll see significant adoption by adding production level features to the project.