user2439261
user2439261

Reputation: 51

How to connect LLM to Multiple SQL database with LangChain SQLChain

I want to connect LLM to more than 2 SQL database with SQLDatabaseChain. Please let me know if it is possible or any other way.

I have connected to 1 DB and able to work. But I need to connect to more than 1 DB and its table

Upvotes: 3

Views: 2022

Answers (1)

Gregory Morris
Gregory Morris

Reputation: 105

It appears you cannot. Or at least, it's not a supported feature.

wadihpazos: Not with the current implementation. The agent takes a dbengine object which is tied to one connection alone. Interested in your specific use case. Maybe the right solution is working multiple agents in parallel with the same prompt across different data sources. SOURCE

It seems someone wanted to do something similar here, but no solution has been posted.

Upvotes: 2

Related Questions