-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
community: update Memgraph integration #27017
community: update Memgraph integration #27017
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi @baskaryan, tagging as noted in PR template. Please let me know what I need to do regarding the test and what's needed to do in order to get this merged. |
I managed to fix the CI. Now, all is passing. Tagging @efriis, as the other person from the PR template for the review. Let me know if someone else should be tagged. |
Hey! Here's a link to the review policy: https://python.langchain.com/docs/contributing/review_process/ Status is currently needs support |
@efriis is there any update? I have more than 5 upvotes so I am wondering what's the next course of action here and if I can help somehow. |
Thank you, @libraua, for approving this PR. Is there something else I need to do to get this PR merged? I wanted to enable Memgraph developers to utilize Memgraph LangChain integration with the latest improvements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @katarinasupe, I don't want to block this but have some qualms about MemgraphQAChain
. I think the fact that other graph databases implement custom Chain
classes is not an advantage and may not be desirable to emulate. MemgraphQAChain
also uses LLMChain, which is deprecated (I include a comment below).
LangChain is investing in LangGraph, and instead of releasing and maintaining a v0.0 abstraction, you could advantage yourself by implementing these as tools and adding documentation demonstrating their use in question-answering using a modern agent framework.
- Migration guides for other chains: https://python.langchain.com/docs/versions/migrating_chains/
- Example of how we'd recommend querying SQL data using an agent: https://python.langchain.com/docs/integrations/tools/sql_database/#use-within-an-agent
Our documentation across integrations has not kept up with our current understanding of best practices, so apologies for the confusion. If you want to move forward with MemgraphQAChain
we can go ahead (but suggest we remove LLMChain). Wanted to make sure you're aware of current best practices first.
|
||
cypher_generation_chain = LLMChain( | ||
llm=cypher_llm or llm, # type: ignore[arg-type] | ||
**use_cypher_llm_kwargs, # type: ignore[arg-type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need use_cypher_llm_kwargs
or use_qa_llm_kwargs
? Ideally we would avoid LLMChain and just use prompt | llm | parser
(e.g., as you do above).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review. Let me digest this today and figure out the next best steps 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ccurme, based on your suggestion, I removed LLMChain
. Please let me know if I did that correctly. I changed the code, so it's working for the example provided in the Jupyter Notebook. Let me know if I missed smth while updating chains from LLMChain
to Runnable
types.
Although it's not ideal, I would like this PR to be merged. I see devs using it, and I would like this work not to go to waste. Still, I am interested in following the best practices out there. I need to take a deeper look at the tools you sent me. If I understood correctly, no other graph database currently follows this approach, or?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ccurme any updates here? I would love to get this merged if possible 🙏
@ccurme is this available as part of langchain-core==0.3.23? |
This will be available in the next release of |
Description:
Neo4jGraphStore
but implementsGraphStore
, just like other graph databases.GraphQAChain
, but implementsMemgraphQAChain
, just like other graph databases.SHOW SCHEMA INFO
. The fallback uses Cypher queries (a combination of schema and Cypher) → LangChain integration no longer relies on MAGE library.add_graph_documents()
method has been implemented. It transformsGraphDocument
into Cypher queries and creates a graph in Memgraph. It implements the ability to usebaseEntityLabel
to improve speed (baseEntityLabel
has an index on theid
property). It also implements the ability to include sources by creating aMENTIONS
relationship to the source document.Closes #25606