Describe the problem/error/question
I’m trying to interact with a Neo4JVectorStore via the respective langchain class inside a LangChain Code node. The Node has one input, for an embedding (Using the OpenAI Embedding node there)
The code is similar to that shown as example for interaction with a redis vector store in https://community.n8n.io/t/using-redis-vectorstore-search-in-n8n/49301 :
// Import required modules
const { Neo4jVectorStore } = require('@langchain/community/vectorstores/neo4j_vector');
const { OpenAIEmbeddings } = require('@langchain/openai');
// Configuration for Neo4j
const neo4jConfig = {
url: "neo4j+s://XXXXXXXX.databases.neo4j.io",
username: "XXXXXX",
password: "XXXXXX",
indexName: "movienames",
nodeLabel: "Actor",
textNodeProperties: ["name"],
embeddingNodeProperty: "embedding",
searchType: "hybrid"
};
const embedding = await this.getInputConnectionData('ai_embedding', 0);
// You should have a populated Neo4j database to use this method
const neo4jVectorIndex = await Neo4jVectorStore.fromExistingGraph(
embedding,
neo4jConfig
);
await neo4jVectorIndex.close();
// Run the function and return the result
return true;
The code is inserted as execute type code
What is the error message (if any)?
Upon execution (via the “play” button above the node) I get the error message
“Problem in node ‘Create Embedding‘
embeddings.embedQuery is not a function null”
(“Create Embedding” is the name of the node the code lives in)
Share your workflow
##Instance info
- n8n version: 1.67.1
- Database (default: SQLite): sqlite
- n8n EXECUTIONS_PROCESS setting (default: own, main): executionMode: regular
- Running n8n via (Docker, npm, n8n cloud, desktop app): npm
- Operating system: TBD