langchain.js
    Preparing search index...

    Chain for question-answering against a graph by generating Cypher statements.

    const chain = new GraphCypherQAChain({
    llm: new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0 }),
    graph: new Neo4jGraph(),
    });
    const res = await chain.invoke("Who played in Pulp Fiction?");

    This chain will execute Cypher statements against the provided database. Make sure that the database connection uses credentials that are narrowly-scoped to only include necessary permissions. Failure to do so may result in data corruption or loss, since the calling code may attempt commands that would result in deletion, mutation of data if appropriately prompted or reading sensitive data if such data is present in the database. The best way to guard against such negative outcomes is to (as appropriate) limit the permissions granted to the credentials used with this tool.

    See https://js.langchain.com/docs/security for more information.

    Hierarchy

    • BaseChain
      • GraphCypherQAChain
    Index

    Constructors

    Accessors

    • get inputKeys(): string[]

      Returns string[]

    • get outputKeys(): string[]

      Returns string[]

    Methods

    • Run the core logic of this chain and return the output

      Parameters

      • values: ChainValues
      • OptionalrunManager: any

      Returns Promise<ChainValues>

    • Return the string type key uniquely identifying this class of chain.

      Returns "graph_cypher_chain"