【技术文档摘要】
使用模型上下文协议(MCP)构建的MCP-RAG系统,能够处理大型文件(高达200MB),采用智能分块策略、多格式文档支持以及企业级可靠性。
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐ │ Streamlit │ │ LangChain │ │ MCP Server │ │ 前端 │◄──►│ 代理 │◄──►│ (工具) │ └─────────────────┘ └──────────────────┘ └─────────────────┘ │ ┌────────────────────────┼────────────────────────┐ │ ▼ │ ┌───────▼────────┐ ┌─────────────────┐ ┌──────▼──────┐ │ 文档 │ │ 向量数据库 │ │ LLM API │ │ 处理器 │ │ (ChromaDB) │ │ 端点 │ └────────────────┘ └─────────────────┘ └─────────────┘
克隆仓库
git clone https://github.com/yourusername/rag-large-file-processor.git
cd rag-large-file-processor
python -m venv venv
source venv/bin/activate # 在Windows上:venv\Scripts\activate
pip install -r requirements.txt
# 创建.env文件
cat > .env << EOF
OPENAI_API_KEY=your_openai_api_key_here
BASE_URL=https://api.openai.com/v1
MODEL_NAME=gpt-4o
VECTOR_DB_TYPE=chromadb
streamlit run streamlit_app.py