agentme 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.filedist-package.yml +1 -1
- package/.xdrs/agentme/edrs/application/003-javascript-project-tooling.md +3 -3
- package/.xdrs/agentme/edrs/application/010-golang-project-tooling.md +3 -3
- package/.xdrs/agentme/edrs/application/014-python-project-tooling.md +2 -2
- package/.xdrs/agentme/edrs/application/015-cli-tool-standards.md +2 -2
- package/.xdrs/agentme/edrs/application/018-ai-llm-development-standards.md +180 -0
- package/.xdrs/agentme/edrs/application/019-ai-agents-development-standards.md +284 -0
- package/.xdrs/agentme/edrs/application/020-ai-workflow-development-standards.md +261 -0
- package/.xdrs/agentme/edrs/application/021-ai-eval-standards.md +90 -0
- package/.xdrs/agentme/edrs/application/{019-ml-dataset-structure.md → 024-ml-dataset-structure.md} +2 -2
- package/.xdrs/agentme/edrs/application/{020-ai-agent-xdrs-knowledge-layer.md → 025-ai-agent-xdrs-knowledge-layer.md} +4 -4
- package/.xdrs/agentme/edrs/application/{021-pragmatic-hexagonal-architecture.md → 026-pragmatic-hexagonal-architecture.md} +2 -2
- package/.xdrs/agentme/edrs/application/skills/001-create-javascript-project/SKILL.md +2 -2
- package/.xdrs/agentme/edrs/application/skills/003-create-golang-project/SKILL.md +2 -2
- package/.xdrs/agentme/edrs/application/skills/005-create-python-project/SKILL.md +3 -3
- package/.xdrs/agentme/edrs/index.md +7 -4
- package/.xdrs/agentme/edrs/principles/007-project-quality-standards.md +71 -2
- package/package.json +3 -3
- package/.xdrs/agentme/edrs/application/018-ai-agent-development-standards.md +0 -174
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: agentme-edr-policy-018-ai-agent-development-standards
|
|
3
|
-
description: Defines the standard toolchain, framework, evaluation approach, and workflow patterns for building AI agents with Python and LangGraph. Use when scaffolding, reviewing, or extending AI agent projects.
|
|
4
|
-
apply-to: AI agent projects built with Python
|
|
5
|
-
valid-from: 2026-05-26
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# agentme-edr-policy-018: AI agent development standards
|
|
9
|
-
|
|
10
|
-
## Context and Problem Statement
|
|
11
|
-
|
|
12
|
-
AI agent projects vary widely in how they choose frameworks, manage context, evaluate outputs, and structure workflows. Without a shared baseline, projects accumulate incompatible patterns for LLM provider abstraction, flow design, and dataset-driven testing.
|
|
13
|
-
|
|
14
|
-
Which tools, frameworks, and design patterns should AI agent projects follow to ensure reproducibility, testability, and maintainability?
|
|
15
|
-
|
|
16
|
-
## Decision Outcome
|
|
17
|
-
|
|
18
|
-
**Use Python with LangGraph for flow orchestration and MLflow for experiment tracking and local evaluation.**
|
|
19
|
-
|
|
20
|
-
### Details
|
|
21
|
-
|
|
22
|
-
#### 01-language-and-framework
|
|
23
|
-
|
|
24
|
-
All agent projects MUST be implemented in Python, following [agentme-edr-014](014-python-project-tooling.md) for project structure, tooling, and Makefile conventions.
|
|
25
|
-
|
|
26
|
-
Agent flows MUST be built with **LangGraph**. Use LangGraph `StateGraph` to model each distinct workflow as an explicit directed graph with typed state.
|
|
27
|
-
|
|
28
|
-
#### 02-llm-provider-compatibility
|
|
29
|
-
|
|
30
|
-
Agent code MUST be compatible with both **OpenAI** and **Azure OpenAI** providers without code changes. Achieve this by:
|
|
31
|
-
|
|
32
|
-
- Using the `langchain-openai` package which supports both providers through environment variables.
|
|
33
|
-
- Selecting the provider by setting `OPENAI_API_TYPE=azure` (Azure OpenAI) or omitting it (OpenAI).
|
|
34
|
-
- Never hardcoding provider-specific URLs, deployment names, or API versions in code; inject them through environment variables or a configuration object.
|
|
35
|
-
|
|
36
|
-
Minimum required environment variable surface:
|
|
37
|
-
|
|
38
|
-
| Variable | Purpose |
|
|
39
|
-
|---|---|
|
|
40
|
-
| `OPENAI_API_KEY` | API key (both providers) |
|
|
41
|
-
| `OPENAI_API_BASE` / `AZURE_OPENAI_ENDPOINT` | Endpoint (Azure only) |
|
|
42
|
-
| `OPENAI_API_VERSION` | API version (Azure only) |
|
|
43
|
-
| `AZURE_OPENAI_DEPLOYMENT` | Deployment/model name (Azure only) |
|
|
44
|
-
| `OPENAI_MODEL` | Model name (OpenAI only) |
|
|
45
|
-
|
|
46
|
-
#### 03-observability-and-experiment-tracking
|
|
47
|
-
|
|
48
|
-
Use **MLflow** for all agent observability and evaluation:
|
|
49
|
-
|
|
50
|
-
- Wrap each agent run with `mlflow.start_run()` to capture traces, parameters, and metrics locally.
|
|
51
|
-
- Enable LangChain auto-tracing via `mlflow.langchain.autolog()` at entry point startup.
|
|
52
|
-
- Log run parameters (model name, temperature, prompt version) and output metrics (accuracy, latency, token counts) using `mlflow.log_param` / `mlflow.log_metric`.
|
|
53
|
-
- Run a local MLflow tracking server with `mlflow ui` to inspect runs during development. Do not require a remote MLflow server for local development.
|
|
54
|
-
|
|
55
|
-
#### 04-dataset-driven-accuracy-measurement
|
|
56
|
-
|
|
57
|
-
Every agent pipeline MUST have a companion evaluation dataset and an MLflow experiment that measures accuracy against it. Datasets and evals are organized per-workflow following rule `07-workflow-structure` and rule `08-workflow-evals`.
|
|
58
|
-
|
|
59
|
-
- Store evaluation datasets under `evals/<workflow>/` (sibling of `lib/` and `examples/`), following [agentme-edr-019](019-ml-dataset-structure.md) for structure and format. For MLflow input/output pairs, use the JSONL format described in `agentme-edr-019.04-complex-structured-datasets-must-use-jsonl`.
|
|
60
|
-
- Write evaluation scripts under `evals/<workflow>/` that load the dataset, run each input through the live agent (against real LLMs, not mocks), compare outputs to expected values, and log per-sample and aggregate metrics to an MLflow experiment.
|
|
61
|
-
- Add a `make eval` Makefile target in the module root Makefile (the same Makefile that sits alongside `lib/` and `examples/`) that delegates to all per-workflow eval targets.
|
|
62
|
-
- Evaluation MUST run against real LLM providers, not recorded responses, to capture model drift. MLflow tracking MUST work locally without a remote server.
|
|
63
|
-
|
|
64
|
-
#### 05-flow-documentation
|
|
65
|
-
|
|
66
|
-
Each agent flow MUST be documented as a **Mermaid graph** in the project `README.md`. The diagram must match the LangGraph `StateGraph` definition:
|
|
67
|
-
|
|
68
|
-
- Use `graph TD` or `graph LR` direction.
|
|
69
|
-
- Label each node with its Python function name.
|
|
70
|
-
- Label conditional edges with the condition expression.
|
|
71
|
-
- Update the diagram whenever the graph topology changes.
|
|
72
|
-
|
|
73
|
-
Example minimal diagram block:
|
|
74
|
-
|
|
75
|
-
```mermaid
|
|
76
|
-
graph TD
|
|
77
|
-
A[fetch_context] --> B[draft_response]
|
|
78
|
-
B --> C{verify}
|
|
79
|
-
C -->|pass| D[output]
|
|
80
|
-
C -->|fail| B
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
#### 06-verification-steps
|
|
84
|
-
|
|
85
|
-
Agent flows MUST include at least one explicit verification node before producing final output:
|
|
86
|
-
|
|
87
|
-
- Model the verification step as a dedicated LangGraph node (e.g. `verify_output`).
|
|
88
|
-
- The node checks the draft output against defined acceptance criteria (schema validation, factual consistency check, rubric scoring, or LLM-as-judge call).
|
|
89
|
-
- On failure, the verification node MUST route back to the relevant generation node, not silently pass through.
|
|
90
|
-
- Log verification results (pass/fail, score, reason) as MLflow metrics on the current run.
|
|
91
|
-
|
|
92
|
-
#### 07-workflow-structure
|
|
93
|
-
|
|
94
|
-
Agent logic MUST be organized as named workflows following [agentme-edr-021](021-pragmatic-hexagonal-architecture.md). Each workflow is an independent LangGraph `StateGraph` with a defined start node and end node, connecting agents, states, routes, and decision nodes.
|
|
95
|
-
|
|
96
|
-
Workflows live inside `app/workflows/` (the application layer), while external integrations such as LLM providers, vector stores, and third-party APIs live under `adapters/connectors/` (the outbound adapter layer). Inbound interfaces (HTTP API, CLI) live under `adapters/` as inbound adapters.
|
|
97
|
-
|
|
98
|
-
For each workflow named `<workflow>`, the full project layout is:
|
|
99
|
-
|
|
100
|
-
```text
|
|
101
|
-
lib/src/<package_name>/
|
|
102
|
-
adapters/
|
|
103
|
-
http/ # inbound: API server that triggers workflows
|
|
104
|
-
cli/ # inbound: CLI entry point (if applicable)
|
|
105
|
-
connectors/ # outbound: external resource integrations
|
|
106
|
-
openai/ # LLM provider connector
|
|
107
|
-
azure-openai/ # alternative LLM provider connector
|
|
108
|
-
postgres/ # database connector (if applicable)
|
|
109
|
-
vector-store/ # vector DB connector (if applicable)
|
|
110
|
-
app/
|
|
111
|
-
workflows/
|
|
112
|
-
<workflow>/
|
|
113
|
-
graph.py # StateGraph definition; entry point for the workflow
|
|
114
|
-
agents.py # LangChain agent definitions used by this workflow
|
|
115
|
-
states.py # Typed state dataclasses / TypedDicts
|
|
116
|
-
routes.py # Conditional edge functions
|
|
117
|
-
shared/ # infrastructure-agnostic utilities
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
- `app/workflows/<workflow>/graph.py` MUST define and compile the `StateGraph` and expose a `graph` object that callers invoke.
|
|
121
|
-
- Tool calls within workflow nodes that interact with external systems MUST use connectors from `adapters/connectors/`, not inline API calls.
|
|
122
|
-
- Additional modules (prompts, schemas) MAY be added inside `app/workflows/<workflow>/` when they are specific to that workflow. Shared utilities belong in `shared/`.
|
|
123
|
-
- Each workflow MUST be documented with a Mermaid diagram in the project `README.md` following rule `05-flow-documentation`.
|
|
124
|
-
|
|
125
|
-
#### 08-workflow-evals
|
|
126
|
-
|
|
127
|
-
For each workflow `<workflow>` there MUST be a corresponding eval directory:
|
|
128
|
-
|
|
129
|
-
```text
|
|
130
|
-
evals/
|
|
131
|
-
<workflow>/
|
|
132
|
-
Makefile # eval targets for this workflow
|
|
133
|
-
dataset_<slice>/ # one folder per eval slice (see agentme-edr-019)
|
|
134
|
-
eval_<slice>.py # evaluation script for each slice
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
The `evals/<workflow>/Makefile` MUST define:
|
|
138
|
-
|
|
139
|
-
| Target | Behaviour |
|
|
140
|
-
|---|---|
|
|
141
|
-
| `eval` | Runs all eval slices for the workflow |
|
|
142
|
-
| `eval-<slice>` | Runs one named slice (e.g. `eval-simple`, `eval-complex`) |
|
|
143
|
-
|
|
144
|
-
Each `eval_<slice>.py` script MUST:
|
|
145
|
-
|
|
146
|
-
- Load the dataset from `evals/<workflow>/dataset_<slice>/` following [agentme-edr-019](019-ml-dataset-structure.md).
|
|
147
|
-
- Run every input through the live workflow against real LLMs.
|
|
148
|
-
- Log per-sample and aggregate metrics to an MLflow experiment that runs locally.
|
|
149
|
-
|
|
150
|
-
The module root Makefile `make eval` target MUST delegate to `eval` in every `evals/<workflow>/Makefile`.
|
|
151
|
-
|
|
152
|
-
#### 09-local-sandbox
|
|
153
|
-
|
|
154
|
-
When a workflow node or tool requires a **local sandbox** — an isolated environment where the agent can read files, glob-search directories, and execute shell commands — use the **[deepagents](https://github.com/deepagents/deepagents) framework** to provide that sandbox.
|
|
155
|
-
|
|
156
|
-
**When to apply this rule**
|
|
157
|
-
|
|
158
|
-
Use deepagents whenever ANY of the following is true for a workflow or tool:
|
|
159
|
-
- The agent needs to execute shell commands or scripts in a controlled environment.
|
|
160
|
-
- The agent needs to list, read, or search files across multiple directories at runtime.
|
|
161
|
-
- The agent operates on user-supplied or generated file trees that must not escape a sandboxed boundary.
|
|
162
|
-
|
|
163
|
-
**Integration requirements**
|
|
164
|
-
|
|
165
|
-
- Initialize the sandbox at the start of the workflow run and shut it down in the same `try/finally` block.
|
|
166
|
-
- Pass the sandbox handle into the LangGraph workflow state so all nodes share the same sandbox instance.
|
|
167
|
-
- If the host-side code needs to pass files into the sandbox (e.g. generated config or input data), create a temporary directory with `tempfile.mkdtemp()`, write the files there, and mount it into the sandbox. Clean it up in the `finally` block.
|
|
168
|
-
- Replace hand-rolled `read_file`, `search_files`, and `grep_file` tool implementations with the equivalent tools provided by deepagents.
|
|
169
|
-
|
|
170
|
-
## References
|
|
171
|
-
|
|
172
|
-
- [agentme-edr-021](021-pragmatic-hexagonal-architecture.md) — Adapter/application layer separation that defines the project layout
|
|
173
|
-
- [agentme-edr-014](014-python-project-tooling.md) — Python project tooling and structure
|
|
174
|
-
- [agentme-edr-019](019-ml-dataset-structure.md) — ML dataset structure for eval datasets
|