Prerequisites
Before you can configure and use LangChain with Connect AI, you must first do the following:- Connect a data source to your Connect AI account. See Sources for more information.
- Settings ページでPersonal Access Token(PAT)を生成します。PAT をコピーし、認証時にパスワードとして使用します。
- Obtain an OpenAI API key: https://platform.openai.com/.
- Make sure you have Python >= 3.10 in order to install the LangChain and LangGraph packages.
Create the Python Files
In
config.py, create a class Config to define your MCP server authentication and URL. You need to provide your Base64-encoded Connect AI username and PAT (obtained in the prerequisites):Install the LangChain and LangGraph Packages
Runpip install langchain-mcp-adapters langchain-openai langgraph in your project terminal.
