langchain-retrieval-agent
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLangChain Retrieval Agent
LangChain 检索Agent
An AI agent with retrieval tool for document Q&A using RAG, powered by LangGraph.
一款基于LangGraph、采用RAG技术的AI Agent,具备检索工具,可用于文档问答。
Tech Stack
技术栈
- Framework: Next.js
- AI: LangChain.js, LangGraph, AI SDK
- Vector Store: Supabase pgvector
- Package Manager: pnpm
- 框架:Next.js
- AI组件:LangChain.js、LangGraph、AI SDK
- 向量数据库:Supabase pgvector
- 包管理器:pnpm
Prerequisites
前置条件
- Supabase project with pgvector extension
- OpenAI API key
- 已启用pgvector扩展的Supabase项目
- OpenAI API密钥
Setup
设置步骤
1. Clone the Template
1. 克隆模板
bash
git clone --depth 1 https://github.com/Eng0AI/langchain-retrieval-agent.git .If the directory is not empty:
bash
git clone --depth 1 https://github.com/Eng0AI/langchain-retrieval-agent.git _temp_template
mv _temp_template/* _temp_template/.* . 2>/dev/null || true
rm -rf _temp_templatebash
git clone --depth 1 https://github.com/Eng0AI/langchain-retrieval-agent.git .如果目录非空:
bash
git clone --depth 1 https://github.com/Eng0AI/langchain-retrieval-agent.git _temp_template
mv _temp_template/* _temp_template/.* . 2>/dev/null || true
rm -rf _temp_template2. Remove Git History (Optional)
2. 移除Git历史记录(可选)
bash
rm -rf .git
git initbash
rm -rf .git
git init3. Install Dependencies
3. 安装依赖
bash
pnpm installbash
pnpm install4. Setup Environment Variables
4. 配置环境变量
- - Supabase project URL
SUPABASE_URL - - Supabase service role key
SUPABASE_PRIVATE_KEY - - For embeddings and LLM
OPENAI_API_KEY
- - Supabase项目URL
SUPABASE_URL - - Supabase服务角色密钥
SUPABASE_PRIVATE_KEY - - 用于嵌入模型和大语言模型
OPENAI_API_KEY
Build
构建
bash
pnpm buildbash
pnpm buildDevelopment
开发
bash
pnpm devbash
pnpm dev