Skip to content

MeshAgents/ConfSafeAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepCodeAgent

基于 LangChain DeepAgents 的智能代理系统,集成 LangSmith 调试能力。

🚀 快速开始

1. 安装依赖

项目使用 uv 包管理器,依赖已配置完成:

# 依赖已安装,如需重新安装:
uv sync

2. 配置环境变量

# 复制环境变量模板
cp .env.example .env

# 编辑 .env 文件,填入你的配置
nano .env  # 或使用你喜欢的编辑器

必需的配置:

# LangSmith (调试追踪)
LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=lsv2_pt_your_key_here
LANGCHAIN_PROJECT=deepagents-project

# Anthropic (Claude API)
ANTHROPIC_API_KEY=sk-ant-your_key_here

3. 获取 LangSmith API Key

  1. 访问 https://smith.langchain.com/settings
  2. 点击 "Create API Key"
  3. 复制生成的 API Key 到 .env 文件

详细配置说明请查看: docs/LANGSMITH_CONFIG.md

4. 验证配置

# 运行测试脚本
python examples/test_langsmith.py

如果配置正确,你会看到成功消息,并可以在 LangSmith 面板中查看追踪记录。

5. 运行示例

# DeepAgents + LangSmith 调试示例
python examples/deepagent_with_langsmith.py

📊 LangSmith 调试

你的 LangSmith 组织: https://smith.langchain.com/o/83b1bf76-e8af-486e-b7a3-a6f7fba6369f

LangSmith 提供:

  • 📈 完整的执行流程可视化
  • 🐛 每一步的输入输出追踪
  • ⏱️ 性能和成本分析
  • 🔍 错误调试和重放

📁 项目结构

DeepCodeAgent/
├── src/                    # 源代码目录
│   ├── agents/            # 代理模块
│   ├── backends/          # 后端模块
│   ├── config/            # 配置模块
│   ├── prompts/           # 提示词模块
│   ├── tools/             # 工具模块
│   └── utils/             # 工具函数
├── examples/              # 示例代码
│   ├── test_langsmith.py                # LangSmith 配置验证
│   └── deepagent_with_langsmith.py      # DeepAgent 调试示例
├── docs/                  # 文档
│   └── LANGSMITH_CONFIG.md              # LangSmith 配置指南
├── tests/                 # 测试目录
├── data/                  # 数据目录
├── logs/                  # 日志目录
├── .env.example           # 环境变量模板
├── .gitignore            # Git 忽略文件
└── pyproject.toml        # 项目配置

🛠️ 已安装的依赖

核心框架

  • deepagents - LangChain DeepAgents 框架
  • langchain + langgraph - LangChain 核心

LLM 集成

  • langchain-anthropic - Claude/Anthropic
  • langchain-openai - OpenAI
  • langchain-google-genai - Google Gemini
  • langchain-cohere - Cohere
  • langchain-huggingface - HuggingFace

向量数据库

  • chromadb - ChromaDB
  • faiss-cpu - FAISS
  • pinecone - Pinecone
  • qdrant-client - Qdrant

传统数据库

  • pymongo - MongoDB
  • redis - Redis
  • psycopg2-binary - PostgreSQL

工具

  • langserve - LangChain 服务部署
  • fastapi + uvicorn - Web 框架
  • unstructured - 数据处理
  • python-dotenv - 环境变量管理
  • langsmith - LangSmith 客户端

📚 文档

🔗 相关链接

📝 License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages