agentme 0.14.0 → 0.16.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.
Files changed (23) hide show
  1. package/.filedist-package.yml +1 -1
  2. package/.xdrs/agentme/edrs/application/003-javascript-project-tooling.md +3 -3
  3. package/.xdrs/agentme/edrs/application/010-golang-project-tooling.md +3 -3
  4. package/.xdrs/agentme/edrs/application/014-python-project-tooling.md +2 -2
  5. package/.xdrs/agentme/edrs/application/015-cli-tool-standards.md +6 -7
  6. package/.xdrs/agentme/edrs/application/018-ai-llm-development-standards.md +181 -0
  7. package/.xdrs/agentme/edrs/application/019-ai-agents-development-standards.md +286 -0
  8. package/.xdrs/agentme/edrs/application/020-ai-workflow-development-standards.md +262 -0
  9. package/.xdrs/agentme/edrs/application/021-ai-eval-standards.md +90 -0
  10. package/.xdrs/agentme/edrs/application/{019-ml-dataset-structure.md → 024-ml-dataset-structure.md} +2 -2
  11. package/.xdrs/agentme/edrs/application/{020-ai-agent-xdrs-knowledge-layer.md → 025-ai-agent-xdrs-knowledge-layer.md} +4 -4
  12. package/.xdrs/agentme/edrs/application/{021-pragmatic-hexagonal-architecture.md → 026-pragmatic-hexagonal-architecture.md} +2 -2
  13. package/.xdrs/agentme/edrs/application/skills/001-create-javascript-project/SKILL.md +2 -2
  14. package/.xdrs/agentme/edrs/application/skills/003-create-golang-project/SKILL.md +2 -2
  15. package/.xdrs/agentme/edrs/application/skills/005-create-python-project/SKILL.md +3 -3
  16. package/.xdrs/agentme/edrs/devops/008-common-targets.md +28 -3
  17. package/.xdrs/agentme/edrs/devops/027-environment-variable-configuration.md +158 -0
  18. package/.xdrs/agentme/edrs/index.md +8 -5
  19. package/.xdrs/agentme/edrs/principles/007-project-quality-standards.md +32 -1
  20. package/.xdrs/agentme/edrs/principles/022-secrets-management.md +20 -0
  21. package/package.json +3 -3
  22. package/.xdrs/agentme/edrs/application/018-ai-agent-development-standards.md +0 -309
  23. package/.xdrs/agentme/edrs/application/024-llm-development-standards.md +0 -116
@@ -1,116 +0,0 @@
1
- ---
2
- name: agentme-edr-policy-024-llm-development-standards
3
- description: Defines the standard framework, provider compatibility, observability approach, and unit testing patterns for LLM-based applications in Python. Use when building, reviewing, or scaffolding any code that makes direct LLM calls, manages prompt context, or handles conversation history.
4
- apply-to: Python projects that make LLM calls, manage prompt context, or handle conversation threads
5
- valid-from: 2026-06-03
6
- ---
7
-
8
- # agentme-edr-policy-024: LLM development standards
9
-
10
- ## Context and Problem Statement
11
-
12
- LLM-based applications can be built at different levels of abstraction — from a single prompt call to a full autonomous agent or a complex multi-step workflow. Without a shared vocabulary and a prescribed framework, projects mix incompatible patterns for invoking models, managing context, and tracing requests.
13
-
14
- Which framework should be used for LLM calls, how should providers be configured, and what is the canonical meaning of "LLM", "agent", and "workflow" in this codebase?
15
-
16
- ## Decision Outcome
17
-
18
- **Use LangChain as the standard framework for all direct LLM interactions. Adopt a strict three-tier conceptual model — LLM / Agent / Workflow — that maps each tier to a specific library.**
19
-
20
- ### Conceptual model
21
-
22
- Three distinct tiers of LLM-based computation are recognized in this project. Every component MUST be classified into exactly one tier:
23
-
24
- | Tier | What it is | Library |
25
- |---|---|---|
26
- | **LLM** | A request → response prompt exchange with a model. May include a conversation history or thread. No autonomous decision-making. | `langchain` / `langchain-openai` |
27
- | **Agent** | An LLM-based flow driven by a tool-invocation loop that the LLM itself plans and executes. The LLM decides which tools to call and when to stop. | `deepagents` |
28
- | **Workflow** | A directed graph of nodes that mixes LLM-based nodes (simple LLM calls or agentic loops) with deterministic algorithmic nodes. The graph topology is defined in code, not chosen by the LLM at runtime. | `langgraph` |
29
-
30
- These tiers nest: a Workflow may contain Agent nodes; an Agent uses LLM calls internally. The tier of a component is determined by its outermost controlling structure.
31
-
32
- See [agentme-edr-018](018-ai-agent-development-standards.md) for Agent and Workflow implementation standards.
33
-
34
- ### Details
35
-
36
- #### 01-conceptual-model
37
-
38
- Every component that interacts with an LLM MUST be classified as exactly one of the three tiers defined in the conceptual model table above: **LLM**, **Agent**, or **Workflow**.
39
-
40
- - Do NOT use the word "agent" to describe a component that only makes a single LLM call without a tool-invocation loop.
41
- - Do NOT use the word "workflow" to describe a component that is purely an LLM call with no graph structure.
42
- - When designing a new feature, identify the correct tier first. The tier determines which library and patterns apply (LangChain, deepagents, or LangGraph).
43
-
44
- #### 02-llm-framework
45
-
46
- All direct LLM calls MUST use **LangChain** via the `langchain` and `langchain-openai` packages.
47
-
48
- - Use `langchain-openai` as the provider integration layer. It supports both OpenAI and Azure OpenAI through environment variables, with no code changes required to switch.
49
- - Select the provider by setting `OPENAI_API_TYPE=azure` for Azure OpenAI or omitting it for OpenAI.
50
- - Never hardcode provider-specific URLs, deployment names, or API versions in code; inject them through environment variables or a configuration object.
51
-
52
- Minimum required environment variable surface:
53
-
54
- | Variable | Purpose |
55
- |---|---|
56
- | `OPENAI_API_KEY` | API key (both providers) |
57
- | `OPENAI_API_BASE` / `AZURE_OPENAI_ENDPOINT` | Endpoint (Azure only) |
58
- | `OPENAI_API_VERSION` | API version (Azure only) |
59
- | `AZURE_OPENAI_DEPLOYMENT` | Deployment/model name (Azure only) |
60
- | `OPENAI_MODEL` | Model name (OpenAI only) |
61
-
62
- LangChain chain or runnable definitions MUST be placed in `app/workflows/<workflow>/agents.py` (for workflow-scoped LLM calls) or in the appropriate application layer module. Do not inline LLM construction in adapter or CLI code.
63
-
64
- #### 03-llm-observability
65
-
66
- Enable LangChain auto-tracing at every application entry point by calling `mlflow.langchain.autolog()` during startup, before any LLM call is made.
67
-
68
- - This captures inputs, outputs, token counts, and latency for every LangChain chain or runnable automatically.
69
- - Pair with `mlflow.start_run()` at the workflow or agent level to group LLM traces under a named experiment run (see [agentme-edr-018](018-ai-agent-development-standards.md) for run-level MLflow instrumentation).
70
- - Do not disable autolog in production unless there is an explicit performance justification documented in the codebase.
71
-
72
- #### 04-unit-test-mocking
73
-
74
- LLM provider calls are external API calls and MUST be mocked in unit tests per [agentme-edr-004](../principles/004-unit-test-requirements.md) rule `06-should-avoid-mocks`. Mocking LLM providers enables offline test execution while testing workflow logic, routing, and state management.
75
-
76
- Use **LangChain's `FakeListChatModel`** or a custom `GenericFakeChatModel` wrapper for unit testing LLM calls:
77
-
78
- ```python
79
- from langchain_core.language_models.fake_chat_models import FakeListChatModel
80
-
81
- # Unit test with mocked LLM responses
82
- def test_document_workflow_routing():
83
- fake_llm = FakeListChatModel(responses=[
84
- "APPROVE",
85
- "The document meets all quality criteria."
86
- ])
87
-
88
- workflow = DocumentWorkflow(llm=fake_llm)
89
- result = workflow.run(input_doc)
90
-
91
- assert result.status == "approved"
92
- assert "quality criteria" in result.reasoning
93
- ```
94
-
95
- **Mocking boundaries:**
96
-
97
- - Mocks are ONLY for unit tests (required). Integration tests SHOULD use real LLM providers when implemented (see [agentme-edr-018](018-ai-agent-development-standards.md) rule `13-three-tier-testing-strategy`).
98
- - Evals MUST use real LLM providers to capture model drift and are REQUIRED before every release (see [agentme-edr-018](018-ai-agent-development-standards.md) rule `04-dataset-driven-accuracy-measurement`).
99
- - Mock the LLM provider at the construction boundary (dependency injection), not by patching internal LangChain methods.
100
- - Test files MUST follow the naming convention `<name>_test.py` for unit tests (see [agentme-edr-018](018-ai-agent-development-standards.md) rule `13-three-tier-testing-strategy` for integration test naming).
101
-
102
- When workflows or agents require injectable LLM instances, accept the LLM as a constructor parameter or configuration field:
103
-
104
- ```python
105
- class DocumentWorkflow:
106
- def __init__(self, llm: Optional[BaseChatModel] = None):
107
- self.llm = llm or ChatOpenAI(model="gpt-4")
108
- ```
109
-
110
- This allows unit tests to inject `FakeListChatModel` while production code uses the real provider.
111
-
112
- ## References
113
-
114
- - [agentme-edr-018](018-ai-agent-development-standards.md) — Agent and Workflow implementation standards (LangGraph, deepagents, MLflow run-level tracking)
115
- - [agentme-edr-004](../principles/004-unit-test-requirements.md) — Unit test requirements including external API mocking guidance
116
- - [agentme-edr-014](014-python-project-tooling.md) — Python project tooling and structure