Learn how to integrate Language Models (LLMs) with SQL databases using LangChain.js
(This tutorial is intentionally oversimplified and overly instructive with the objective of helping make AI more approachable. Examples are from the LangChain library with more "hand holding" for those who need help getting started)
The modern enterp...
langchainers.hashnode.dev7 min read
David
according to js.langchain.com/docs/modules/agents/toolkits/sql
import { SqlDatabase } from "langchain/sql_db"; import { DataSource } from "typeorm";
const datasource = new DataSource({ type: "sqlite", database: "Chinook.db", }); const db = await SqlDatabase.fromDataSourceParams({ appDataSource: datasource, });
and npm install --save sqlite3