# agent_hello **Repository Path**: zzLibra/agent_hello ## Basic Information - **Project Name**: agent_hello - **Description**: AI Agent 练手项目 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-22 - **Last Updated**: 2026-02-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: Python, llm, langchain ## README # AI Agent应用 这是一个使用LangChain构建的 Agent ## 特性 - 可配置的大型语言模型(LLM) - 环境变量管理 - Agent 各部分测试,RAG、MCP等 ## 先决条件 - Python 3.10+ - OpenAI API key (optional, for using OpenAI models) - 阿里百炼 API Key (可选) - DeepSeek Api Key (可选) - Required Python packages (see installation) ## 安装 1. Clone the repository 2. Create a virtual environment: ```bash python -m venv langchain_env source langchain_env/bin/activate # On Windows: venv\Scripts\activate ``` 3. Install required packages: ```bash # 1. 确保已安装 Visual C++ Redistributable # 下载地址:https://aka.ms/vs/17/release/vc_redist.x64.exe # 2. 安装 Python 3.8+(确保勾选 "Add to PATH") # 3. 使用管理员权限打开 PowerShell # 设置执行策略(如果需要),然后重启ASCode Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser # 4. 安装 python -m venv langchain_env langchain_env\Scripts\activate # 1. 更新 LangChain 全家桶 pip install langchain langchain-core langchain-openai langchain-community langchain-text-splitters # 2. 安装其他组件 pip install langchain faiss-cpu adb install chromadb adb install openai sentence-transformers pip install langchain_huggingface huggingface_hub pip install numpy tiktoken pydantic # 使用魔搭社区相关组件时,需要安装一下组件 pip install modelscope -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com pip install addict datasets -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com ``` ## 配置 Copy the `.env.example` file to `.env` and update the values: ```bash cp .env.example .env ``` Then edit `.env` to add your API keys and preferred settings. ## 使用 /src 目录下为 AI Agent测试相关代码 运行: ```bash python src/rag_qa_qwen ``` The agent will start and you can begin interacting with it. Type `help` to see available commands. ## 项目结构 - `src/main.py`: Main application code with the agent implementation - `config/__init__.py`: Configuration settings - `.env`: Environment variables - `tests/test_agent_env.py`: AI Environment testing script ## Testing Run the environment test to verify all components are working: ```bash python tests/test_agent_env.py ``` ## Reference 特别感谢【[未闻花名](https://cloud.tencent.com/developer/user/11883445)】相关文章分享,本项目中相关示例都以此为参考。包括不限于以下 [构建AI智能体:大模型的幻觉难题:RAG 解决AI才华横溢却胡言乱语的弊病](https://cloud.tencent.com/developer/article/2585402) [构建AI智能体:解密LangChain中的RAG架构:让AI模型突破局限学会“翻书”答题](https://cloud.tencent.com/developer/article/2585474) [构建AI智能体:LangChain智能体:打造会使用工具(Tools)、有记忆(Memory)的AI助手](https://cloud.tencent.com/developer/article/2592868)