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
- Add YamlPersonaRepository: loads personas/*.yaml on startup; FileSystemWatcher hot-reload with 500ms debounce
- Re-introduce IPersonaRepository.PersonaChanged event (PersonaChangeKind: Added/Updated/Removed)
- Validation: required id/name/systemPrompt, BackendId.TryParse for backend, ToolRef.Parse for tools, duplicate-id rejected, malformed YAML throws InvalidOperationException
- DI fallback chain: YAML when personas dir exists -> InMemory in Development -> fail fast in non-Dev
- Seed personas/*.yaml for the 6 default DBA personas (orchestrator, explorer, analyst, performance, assessor, administrator)
- API csproj copies personas/*.yaml to output dir
- Tests: 13 new (101 total green); covers load, validation failures, duplicates, version stability, add/modify/delete events, watcher hot-reload
- README: new 'Personas (M4)' section, schema, hot-reload behaviour, how to add a persona
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+34-2Lines changed: 34 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,6 +194,38 @@ public class AgentPersona
194
194
195
195
When the workflow engine invokes an agent, it uses the persona's `Backend` to look up the configuration and instantiate the appropriate `IChatClient`.
196
196
197
+
## Personas (M4)
198
+
199
+
Personas live as YAML files in a directory configured via `Personas:Directory` (defaults to `./personas` relative to the content root). Each file describes a single persona and is hot-reloaded when the file changes on disk.
200
+
201
+
### Schema
202
+
203
+
```yaml
204
+
id: explorer # required, matches the persona's address
205
+
name: Schema Explorer # required, human-readable name
You discover database structure: schemas, tables, views, columns, indexes,
209
+
foreign keys. Use the SQL MCP tools to introspect; never modify data.
210
+
tools: [] # optional, list of mcp:<server>.<tool> refs
211
+
guardrails: # optional
212
+
maxTokens: 2048
213
+
temperature: 0.1
214
+
topP: 0.95
215
+
```
216
+
217
+
### Hot reload
218
+
219
+
The repository registers a `FileSystemWatcher` on the personas directory and debounces bursts of file events (~500 ms). On every reload it diffs the new snapshot against the previous one and raises `IPersonaRepository.PersonaChanged` for every add, update, or removal. Consumers can subscribe to the event to invalidate caches or re-prime workflows.
220
+
221
+
If the directory is not present at startup the API falls back to the bundled `InMemoryPersonaRepository` in `Development` and fails fast in any other environment.
222
+
223
+
### Adding a persona
224
+
225
+
1. Create `personas/<id>.yaml` with the schema above.
226
+
2. Save the file — the watcher reloads automatically; the new persona becomes available on the next `GET /v1/personas` call.
227
+
3. Invalid YAML or a missing required field is logged and the previous snapshot is kept (the API does not crash).
228
+
197
229
## API surface (v1)
198
230
199
231
| Method | Route | Description |
@@ -251,7 +283,7 @@ This avoids leaking SSE streams to anonymous clients while keeping the EventSour
0 commit comments