This project is a Next.js application that integrates a SQL agent using Langchain. It allows users to interact with a SQL database through a user-friendly interface.
my-langchain-sqlagent-app
├── components
│ └── AgentUI.tsx # UI component for interacting with the SQL agent
├── lib
│ └── sqlAgent.ts # Logic for SQL database interactions
├── pages
│ ├── api
│ │ └── sqlAgent.ts # API route for SQL agent requests
│ └── index.tsx # Main page component
├── public
│ └── favicon.ico # Application favicon
├── package.json # npm configuration file
├── tsconfig.json # TypeScript configuration file
└── README.md # Project documentation
- User Interface: The
AgentUIcomponent provides an interface for users to input SQL queries and view results. - SQL Agent Logic: The
SqlAgentclass handles database connections and query execution. - API Integration: The API route processes user requests and communicates with the SQL agent.
-
Clone the repository:
git clone https://github.com/yourusername/my-langchain-sqlagent-app.git -
Navigate to the project directory:
cd my-langchain-sqlagent-app -
Install dependencies:
npm install -
Run the application:
npm run dev -
Open your browser and go to
http://localhost:3000to access the application.
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.