Skip to main content
This will help you getting started with SqlToolkit toolkits. For more information, you can also review the Python SQL toolkit documentation. This toolkit contains a the following tools: This toolkit is useful for asking questions, performing queries, validating queries and more on a SQL database.

Setup

This example uses Chinook database, which is a sample database available for SQL Server, Oracle, MySQL, etc. To set it up, follow these instructions, placing the .db file in the directory where your code lives. If you want to get automated tracing from runs of individual tools, you can also set your LangSmith API key by uncommenting below:

Installation

This toolkit lives in the langchain package. You’ll also need to install the typeorm peer dependency.

Instantiation

First, we need to define our LLM to be used in the toolkit.

Tools

View available tools:

Use within an agent

First, ensure you have LangGraph installed: