Build LLM-powered applications using LangChain Stay organized with collections Save and categorize content based on your preferences.
Preview — LangChain
This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
This page introduces how to build LLM-powered applications usingLangChain. The overviews on thispage link to procedure guides in GitHub.
What is LangChain?
LangChain is an LLM orchestration framework that helps developers buildgenerative AI applications or retrieval-augmented generation (RAG) workflows. Itprovides the structure, tools, and components to streamline complex LLMworkflows.
For more information about LangChain, see theGoogleLangChain page. For more information about the LangChain framework, see theLangChain product documentation.
LangChain components for Cloud SQL for SQL Server
Cloud SQL for SQL Server offers the following LangChain interfaces:
Learn how to use LangChain with theLangChain Quickstart for Cloud SQL for SQL Server.
Document loader for Cloud SQL for SQL Server
The document loader saves, loads, and deletes a LangChainDocument objects. For example, you can load data for processing intoembeddings and either store it in vector store or use it as a tool to providespecific context to chains.
To load documents from document loader in Cloud SQL for SQL Server, use theMSSQLLoader class.MSSQLLoader methods return one or more documents from atable. Use theMSSQLDocumentSaver class to save and delete documents.
For more information, see theLangChain Documentloaders topic.
Document loader procedure guide
TheCloud SQL for SQL Server guide for documentloader shows you how to do the following:
- Install the integration package and LangChain
- Load documents from a table
- Add a filter to the loader
- Customize the connection and authentication
- Customize Document construction by specifying customer content and metadata
- How to use and customize a
MSSQLDocumentSaverto store and delete documents
Chat message history for Cloud SQL for SQL Server
Question and answer applications require a history of the things said in theconversation to give the application context for answering further questionsfrom the user. The LangChainChatMessageHistory class lets the applicationsave messages to a database and retrieve them when needed to formulate furtheranswers. A message can be a question, an answer, a statement, a greeting or anyother piece of text that the user or application gives during the conversation.ChatMessageHistory stores each message and chains messages together for eachconversation.
Cloud SQL for SQL Server extends this class withMSSQLChatMessageHistory.
Chat message history procedure guide
TheCloud SQL for SQL Server guide for chat messagehistory shows you how to do the following:
- Install LangChain and authenticate to Google Cloud
- Create a
MSSQLEngineobject and configure a connection pool to yourCloud SQL for SQL Server database - Initialize a table
- Initialize the
MSSQLChatMessageHistoryclass to add and delete messages - Create a chain for message history using the LangChain Expression Language(LCEL) and Google's Vertex AI chat models
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.