Chat With Your Database! Build a Local SQL AI Agent to Query Databases (LangChain & Ollama)

preview_player
Показать описание

Do you still need to write SQL? In this step-by-step tutorial, learn how to build AI Agent that understands natural language questions and interacts directly with your SQL database. We'll build "Querymancer", a complete application running entirely locally using Ollama (Gemma 3 / Qwen 2.5) and LangChain.

👍 Don't Forget to Like, Comment, and Subscribe for More Tutorials!

00:00 - Welcome
01:27 - AI agent and app architecture
03:04 - Database overview
04:17 - Project structure, config and dependencies
06:07 - Load LLM with Ollama
09:02 - Agent loop and prompt
14:04 - Creating database interaction tools (list, describe, sample, execute SQL)
21:22 - Streamlit user interface
24:40 - Live demo: querying the database with natural language
27:40 - Conclusion

Join this channel to get access to the perks and support my work:

#langchain #aiagents #ollama #artificialintelligence #python #chatbot #chatgpt
Рекомендации по теме
Комментарии
Автор

One of the most useful videos! Thank you very much

Lae
Автор

Can you please
also explain, how do we build a sql agent system where we can give the context to the LLM. Like if user ask "what are the top 10 sales in region X?" In different business use cases, we have to give additional details like what actualy the user is looking and how do we calculte those columns etc.
My hole point is giving addional details with the user question to llm so it can generate a query based on the bussiness need, not on what it know on it

vpsfahad
Автор

Thank you for this video. But how sure are you about the same workflow can be employed for database having >100 tables.

AIinAgriculture
Автор

Can this be done for Microsoft Access databases? If yes, is it possible to provide the code? Love this video. Excellent work!

selvamanysrinivasan
Автор

what would be the hardware requirements for this, I have tried the same thing without history still was very slow

AvishekBhagat-qq
Автор

A warm greeting, sir. You create excellent content on LLMs, and I would love to learn from you. Can I access all your courses on MLExpert with a single annual payment?

christianespana
Автор

Can you create a video on how we can connect to different data types ( excel, sql database as in this video) and how to connect with different LLMs frkm different sources, grok, huggingface, open ai...I still feel confused there...that video help a lot of people

krishnakishorepeddisetti
Автор

Excellent video, but can you please explain where does binding of tools to the models occur?

MrOffroadpia
Автор

Can you create a video for connecting with SAP sql db where schema is different

satender
Автор

can it talk to BQ or any DB in cloud ?

Harpreetsardar-xk
Автор

new table is diffcult to LLM to understand and reply too terrible

Flyknit
Автор

This your tutorial is copy and paste from IBM technology YouTube channel on how to create ai agent to query the sqlite database. But it is free and you are charging for it. Wow! 😲😲😲😲😳😳

wondermannier
visit shbcf.ru