Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

pokey
Copy link
Contributor

@pokey pokey commented Oct 21, 2025

Just translates the Python version of the langgraph sql-agent tutorial to js.

@Copilot Copilot AI review requested due to automatic review settings October 21, 2025 11:52
@github-actions github-actions bot added langgraph For docs changes to LangGraph oss labels Oct 21, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the JavaScript/TypeScript version of the SQL agent tutorial, translating the Python implementation to JS. The tutorial demonstrates how to build a custom SQL agent using LangGraph that can interact with a SQLite database to answer questions.

Key changes:

  • Adds JavaScript implementations alongside existing Python code using custom language fences (:::python and :::js)
  • Includes JS-specific installation instructions with npm/yarn/pnpm examples
  • Implements the complete SQL agent workflow in TypeScript, including database setup, tool creation, graph construction, and human-in-the-loop features

);
```
<Note>
The above implementation follows the [tool interrupt example](/oss/langgraph/add-human-in-the-loop#add-interrupts-to-any-tool) in the broader [human-in-the-loop](/oss/langgraph/add-human-in-the-loop) guide. Refer to that guide for details and alternatives.
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent link reference: Line 899 uses /oss/langgraph/add-human-in-the-loop while line 1003 uses /oss/langgraph/human-in-the-loop. These should point to the same guide. Please verify the correct path and update for consistency.

Suggested change
The above implementation follows the [tool interrupt example](/oss/langgraph/add-human-in-the-loop#add-interrupts-to-any-tool) in the broader [human-in-the-loop](/oss/langgraph/add-human-in-the-loop) guide. Refer to that guide for details and alternatives.
The above implementation follows the [tool interrupt example](/oss/langgraph/human-in-the-loop#add-interrupts-to-any-tool) in the broader [human-in-the-loop](/oss/langgraph/human-in-the-loop) guide. Refer to that guide for details and alternatives.

Copilot uses AI. Check for mistakes.

@pokey pokey marked this pull request as draft October 21, 2025 11:53
We will use a handy SQL database wrapper available in the `@langchain/classic/sql_db` module to interact with the database. The wrapper provides a simple interface to execute SQL queries and fetch results:

```typescript
import { SqlDatabase } from "@langchain/classic/sql_db";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using this wrapper as we already have it. Did we want to modify this to directly use typeorm rather than pulling from classic?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK to pull from classic if it's doing enough work for users, alternatively better to use typeorm if the code foot print is sufficiently small.

cc @hntrl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's doing a bit of work. Mainly around getting db schema in dialect-agnostic way

@pokey pokey marked this pull request as ready for review October 21, 2025 13:47
@Copilot Copilot AI review requested due to automatic review settings October 21, 2025 13:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

langgraph For docs changes to LangGraph oss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants