# adalflow - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 adalflow 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **AI 研究者或研究型 Agent 构建者**：README 明确围绕研究、实验或论文工作流展开。 证据：`README.md` Claim：`clm_0002` supported 0.86

## 它能做什么

- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0001` supported 0.86

## 怎么开始

- `pip install adalflow` 证据：`README.md` Claim：`clm_0003` supported 0.86

## 继续前判断卡

- **当前建议**：需要管理员/安全审批
- **为什么**：继续前可能涉及密钥、账号、外部服务或敏感上下文，建议先经过管理员或安全审批。

### 30 秒判断

- **现在怎么做**：需要管理员/安全审批
- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装
- **先别相信**：角色质量和任务匹配不能直接相信。
- **继续会触碰**：角色选择偏差、命令执行、本地环境或项目文件

### 现在可以相信

- **适合人群线索：AI 研究者或研究型 Agent 构建者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0003` supported 0.86

### 现在还不能相信

- **角色质量和任务匹配不能直接相信。**（unverified）：角色库证明有很多角色，不证明每个角色都适合你的具体任务，也不证明角色能产生高质量结果。
- **不能把角色文案当成真实执行能力。**（unverified）：安装前只能判断角色描述和任务画像是否匹配，不能证明它能在宿主 AI 里完成任务。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。

### 继续会触碰什么

- **角色选择偏差**：用户对任务应该由哪个专家角色处理的判断。 原因：选错角色会让 AI 从错误专业视角回答，浪费时间或误导决策。
- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`
- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`README.md`, `adalflow/adalflow/components/model_client/openai_client.py`, `adalflow/tests/test_model_client.py`, `adalflow/tests/test_openai_client.py` 等
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：先用交互式试用验证任务画像和角色匹配，不要先导入整套角色库。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **不要使用真实生产凭证**：环境变量/API key 一旦进入宿主或工具链，可能产生账号和合规风险。（适用：出现 API、TOKEN、KEY、SECRET 等环境线索时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **保留原始角色选择记录**：如果输出偏题，可以回到任务画像阶段重新选择角色，而不是继续沿着错误角色推进。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0004` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0005` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86

### 上下文规模

- 文件总数：515
- 重要文件覆盖：40/515
- 证据索引条目：77
- 角色 / Skill 条目：39

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 adalflow 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 adalflow 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 adalflow 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```

## 角色 / Skill 索引

- 共索引 39 个角色 / Skill / 项目文档条目。

- **AdalFlow Documentation Guide**（project_doc）：- AdalFlow Documentation Guide adalflow-documentation-guide - Content Overview content-overview - Introduction introduction - How the Documentation Works how-the-documentation-works - Prerequisites prerequisites - Setup setup - 1. Clone the Repository 1-clone-the-repository - 2. Install Dependencies 2-install-dependencies - 3. Verify Setup 3-verify-setup - File Structure file-structure - conf.py confpy - index.rst i… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/README.md`
- **Design Documents**（project_doc）：This directory contains raw engineering design documents for the AdalFlow project. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/design/README.md`
- **Design Documents**（project_doc）：This directory contains raw engineering design documents for the AdalFlow project. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/source/design/README.md`
- **Readme**（project_doc）：The documents here matches to Adalflow/tutorials on the website. While the tutorials/ dir matches to developer notes on the website. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/source/new_tutorials/README.md`
- **Why AdalFlow**（project_doc）：⚡ AdalFlow is a PyTorch-like library to build and auto-optimize any LM workflows, from Chatbots, RAG, to Agents. ⚡ 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`
- **Why AdalFlow?**（project_doc）：All Documentation Models Retrievers Agents Trainer & Optimizers 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`adalflow/README.md`
- **Benchmarks**（project_doc）：Benchmarking is an integral development part of the project. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/README.md`
- **Objective**（project_doc）：This is where all of our colab notebooks will be tracked as ipynb files. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`notebooks/README.md`
- **Readme**（project_doc）：1. Align LLM judge using annoated generated text - ground truth text pairs. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`use_cases/README.md`
- **Agent is not a model or LLM model.**（project_doc）：Agent is not a model or LLM model. Agent is better defined as a system that uses LLM models to plan and replan steps that each involves the usage of various tools, such as function calls, another LLM model based on the context and history memory to complete a task autonomously. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`adalflow/adalflow/components/agent/README.md`
- **Readme**（project_doc）：This is where we show how we can leverage cloud db such as postgres along with its vector extension to store and query data. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`adalflow/adalflow/database/README.md`
- **AdalFlow Optimizer**（project_doc）：This directory contains optimization implementations for LLM task pipelines in AdalFlow. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`adalflow/adalflow/optim/README.md`
- **ARC-Bench-style Smoke Benchmark**（project_doc）：This directory contains a lightweight ARC-Bench-style smoke benchmark for AdalFlow autonomous research-agent prototypes. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/arc_bench/README.md`
- **optimize anything benchmark GEPA-style scaffold**（project_doc）：optimize anything benchmark GEPA-style scaffold 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`benchmarks/optimize_anything/README.md`
- **Readme**（project_doc）：There are different patterns to build a RAG. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`use_cases/rag/build/README.md`
- **Setup**（project_doc）：Setup Install the required packages: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`adalflow/tests/README.md`
- **1.1.3 - 2025-01-21**（project_doc）：Output Parsers adalflow/components/output parsers/ - JsonOutputParserPydanticModel : New JSON output parser supporting Pydantic BaseModel classes - Native Pydantic schema generation and validation - Support for nested models and complex data structures - Optional return of Pydantic objects or dictionaries - Example-based instruction generation - Comprehensive validation error handling 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`adalflow/CHANGELOG.md`
- **0.2.7 - 2025-01-16**（project_doc）：- Added multimodal support in Generator tutorial and more explanation by Filip. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/CHANGLOG.md`
- **ComponentTool**（project_doc）：ComponentTool is a design pattern in AdalFlow that leverages FunctionTool to wrap Component class methods as tools for LLM agents, providing enhanced context management and standardized output formatting compared to pure function tools. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/design/ComponentTool.md`
- **FunctionTool**（project_doc）：FunctionTool is a core component in AdalFlow that provides a standardized interface for wrapping functions as tools that can be used by LLMs and agents. It extends Component and supports both synchronous and asynchronous functions, generators, and trainable components. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/design/FunctionTool.md`
- **Agent Streaming Architecture**（project_doc）：The OpenAI Agents SDK implements a sophisticated streaming architecture that standardizes around the OpenAI Responses API format while providing compatibility with the Chat Completions API through a bridging mechanism. This document explains how the streaming system works, its key components, and data flow. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/design/agent-streaming.md`
- **FastAPI Permission System - API Examples**（project_doc）：FastAPI Permission System - API Examples 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/design/api_approval_examples.md`
- **High-Level API Design: Intuitive Program & Agent Evolution in AdalFlow**（project_doc）：High-Level API Design: Intuitive Program & Agent Evolution in AdalFlow 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/design/intuitive_evolution_api.md`
- **flow**（project_doc）：if user rejects a tool, we should proceed to the next tool in default, we can additionally make it controllable in the runner config, or stop when tool is rejected. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/design/tool_approval.md`
- **Tool Approval Design for Python Agent Systems**（project_doc）：Tool Approval Design for Python Agent Systems 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/design/tool_approval_design.md`
- **Use Class method as a better function tool**（project_doc）：Use Class method as a better function tool 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/source/design/ComponentTool.md`
- **Designing of AdalFlow FunctionTool**（project_doc）：FunctionTool is a core component in AdalFlow that provides a standardized interface for wrapping functions as tools that can be used by LLMs and agents. It extends Component and supports both synchronous and asynchronous functions, generators, and trainable components. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/source/design/FunctionTool.md`
- **Agent Streaming Architecture in OpenAI Agents SDK**（project_doc）：Agent Streaming Architecture in OpenAI Agents SDK 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/source/design/agent-streaming.md`
- **Agents and Runner**（project_doc）：Agents are the core building block for creating autonomous AI systems in AdalFlow. An agent combines reasoning capabilities with tool usage, allowing it to break down complex tasks into steps, use available tools, and iteratively work toward solutions. This approach is motivated by the ReAcT Reasoning and Acting framework Yao et al., 2022 https://arxiv.org/abs/2210.03629 , which combines reasoning traces and task-sp… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/source/new_tutorials/agents_runner.md`
- **Human in the Loop**（project_doc）：AdalFlow provides a permission management system that allows you to control and approve tool executions before they run. This is particularly useful for tools that perform sensitive operations like file system access, API calls, or external communications. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/source/new_tutorials/human_in_the_loop.md`
- **Streaming**（project_doc）：Streaming Streaming allows you to receive real-time updates as your agent executes steps, tools, and generates responses. This enables you to build responsive user interfaces and monitor agent progress in real-time. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/source/new_tutorials/streaming.md`
- **Tracing**（project_doc）：! mlflow integration ../ static/images/adalflow tracing mlflow.png 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/source/new_tutorials/tracing.md`
- **Multimodal Integration in AdalFlow**（project_doc）：AdalFlow now supports multimodal inputs text + images for OpenAI's vision-capable models through the responses.create API. This integration allows you to: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`docs/source/tutorials/multimodal_integration.md`
- **Auto Release**（project_doc）：Simple automated release process for AdalFlow pip package. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`AUTO_RELEASE.md`
- **License**（project_doc）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`LICENSE.md`
- **Packaging**（project_doc）：1. Do not add init .py in adalflow directory. Or else Python will treat it as a package, but really, the package is in adalflow/adalflow . 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`NOTES.md`
- **License**（project_doc）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following… 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`adalflow/LICENSE.md`
- **Poetry Packaging Guide**（project_doc）：To install optional dependencies, use the following command: 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`adalflow/PACKAGING.md`
- **AdalFlow Release Guide**（project_doc）：This guide documents the release process for AdalFlow, including both automated and manual release workflows. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`scripts/release.md`

## 证据索引

- 共索引 77 条证据。

- **AdalFlow Documentation Guide**（documentation）：- AdalFlow Documentation Guide adalflow-documentation-guide - Content Overview content-overview - Introduction introduction - How the Documentation Works how-the-documentation-works - Prerequisites prerequisites - Setup setup - 1. Clone the Repository 1-clone-the-repository - 2. Install Dependencies 2-install-dependencies - 3. Verify Setup 3-verify-setup - File Structure file-structure - conf.py confpy - index.rst indexrst - Existing Sections existing-sections - Editing and Updating Documentation editing-and-updating-documentation - Updating Docstrings in Source Code updating-docstrings-in-source-code - Adding New Code and Docstrings adding-new-code-and-docstrings - Building the Documentati… 证据：`docs/README.md`
- **Design Documents**（documentation）：This directory contains raw engineering design documents for the AdalFlow project. 证据：`docs/design/README.md`
- **Design Documents**（documentation）：This directory contains raw engineering design documents for the AdalFlow project. 证据：`docs/source/design/README.md`
- **Readme**（documentation）：The documents here matches to Adalflow/tutorials on the website. While the tutorials/ dir matches to developer notes on the website. 证据：`docs/source/new_tutorials/README.md`
- **Why AdalFlow**（documentation）：⚡ AdalFlow is a PyTorch-like library to build and auto-optimize any LM workflows, from Chatbots, RAG, to Agents. ⚡ 证据：`README.md`
- **Why AdalFlow?**（documentation）：All Documentation Models Retrievers Agents Trainer & Optimizers 证据：`adalflow/README.md`
- **Benchmarks**（documentation）：Benchmarking is an integral development part of the project. 证据：`benchmarks/README.md`
- **Objective**（documentation）：This is where all of our colab notebooks will be tracked as ipynb files. 证据：`notebooks/README.md`
- **Readme**（documentation）：1. Align LLM judge using annoated generated text - ground truth text pairs. 证据：`use_cases/README.md`
- **Agent is not a model or LLM model.**（documentation）：Agent is not a model or LLM model. Agent is better defined as a system that uses LLM models to plan and replan steps that each involves the usage of various tools, such as function calls, another LLM model based on the context and history memory to complete a task autonomously. 证据：`adalflow/adalflow/components/agent/README.md`
- **Readme**（documentation）：This is where we show how we can leverage cloud db such as postgres along with its vector extension to store and query data. 证据：`adalflow/adalflow/database/README.md`
- **AdalFlow Optimizer**（documentation）：This directory contains optimization implementations for LLM task pipelines in AdalFlow. 证据：`adalflow/adalflow/optim/README.md`
- **ARC-Bench-style Smoke Benchmark**（documentation）：This directory contains a lightweight ARC-Bench-style smoke benchmark for AdalFlow autonomous research-agent prototypes. 证据：`benchmarks/arc_bench/README.md`
- **optimize anything benchmark GEPA-style scaffold**（documentation）：optimize anything benchmark GEPA-style scaffold 证据：`benchmarks/optimize_anything/README.md`
- **Readme**（documentation）：There are different patterns to build a RAG. 证据：`use_cases/rag/build/README.md`
- **Setup**（documentation）：Setup Install the required packages: 证据：`adalflow/tests/README.md`
- **1.1.3 - 2025-01-21**（documentation）：Output Parsers adalflow/components/output parsers/ - JsonOutputParserPydanticModel : New JSON output parser supporting Pydantic BaseModel classes - Native Pydantic schema generation and validation - Support for nested models and complex data structures - Optional return of Pydantic objects or dictionaries - Example-based instruction generation - Comprehensive validation error handling 证据：`adalflow/CHANGELOG.md`
- **0.2.7 - 2025-01-16**（documentation）：- Added multimodal support in Generator tutorial and more explanation by Filip. 证据：`docs/CHANGLOG.md`
- **ComponentTool**（documentation）：ComponentTool is a design pattern in AdalFlow that leverages FunctionTool to wrap Component class methods as tools for LLM agents, providing enhanced context management and standardized output formatting compared to pure function tools. 证据：`docs/design/ComponentTool.md`
- **FunctionTool**（documentation）：FunctionTool is a core component in AdalFlow that provides a standardized interface for wrapping functions as tools that can be used by LLMs and agents. It extends Component and supports both synchronous and asynchronous functions, generators, and trainable components. 证据：`docs/design/FunctionTool.md`
- **Agent Streaming Architecture**（documentation）：The OpenAI Agents SDK implements a sophisticated streaming architecture that standardizes around the OpenAI Responses API format while providing compatibility with the Chat Completions API through a bridging mechanism. This document explains how the streaming system works, its key components, and data flow. 证据：`docs/design/agent-streaming.md`
- **FastAPI Permission System - API Examples**（documentation）：FastAPI Permission System - API Examples 证据：`docs/design/api_approval_examples.md`
- **High-Level API Design: Intuitive Program & Agent Evolution in AdalFlow**（documentation）：High-Level API Design: Intuitive Program & Agent Evolution in AdalFlow 证据：`docs/design/intuitive_evolution_api.md`
- **flow**（documentation）：if user rejects a tool, we should proceed to the next tool in default, we can additionally make it controllable in the runner config, or stop when tool is rejected. 证据：`docs/design/tool_approval.md`
- **Tool Approval Design for Python Agent Systems**（documentation）：Tool Approval Design for Python Agent Systems 证据：`docs/design/tool_approval_design.md`
- **Use Class method as a better function tool**（documentation）：Use Class method as a better function tool 证据：`docs/source/design/ComponentTool.md`
- **Designing of AdalFlow FunctionTool**（documentation）：FunctionTool is a core component in AdalFlow that provides a standardized interface for wrapping functions as tools that can be used by LLMs and agents. It extends Component and supports both synchronous and asynchronous functions, generators, and trainable components. 证据：`docs/source/design/FunctionTool.md`
- **Agent Streaming Architecture in OpenAI Agents SDK**（documentation）：Agent Streaming Architecture in OpenAI Agents SDK 证据：`docs/source/design/agent-streaming.md`
- **Agents and Runner**（documentation）：Agents are the core building block for creating autonomous AI systems in AdalFlow. An agent combines reasoning capabilities with tool usage, allowing it to break down complex tasks into steps, use available tools, and iteratively work toward solutions. This approach is motivated by the ReAcT Reasoning and Acting framework Yao et al., 2022 https://arxiv.org/abs/2210.03629 , which combines reasoning traces and task-specific actions in language models. 证据：`docs/source/new_tutorials/agents_runner.md`
- **Human in the Loop**（documentation）：AdalFlow provides a permission management system that allows you to control and approve tool executions before they run. This is particularly useful for tools that perform sensitive operations like file system access, API calls, or external communications. 证据：`docs/source/new_tutorials/human_in_the_loop.md`
- **Streaming**（documentation）：Streaming Streaming allows you to receive real-time updates as your agent executes steps, tools, and generates responses. This enables you to build responsive user interfaces and monitor agent progress in real-time. 证据：`docs/source/new_tutorials/streaming.md`
- **Tracing**（documentation）：! mlflow integration ../ static/images/adalflow tracing mlflow.png 证据：`docs/source/new_tutorials/tracing.md`
- **Multimodal Integration in AdalFlow**（documentation）：AdalFlow now supports multimodal inputs text + images for OpenAI's vision-capable models through the responses.create API. This integration allows you to: 证据：`docs/source/tutorials/multimodal_integration.md`
- **Config**（source_file）：dspy save path = "benchmarks/BHH object count/models/dspy" text grad save path = "benchmarks/BHH object count/models/text grad" adal save path = "benchmarks/BHH object count/models/adal" dspy hotpot qa save path = "benchmarks/hotpot qa/models/dspy" text grad hotpot qa save path = "benchmarks/hotpot qa/models/text grad" adal hotpot qa save path = "benchmarks/hotpot qa/models/adal" llama3 model = { gpt 3 model = { gpt 4o model = { def load model kwargs 证据：`benchmarks/config.py`
- **use it with named logger**（source_file）：def prepare paths ⋮---- script dir = os.path.dirname os.path.abspath file config path = "default config.json" config path = os.path.join script dir, config path log dir = os.path.join script dir, "logs" env path = os.path.join script dir, ".env" ⋮---- config = load json config path generator config = config "generator" def check console logging ⋮---- generator = Generator.from config generator config output = generator prompt kwargs={"input str": "how are you?"} ⋮---- def get logger and enable library logging in same file ⋮---- file name = "lib app mix.log" root logger = get logger ⋮---- def separate library logging and app logging ⋮---- lib logfile = "lib seperate.log" app logfile = "app s… 证据：`tutorials/logging_config.py`
- **Config**（source_file）：llama3 model = { gpt 3 model = { gpt o1 model = { deepseek r1 model = { gpt 3 1106 model = { gpt 4o mini model = { gpt 4 model = { gpt 4o model = { deepseek r1 distilled model = { gpt o3 mini model = { dataset path = "cache datasets" 证据：`use_cases/config.py`
- **1. create default ToolManager**（source_file）：all = "Agent" T = TypeVar "T" log = logging.getLogger name DEFAULT MAX STEPS = 10 DEFAULT ROLE DESC = """You are an excellent task planner.""" ⋮---- r"""Initialize the tools. Using reference or else with copy or deepcopy we can not set the training/eval mode for each tool.""" processed tools = additional llm tool = def llm tool input str: str - str ⋮---- output: GeneratorOutput = additional llm tool response = output.data if output else None ⋮---- processed tools = tools.copy if tools else ⋮---- 1. create default ToolManager processed tools = init tools tools, model client, model kwargs tool manager = ToolManager ⋮---- template = template or DEFAULT ADALFLOW AGENT SYSTEM PROMPT role desc =… 证据：`adalflow/adalflow/components/agent/agent.py`
- **Prompts**（source_file）：all = default role desc = """You are an excellent task planner.""" adalflow agent task desc = r""" DEFAULT ADALFLOW AGENT SYSTEM PROMPT = r""" 证据：`adalflow/adalflow/components/agent/prompts.py`
- **always add kwargs for us to track the id, doc as the predecessors.**（source_file）：log = logging.getLogger name T = TypeVar "T" all = default role desc = """You are an excellent task planner.""" react agent task desc = r""" DEFAULT REACT AGENT SYSTEM PROMPT = r""" class CombineStepHistory GradComponent ⋮---- def init self ⋮---- answer = step history -1 .observation ⋮---- @dataclass class ReActOutput DataClass ⋮---- r"""Similar to GeneratorOutput, but with additional step history and final answer.""" id: Optional str = field step history: List StepOutput = field answer: Any = field metadata={"desc": "The final answer."}, default=None class ReActAgent Component ⋮---- doc = r"""ReActAgent uses generator as a planner that runs multiple and sequential functional call steps to… 证据：`adalflow/adalflow/components/agent/react.py`
- **Cancel the current streaming task if it exists**（source_file）：all = "Runner" log = logging.getLogger name T = TypeVar "T", bound=BaseModel def is unrecoverable error error: Optional str - bool BuiltInType: TypeAlias = Union str, int, float, bool, list, dict, tuple, set, None PydanticDataClass: TypeAlias = Type BaseModel AdalflowDataClass: TypeAlias = Type class Runner Component ⋮---- def init permission manager self ⋮---- tool name = tool.definition.func name ⋮---- def is cancelled self - bool def reset cancellation self - None def get token consumption self - Dict str, Any def update token consumption self - None ⋮---- current total = self.agent.planner.estimated token count step tokens = current total - self. token consumption 'last total tokens' ⋮-… 证据：`adalflow/adalflow/components/agent/runner.py`
- **Default Config**（source_file）：default config = { 证据：`adalflow/adalflow/database/sqlalchemy/pipeline/default_config.py`
- **TODO: use the scores from the backward engine optionally on the demo parameters**（source_file）：log = logging.getLogger name class BootstrapFewShot DemoOptimizer ⋮---- doc = r"""BootstrapFewShot performs few-shot sampling used in few-shot ICL. exclude input fields from bootstrap demos: bool ⋮---- self. teacher scores: Dict str, float = {} data id to score self. student scores: Dict str, float = {} data id to score ⋮---- TODO: use the scores from the backward engine optionally on the demo parameters needs to make a decision on which this score does not make sense for multiple demo parameters def add scores self, ids: List str , scores: List float , is teacher: bool = True ⋮---- r"""Add scores for each demo via teacher scores or student scores.""" ⋮---- target = self. teacher scores if… 证据：`adalflow/adalflow/optim/few_shot/bootstrap_optimizer.py`
- **1. get all predecessors from all args and kwargs**（source_file）：all = "GradComponent", "FunGradComponent", "fun to grad component" log = logging.getLogger name class GradComponent Component ⋮---- doc = """A base class to define interfaces for an auto-grad component/operator. backward engine: "BackwardEngine" component type = "grad" id = None component desc = "GradComponent" disable backward engine = False ⋮---- def disable backward engine self ⋮---- r"""Does not run gradients generation, but still with backward to gain module-context""" ⋮---- def call self, args, kwargs async def acall self, args, kwargs ⋮---- r"""Implement this for your async call.""" ⋮---- def forward self, args, kwargs - "Parameter" ⋮---- r"""Default forward method for training: 1. f… 证据：`adalflow/adalflow/optim/grad_component.py`
- **allow subclasses to override allowed types dynamically**（source_file）：T = TypeVar "T" log = logging.getLogger name all = "Parameter", "ComponentNode", "ComponentTrace", "ScoreTrace" ⋮---- @dataclass class ComponentTrace DataClass ⋮---- name: str = field metadata={"desc": "The name of the component"}, default=None id: str = field metadata={"desc": "The unique id of the component"}, default=None input args: Dict str, Any = field full response: object = field raw response: str = field api kwargs: Dict str, Any = field def to context str self ⋮---- output = f""" : {self.input args}. : {self.full response}""" ⋮---- @dataclass class ScoreTrace ⋮---- score: float = field metadata={"desc": "The score of the data point"}, default=None eval comp id: str = field eval co… 证据：`adalflow/adalflow/optim/parameter.py`
- **Llm Text Loss**（source_file）：log = logging.getLogger name TEXT LOSS TEMPLATE = r""" class LLMAsTextLoss LossComponent ⋮---- doc = r"""Evaluate the final RAG response using an LLM judge. ⋮---- prompt kwargs = deepcopy prompt kwargs ⋮---- def forward self, args, kwargs - "Parameter" 证据：`adalflow/adalflow/optim/text_grad/llm_text_loss.py`
- **add a combined gradients**（source_file）：log = logging.getLogger name def sum ops params: List Parameter - Parameter class Sum GradComponent ⋮---- doc = """The class to define a sum operation on a list of parameters, such as losses or gradients. name = "Sum" def init self def call self, args, kwargs def forward self, params: List Parameter - Parameter ⋮---- concat values = ",".join str p.data for p in params default concatenation role descriptions = set p.role desc for p in params role descriptions = ", ".join role descriptions total = OutputParameter ⋮---- def backward self, summation: Parameter, args, kwargs ⋮---- pred params = summation.predecessors losses summation gradients = summation.get gradient and context text .strip ⋮--… 证据：`adalflow/adalflow/optim/text_grad/ops.py`
- **Create and return TGDData object directly**（source_file）：log = logging.getLogger name ⋮---- @dataclass class HistoryPrompt DataClass ⋮---- id: str value: str eval score: float method: str = field default=None reasoning: str = field default=None TEXT GRAD DESC TEMPLATE = r""" OPTIMIZER SYSTEM PROMPT = r"""You are an excellent prompt engineer tasked with instruction and demonstration tuning a compound LLM system. ⋮---- @dataclass class Instruction DataClass ⋮---- doc = "Structure variable values for instructions. Can be used in the history of instructions." text: str = field metadata={"desc": "The instruction text"} score: float = field responses: Optional List str = field gts: Optional List str = field ⋮---- @dataclass class TGDData DataClass ⋮---… 证据：`adalflow/adalflow/optim/text_grad/tgd_optimizer.py`
- **One generator will be one file, all stats are in logger metadata.json**（source_file）：logger = logging.getLogger name class Trainer Component ⋮---- doc = r"""Ready to use trainer for LLM task pipeline to optimize all types of parameters. adaltask: AdalComponent train batch size: Optional int = 4 train loader: Any val dataset = None test dataset = None strategy: Literal "random", "constrained" optimization order: Literal "sequential", "mix" = sequential order: List str = "text", "demo" max steps: int optimizer: Optimizer = None ckpt path: Optional str = None ckpt file: Optional str = None num workers: int = 4 max proposals per step: int = 5 batch val score threshold: Optional float = correct val score threshold: Optional float = max error samples: Optional int = 2 max correct… 证据：`adalflow/adalflow/optim/trainer/trainer.py`
- **the other config is to instantiate the entity class and function with the given config as arguments**（source_file）：r"""Config helper functions to manage configuration and rebuilt your task pipeline. Config format: json 1 include attribute and entity name to reconstruct all attributes of a pipeline. Example: { attribute and its config to recreate the component "document splitter": { "component name": "DocumentSplitter", "component config": { "split by": "word", "split length": 400, "split overlap": 200, }, }, "to embeddings": { "component name": "ToEmbeddings", "component config": { "embedder": { "component name": "Embedder", "component config": { "model client": { "entity name": "OpenAIClient", "entity config": {}, }, "model kwargs": { "model": "text-embedding-3-small", "dimensions": 256, "encoding form… 证据：`adalflow/adalflow/utils/config.py`
- **Global Config**（source_file）：def get adalflow default root path - str ⋮---- r"""This will be used for storing datasets, cache, logs, trained models, etc.""" root = None ⋮---- root = os.path.join os.getenv "APPDATA" , "adalflow" ⋮---- root = os.path.join os.path.expanduser "~" , ".adalflow" 证据：`adalflow/adalflow/utils/global_config.py`
- **Registry**（source_file）：class EntityMapping ⋮---- doc = r"""A registry for entities, components,classes, function. registry: Dict str, Type = {} ⋮---- @classmethod def register cls, name: str, entity cls: Type ⋮---- @classmethod def get cls, name: str - Type ⋮---- @classmethod def get all cls - Dict str, Type 证据：`adalflow/adalflow/utils/registry.py`
- **Config**（source_file）：gpt4o = tg.get engine engine name="gpt-4o" gpt 3 5 = tg.get engine engine name="gpt-3.5-turbo-0125" 证据：`benchmarks/BHH_object_count/text_grad/config.py`
- **Config**（source_file）：dspy save path = "benchmarks/BHH object count/models/dspy" adal save path = "benchmarks/BHH object count/models/adal" ⋮---- def load datasets ⋮---- trainset = HotPotQA split="train", size=100 valset = HotPotQA split="val", size=100 testset = HotPotQA split="test", size=200 证据：`benchmarks/hotpot_qa/config.py`
- **React Agent**（source_file）：log = logging.getLogger name ⋮---- gpt model kwargs = { async def test react agent model client: ModelClient, model kwargs: dict ⋮---- manager = MCPToolManager ⋮---- smithery api key = os.environ.get "SMITHERY API KEY" smithery server id = "@nickclyde/duckduckgo-mcp-server" mcp server url = f"https://server.smithery.ai/{smithery server id}/mcp?api key={smithery api key}" ⋮---- tools = await manager.get all tools ⋮---- sig = tool.definition.func desc.split "\n" 0 ⋮---- queries = react = ReActAgent ⋮---- agent response = react.call query 证据：`tutorials/mcp_agent/react_agent.py`
- **Config**（source_file）：configs = { 证据：`tutorials/rag/config.py`
- **---------------------------------------------------------------------------**（source_file）：logger = get logger level="DEBUG", enable file=False T = TypeVar "T" def search tool query: str - str def add tool x: int, y: int - int def sub tool x: int, y: int - int async def async sub tool x: int, y: int - int async def async multiply tool x: int, y: int - int async def async divide tool x: int, y: int - int def square root tool x: int - int --------------------------------------------------------------------------- ReAct Agent Setup ⋮---- Example Usage ⋮---- def run react agent example ⋮---- """Run an example of the ReAct agent with multiple tools.""" ⋮---- Create tool instances tools = ⋮---- @dataclass class Summary DataClass ⋮---- """Stores the results of an agent's execution.""" s… 证据：`tutorials/v1_agent_runner/agent_runner.py`
- **fill in the document**（source_file）：class RAG Component ⋮---- def init self, settings: dict ⋮---- vectorizer = Embedder text splitter = DocumentSplitter ⋮---- def build index self, documents: List Document def generate self, query: str, context: Optional str = None - Any ⋮---- prompt kwargs = { response = self.generator prompt kwargs=prompt kwargs ⋮---- def call self, query: str - Any ⋮---- retrieved documents = self.retriever query fill in the document ⋮---- convert all the documents to context string context str = self.retriever output processors retrieved documents ⋮---- settings = yaml.safe load file ⋮---- doc1 = Document doc2 = Document rag = RAG settings ⋮---- query = "What is Li Yin's hobby and profession?" 证据：`use_cases/unsorted/rag_yaml_config.py`
- **Auto Release**（documentation）：Simple automated release process for AdalFlow pip package. 证据：`AUTO_RELEASE.md`
- **License**（documentation）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`LICENSE.md`
- **Packaging**（documentation）：1. Do not add init .py in adalflow directory. Or else Python will treat it as a package, but really, the package is in adalflow/adalflow . 证据：`NOTES.md`
- 其余 17 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`docs/README.md`, `docs/design/README.md`, `docs/source/design/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`docs/README.md`, `docs/design/README.md`, `docs/source/design/README.md`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **AdalFlow 概述与系统架构**：importance `high`
  - source_paths: README.md, adalflow/adalflow/__init__.py, adalflow/adalflow/core/component.py, adalflow/adalflow/core/base_data_class.py, adalflow/adalflow/core/generator.py
- **Agent 与 Runner：同步、异步与流式执行**：importance `high`
  - source_paths: adalflow/adalflow/components/agent/agent.py, adalflow/adalflow/components/agent/runner.py, adalflow/adalflow/components/agent/react.py, adalflow/adalflow/components/agent/prompts.py, adalflow/adalflow/core/func_tool.py
- **模型客户端与提供商集成**：importance `high`
  - source_paths: adalflow/adalflow/components/model_client/openai_client.py, adalflow/adalflow/components/model_client/anthropic_client.py, adalflow/adalflow/components/model_client/bedrock_client.py, adalflow/adalflow/components/model_client/google_client.py, adalflow/adalflow/components/model_client/azureai_client.py
- **自动优化框架：TextGrad、Few-Shot 与 Trainer**：importance `high`
  - source_paths: adalflow/adalflow/optim/parameter.py, adalflow/adalflow/optim/text_grad/tgd_optimizer.py, adalflow/adalflow/optim/text_grad/llm_text_loss.py, adalflow/adalflow/optim/text_grad/ops.py, adalflow/adalflow/optim/few_shot/bootstrap_optimizer.py

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `810de99d86191b3aa0c939aa6d6d1a21977555aa`
- inspected_files: `README.md`, `pyproject.toml`, `docs/CHANGLOG.md`, `docs/README.md`, `docs/_dummy/dummy/__init__.py`, `docs/design/ComponentTool.md`, `docs/design/FunctionTool.md`, `docs/design/README.md`, `docs/design/agent-streaming.md`, `docs/design/api_approval_examples.md`, `docs/design/intuitive_evolution_api.md`, `docs/design/tool_approval.md`, `docs/design/tool_approval_design.md`, `docs/pyproject.toml`, `docs/source/change_api_file_name.py`, `docs/source/conf.py`, `docs/source/design/ComponentTool.md`, `docs/source/design/FunctionTool.md`, `docs/source/design/README.md`, `docs/source/design/agent-streaming.md`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 来源证据：[phantomcreds] Exposed secrets detected in this repository

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：[phantomcreds] Exposed secrets detected in this repository
- Why it matters: 可能影响升级、迁移或版本选择。
- Evidence: community_evidence:github | https://github.com/SylphAI-Inc/AdalFlow/issues/489 | 来源讨论提到 api key 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 来源证据：Quickstart Colab fails with `frequency_penalty` error on OpenAI Responses API (`o3-mini` teacher model)

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Quickstart Colab fails with `frequency_penalty` error on OpenAI Responses API (`o3-mini` teacher model)
- Why it matters: 可能阻塞安装或首次运行。
- Evidence: community_evidence:github | https://github.com/SylphAI-Inc/AdalFlow/issues/481 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 来源证据：API Error: TimeoutError: Request failed

- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：API Error: TimeoutError: Request failed
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/SylphAI-Inc/AdalFlow/issues/474 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 来源证据：TypeError: argument after * must be an iterable, not NoneType — Function.args/kwargs typed Optional but unpacked uncond…

- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：TypeError: argument after * must be an iterable, not NoneType — Function.args/kwargs typed Optional but unpacked unconditionally
- Why it matters: 可能阻塞安装或首次运行。
- Evidence: community_evidence:github | https://github.com/SylphAI-Inc/AdalFlow/issues/479 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 能力判断依赖假设

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: 将假设转成下游验证清单。
- Why it matters: 假设不成立时，用户拿不到承诺的能力。
- Evidence: capability.assumptions | https://github.com/SylphAI-Inc/AdalFlow | README/documentation is current enough for a first validation pass.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 维护活跃度未知

- Trigger: 未记录 last_activity_observed。
- Host AI rule: 补 GitHub 最近 commit、release、issue/PR 响应信号。
- Why it matters: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。
- Evidence: evidence.maintainer_signals | https://github.com/SylphAI-Inc/AdalFlow | last_activity_observed missing
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

- Trigger: no_demo
- Evidence: downstream_validation.risk_items | https://github.com/SylphAI-Inc/AdalFlow | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: 存在评分风险

- Trigger: no_demo
- Why it matters: 风险会影响是否适合普通用户安装。
- Evidence: risks.scoring_risks | https://github.com/SylphAI-Inc/AdalFlow | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 来源证据：🤖 Connect your agent to MEEET STATE — earn $MEEET on Solana

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：🤖 Connect your agent to MEEET STATE — earn $MEEET on Solana
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | https://github.com/SylphAI-Inc/AdalFlow/issues/475 | 来源讨论提到 python 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 10: issue/PR 响应质量未知

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: 抽样最近 issue/PR，判断是否长期无人处理。
- Why it matters: 用户无法判断遇到问题后是否有人维护。
- Evidence: evidence.maintainer_signals | https://github.com/SylphAI-Inc/AdalFlow | issue_or_pr_quality=unknown
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
