You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+68Lines changed: 68 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,17 @@ See `examples/sim_chat_stream_demo/chatbot.py` for a concrete example that wires
117
117
-**Add a new skill**: drop a `.md` or `.txt` file under an allowed root and register it in `skills_config` (or add a directory registry entry).【F:automa_ai/skills/README.md†L10-L35】
118
118
-**Add a new memory store**: implement `BaseMemoryStore`, register with `MemoryStoreRegistry`, then update the `memory_config` for `DefaultMemoryManager`.【F:automa_ai/memory/memory_stores.py†L1-L59】【F:automa_ai/memory/manager.py†L46-L82】
119
119
120
+
121
+
## Default tools (non-MCP)
122
+
123
+
BEM-AI now supports first-class default tools configured directly in `AgentFactory` via `tools_config` (not MCP).
124
+
125
+
- Core configuration models are in `automa_ai/config/tools.py` (`ToolsConfig`, `ToolSpec`).
126
+
- Registry/factory and internal tool interface are in `automa_ai/tools/base.py` and `automa_ai/tools/registry.py`.
127
+
- Built-in tools are registered in `automa_ai/tools/__init__.py`.
128
+
-`AgentFactory` accepts `tools_config` and passes tool specs to `GenericLangGraphChatAgent`, which binds tools only when configured.
129
+
- Built-in `web_search` implementation is under `automa_ai/tools/web_search/` with Serper/OSS search, Firecrawl/OSS scraping, and Jina/Cohere/OSS reranking.
130
+
120
131
## Building and Testing
121
132
122
133
The repository does not include a dedicated build step in this document, but you can run focused tests for the key subsystems below.
@@ -138,6 +149,62 @@ All pull request comments should be complete sentences and end with a period.
138
149
- Add new tests for any new feature or bug fix.
139
150
- Update documentation for user-facing changes.
140
151
152
+
## Example Development Guidelines (Lessons Learned)
153
+
154
+
Use this checklist for all new examples drafted in this repository.
155
+
156
+
### Required files and structure
157
+
158
+
- Every example must include:
159
+
- a **Streamlit UI** script (`ui.py`), and
160
+
- a server bootstrap script:
161
+
-`agent.py` for a single-agent example, or
162
+
-`multi_agents.py` for a multi-agent example.
163
+
- Every example must include a `README.md` with:
164
+
- what the example demonstrates,
165
+
- setup instructions,
166
+
- run instructions,
167
+
- troubleshooting tips.
168
+
- Add a local `.env` file in the example folder for API keys, model names, and service URLs.
169
+
170
+
### Agent construction and configuration
171
+
172
+
- Always create agents via `AgentFactory`.
173
+
- Keep prompts as simple as possible.
174
+
- MCP configs and system prompts should be defined in the server bootstrap script (`agent.py` or `multi_agents.py`) so startup behavior is explicit.
175
+
176
+
### Tools and memory plugin pattern
177
+
178
+
- Follow a registry + config pattern (similar to memory stores):
179
+
- register implementations once via plugin/entry-point loading,
180
+
- bind them with declarative config (`tools_config`, `memory_config`) in `AgentFactory`.
181
+
- Avoid ad-hoc runtime registration functions in example flow logic.
182
+
- For custom tools, prefer entry-point/plugin registration so multiprocess server workers can resolve the same tool types reliably.
183
+
184
+
### Multi-agent and streaming lessons
185
+
186
+
- For multi-agent demos:
187
+
- use A2A subagent delegation (`SubAgentSpec`) instead of direct Python calls,
188
+
- keep names/tool names deterministic and unique.
189
+
- For Streamlit streaming UIs:
190
+
- persist partial assistant output in `st.session_state`,
191
+
- guard against rerun interruptions (disable refresh/session-reset controls while streaming),
192
+
- only refresh side snapshots when no stream is active.
193
+
194
+
### Blackboard lessons
195
+
196
+
- If using local JSON blackboard backend, follow the backend file naming contract (`<session_id>.blackboard.json`).
197
+
- Use blackboard operations and paths exactly as supported by tooling/contracts; avoid JSON-patch style ops if not supported.
198
+
- Prefer context-aware `session_id` handling where available to reduce brittle LLM-generated IDs.
199
+
200
+
### Documentation expectations for engineering users
201
+
202
+
- Write README instructions for users who are domain engineers (for example, mechanical engineers) with moderate scripting experience.
203
+
- Use practical examples and plain language:
204
+
- expected inputs,
205
+
- expected outputs,
206
+
- how to validate success.
207
+
141
208
## Learning Mode
142
209
When a user explicitly expressed that they are currently onboarding or learning this repository, the agent shall follow the additional instructions in the learning mode.
143
210
@@ -157,3 +224,4 @@ When a user explicitly expressed that they are currently onboarding or learning
157
224
- If the user asks for something complex, **suggest simpler alternatives**
158
225
- Treat every session as a **teaching opportunity**
159
226
- Be direct, **Tell the user when they are doing something wrong**
0 commit comments