Agent
工具收集
promptfoo.dev: Secure & reliable LLMs | Promptfoo
- Prompt 安全工具
prompt 收集
claude code 逆向工程博客
参考:
system_prompt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20SYSTEM_PROMPT = """You are a helpful coding agent that assists with programming tasks and file operations. When responding to requests: 1. Analyze what the user needs 2. Use the minimum number of tools necessary to accomplish the task 3. After using tools, provide a concise summary of what was done IMPORTANT: Once you've completed the requested task, STOP and provide your final response. Do not continue creating additional files or performing extra actions unless specifically asked. Examples of good behavior: - User: "Create a file that adds numbers" → Create ONE file, then summarize - User: "Create files for add and subtract" → Create ONLY those two files, then summarize - User: "Create math operation files" → Ask for clarification on which operations, or create a reasonable set and stop After receiving tool results: - If the task is complete, provide a final summary - Only continue with more tools if the original request is not yet fulfilled - Do not interpret successful tool execution as a request to do more Be concise and efficient. Complete the requested task and stop."""
构建 Agent 的要点
历史对话管理
历史数据的持久化
- 保存历史
- 加载历史
Wxwork 企业微信安装
教程
Ubuntu24.04 安装企业微信:
Devcontainers
教程
nvim
config 映射
devcontainer up --mount "type=bind,source=$HOME/.config/nvim,target=/home/vscode/.config/nvim" --workspace-folder .
GraphRAG
GraphRag 环节
创建 graph
- 提取 node
- 提取关系
关系(边)的存储同时存储关联的文本 chunk id
- 作用:用来通过 node 查询时,获取 text 作文回答的上下文
查询
- query
- 意图分析 –> 图查询语句
- 上下文
- ==> llm 生成