
langgraph start
一个简单的 langGraph 示例,帮助快速上手。
Repository Info
About This Server
一个简单的 langGraph 示例,帮助快速上手。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
LangGraph Start
这是一个简单的langGraph示例,快速入门即上手😊
已使用的文档如下:
1、Langchain LLM 、LLM key
2、Langgraph Quickstart
3、How to create and query vector stores => 使用的为OpenAIEmbeddings需要付费,替换为HuggingFaceEmbeddings即可
已实现功能如下:
1、Chatbot
2、Function calling
3、RAG
安装指南
确保已有Python环境,当前使用Python v3.13.2
1、克隆仓库
git clone https://github.com/angxuejian/langgraph-start.git
2、安装依赖
pip install -r requirements.txt
配置说明
需要配置LLM、Web,步骤如下
1、在config目录下创建config.py文件 (可从config.example.py文件复制)
2、添加API密钥,可申请百炼LLM、Tavily Web,均有免费Token使用
# Global LLM configuration
# 阿里云百炼 https://bailian.console.aliyun.com/?tab=model#/model-market
llm = {
"openai_api_key": 'YOUR_API_KEY',
"openai_api_base": 'https://dashscope.aliyuncs.com/compatible-mode/v1',
"model_name": 'qwen-max' # 根据千问文档选择合适的模型,例如 qwen-turbo 或 qwen-plus
}
# Global Web configuration
# tavily https://app.tavily.com/home
web = {
"tavily_api_key": "YOUR_API_KEY"
}
运行说明
需要科学上网,才能运行;以下命令都在
langgraph-start目录下执行
1、运行chatbot,根据配置可使用tools、memory功能
python main.py
2、运行chatbot rag
默认读取faiss_index文件,可修改file_name来选择读取文件; faiss_index源文件为basedata.txt
python run_rag.py
3、运行embedding model,将自定义文本内容转换为向量(Vectors)的浮点数数组
file_name:向量化后的文件名称source_file_name:源文件名称
python run_vector.py
本地会加载
BAAI/bge-base-zh模型,推理速度因电脑差异会有快慢之分,没看到控制台输出HuggingFaceEmbeddings done !前,均还在推理,切勿退出。只有运行run_rag.py和run_vector.py才会使用到向量化
4、使用mcp server,在cursor、windsurf、claude等应用上,打开mcp.json,将以下配置复制粘贴
Windows
{
"mcpServers": {
"tools-server": {
"command": "python",
"args": [
"C:\\ABSOLUTE-PATH\\XXXXXXX\\langgraph-start\\mcp\\server.py"
]
}
}
}
MacOS or Linux
{
"mcpServers": {
"tools-server": {
"command": "python",
"args": [
"/ABSOLUTE-PATH/XXXXXXX/langgraph-start/mcp/server.py"
]
}
}
}
目前只有get_current_time_mcpfunction一个函数,询问当前时间,即可调用。
5、运行mcp client,使用本地mcp server工具
python .\mcp\client.py .\mcp\server.py
可替换成其他mcp工具,修改
client.py文件中的StdioServerParameters(command='', args=[], env=None)参数即可
交流
可通过 ✉️ 邮箱联系@angxuejian: xuejian.ang@gmail.com
or Issues
希望 LangGraph Start 可以帮助你快速了解 + 上手AI应用😎
Quick Start
Clone the repository
git clone https://github.com/angxuejian/langgraph-startInstall dependencies
cd langgraph-start
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.