Flowise
Flowise copied to clipboard
[FEATURE]Can you add milvus to project?
Langchainjs support milvus. Can you add milvus to Flowise?
certainly! work in progress :)
Is there any new progress?
This branch feature/Milvus, but problem
I tried working on it on this branch feature/Milvus
, but keep getting heap memory issue. Appreciate if anyone can chime in
I tried working on it on this branch
feature/Milvus
, but keep getting heap memory issue. Appreciate if anyone can chime in
What's the error ?
I tried working on it on this branch
feature/Milvus
, but keep getting heap memory issue. Appreciate if anyone can chime in
Seems like the GRPC client can not be reused after the vector store class initialized , it keeps retrying to connect until hitting the memory limit. Don't know why...
I understand the problem, here
this.app.get('/api/v1/nodes', (req: Request, res: Response) => {
const returnData = []
for (const nodeName in this.nodesPool.componentNodes) {
const clonedNode = cloneDeep(this.nodesPool.componentNodes[nodeName])
returnData.push(clonedNode)
}
return res.json(returnData)
})
You deep clone the node, milvus node sdk uses grpc to communicate with the milvus server, when it is initialized, it builds the GRPC channel to the server, but after you clone the object, the GRPC channel is not allowed to be reused, so later requests can not be finished, and the grpc node package will retry to connect, again and again, then we hit the memory limit.
Is there a way that we can avoid this cloneDeep?
@HenryHengZJ
// in processPrediction
const nodeToExecute = reactFlowNodes.find((node: IReactFlowNode) => node.id === endingNodeId)
if (!nodeToExecute) return res.status(404).send(`Node ${endingNodeId} not found`)
const reactFlowNodeData: INodeData = resolveVariables(nodeToExecute.data, reactFlowNodes, incomingInput.question)
nodeToExecuteData = reactFlowNodeData
const startingNodes = nodes.filter((nd) => startingNodeIds.includes(nd.id))
this.chatflowPool.add(chatflowid, nodeToExecuteData, startingNodes, incomingInput?.overrideConfig)
export const resolveVariables = (reactFlowNodeData: INodeData, reactFlowNodes: IReactFlowNode[], question: string): INodeData => {
let flowNodeData = cloneDeep(reactFlowNodeData)
if (reactFlowNodeData.instance && isVectorStoreFaiss(reactFlowNodeData)) {
// omit and merge because cloneDeep of instance gives "Illegal invocation" Exception
const flowNodeDataWithoutInstance = cloneDeep(omit(reactFlowNodeData, ['instance']))
flowNodeData = merge(flowNodeDataWithoutInstance, { instance: reactFlowNodeData.instance })
}
const types = 'inputs'
const getParamValues = (paramsObj: ICommonObject) => {
for (const key in paramsObj) {
const paramValue: string = paramsObj[key]
if (Array.isArray(paramValue)) {
const resolvedInstances = []
for (const param of paramValue) {
const resolvedInstance = getVariableValue(param, reactFlowNodes, question)
resolvedInstances.push(resolvedInstance)
}
paramsObj[key] = resolvedInstances
} else {
const isAcceptVariable = reactFlowNodeData.inputParams.find((param) => param.name === key)?.acceptVariable ?? false
const resolvedInstance = getVariableValue(paramValue, reactFlowNodes, question, isAcceptVariable)
paramsObj[key] = resolvedInstance
}
}
}
const paramsObj = flowNodeData[types] ?? {}
getParamValues(paramsObj)
return flowNodeData
}
looks like here
Milvus is now supported on Flowise! Closing as #794 merged