Skip to content
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

feat: add Neo4j Cypher Search #2741

Merged
merged 11 commits into from
Sep 30, 2023
Merged

feat: add Neo4j Cypher Search #2741

merged 11 commits into from
Sep 30, 2023

Conversation

easwee
Copy link
Contributor

@easwee easwee commented Sep 28, 2023

Porting Neo4j and GraphCypherQAChain from LangChain Python.

@vercel
Copy link

vercel bot commented Sep 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Sep 30, 2023 7:49am

@dosubot dosubot bot added the auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features label Sep 28, 2023
@@ -1121,6 +1121,7 @@
"langchainhub": "~0.0.6",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on the PR! I noticed that this change adds a new hard dependency ("node-llama-cpp"). This comment is just to flag the change for maintainers to review.

@@ -0,0 +1,40 @@
/* eslint-disable no-process-env */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is flagging the addition of code that accesses environment variables via process.env in the cypher.test.ts file. Maintainers should review this change to ensure proper handling and usage of environment variables.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What needs to be done to resolve this issue?

@@ -0,0 +1,21 @@
/* eslint-disable no-process-env */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on adding the test case for initializing and connecting to the Neo4j database! This comment is just flagging the use of environment variables via process.env for maintainers to review.

Copy link
Contributor

@adam-cowley adam-cowley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just a few minor comments

langchain/src/chains/graph_qa/tests/cypher.test.ts Outdated Show resolved Hide resolved
await graph.query("MATCH (n) DETACH DELETE n");

// Create two nodes and a relationship
await graph.query(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    await graph.query(
      "CREATE (a:Actor {name:'Bruce Willis'})" +
        "-[:ACTED_IN {role: "Butch Coolidge"}]->(:Movie {title: 'Pulp Fiction'})"
    );

Then the output would be Bruce Willis played Butch Coolidge in Pulp Fiction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oskarhane had a bunch of problems retrieving the role of a an actor in a movie, so I wouldn't add that to the test since it would be more a test of an LLM than the implementation

@@ -0,0 +1,40 @@
/* eslint-disable no-process-env */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What needs to be done to resolve this issue?

@easwee easwee changed the title (WIP)feat: add Neo4j Cypher Search feat: add Neo4j Cypher Search Sep 28, 2023
@tomasonjo
Copy link
Contributor

LGTM

@jacoblee93
Copy link
Collaborator

jacoblee93 commented Sep 29, 2023

Looks great (and am happy to merge) but we should add some docs with setup and usage instructions under /docs/extras/?

returnDirect?: boolean;
}

export class GraphCypherQAChain extends BaseChain {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to show this in expression language as well at some point if possible!

@jacoblee93 jacoblee93 self-assigned this Sep 29, 2023
@jacoblee93 jacoblee93 added the lgtm PRs that are ready to be merged as-is label Sep 29, 2023
@jacoblee93
Copy link
Collaborator

CI is failing - maybe because it's relying on an env var being set? Can we swap it out with a dummy value?

@tomasonjo tomasonjo mentioned this pull request Sep 29, 2023
@jacoblee93
Copy link
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features lgtm PRs that are ready to be merged as-is
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants