1212pip install empathy-framework[full]
1313```
1414
15- ## What's New in v3.0.1
15+ ## What's New in v3.1.0
1616
17+ ### Agent Intelligence System
18+ - ** Smart Router** — Natural language wizard dispatch: "Fix security in auth.py" → routes to SecurityWizard
19+ - ** Memory Graph** — Cross-wizard knowledge sharing: bugs, fixes, and patterns connected across sessions
20+ - ** Auto-Chaining** — Wizards automatically trigger related wizards based on findings
21+ - ** Prompt Engineering Wizard** — Analyze, generate, and optimize prompts with token cost savings
22+
23+ ### Resilience Patterns
24+ - ** Retry with Backoff** — Automatic retries with exponential backoff and jitter
25+ - ** Circuit Breaker** — Prevent cascading failures (CLOSED → OPEN → HALF_OPEN states)
26+ - ** Timeout & Fallback** — Graceful degradation with configurable fallbacks
27+ - ** Health Checks** — Monitor system components with configurable thresholds
28+
29+ ### Previous (v3.0.x)
1730- ** XML-Enhanced Prompts** — Structured prompts for consistent, parseable LLM responses
1831- ** Multi-Model Provider System** — Choose Anthropic, OpenAI, Ollama, or Hybrid mode
1932- ** 80-96% Cost Savings** — Smart tier routing: cheap models detect, best models decide
@@ -189,7 +202,7 @@ workflow_xml_configs:
189202 template_name : " code-review"
190203` ` `
191204
192- Built-in templates: ` security-audit`, `code-review`, `research`, `bug-analysis`
205+ Built-in templates: ` security-audit`, `code-review`, `research`, `bug-analysis`, `perf-audit`, `refactor-plan`, `test-gen`, `doc-gen`, `release-prep`, `dependency-check`
193206
194207` ` ` python
195208from empathy_os.prompts import get_template, XmlResponseParser, PromptContext
@@ -207,6 +220,140 @@ print(result.summary, result.findings, result.checklist)
207220
208221---
209222
223+ # # Smart Router
224+
225+ Route natural language requests to the right wizard automatically :
226+
227+ ` ` ` python
228+ from empathy_os.routing import SmartRouter
229+
230+ router = SmartRouter()
231+
232+ # Natural language routing
233+ decision = router.route_sync("Fix the security vulnerability in auth.py")
234+ print(f"Primary: {decision.primary_wizard}") # → security-audit
235+ print(f"Also consider: {decision.secondary_wizards}") # → [code-review]
236+ print(f"Confidence: {decision.confidence}")
237+
238+ # File-based suggestions
239+ suggestions = router.suggest_for_file("requirements.txt") # → [dependency-check]
240+
241+ # Error-based suggestions
242+ suggestions = router.suggest_for_error("NullReferenceException") # → [bug-predict, test-gen]
243+ ` ` `
244+
245+ ---
246+
247+ # # Memory Graph
248+
249+ Cross-wizard knowledge sharing - wizards learn from each other :
250+
251+ ` ` ` python
252+ from empathy_os.memory import MemoryGraph, EdgeType
253+
254+ graph = MemoryGraph()
255+
256+ # Add findings from any wizard
257+ bug_id = graph.add_finding(
258+ wizard="bug-predict",
259+ finding={
260+ "type": "bug",
261+ "name": "Null reference in auth.py:42",
262+ "severity": "high"
263+ }
264+ )
265+
266+ # Connect related findings
267+ fix_id = graph.add_finding(wizard="code-review", finding={"type": "fix", "name": "Add null check"})
268+ graph.add_edge(bug_id, fix_id, EdgeType.FIXED_BY)
269+
270+ # Find similar past issues
271+ similar = graph.find_similar({"name": "Null reference error"})
272+
273+ # Traverse relationships
274+ related_fixes = graph.find_related(bug_id, edge_types=[EdgeType.FIXED_BY])
275+ ` ` `
276+
277+ ---
278+
279+ # # Auto-Chaining
280+
281+ Wizards automatically trigger related wizards based on findings :
282+
283+ ` ` ` yaml
284+ # .empathy/wizard_chains.yaml
285+ chains:
286+ security-audit:
287+ auto_chain: true
288+ triggers:
289+ - condition: "high_severity_count > 0"
290+ next: dependency-check
291+ approval_required: false
292+ - condition: "vulnerability_type == 'injection'"
293+ next: code-review
294+ approval_required: true
295+
296+ bug-predict:
297+ triggers:
298+ - condition: "risk_score > 0.7"
299+ next: test-gen
300+
301+ templates:
302+ full-security-review:
303+ steps: [security-audit, dependency-check, code-review]
304+ pre-release:
305+ steps: [test-gen, security-audit, release-prep]
306+ ` ` `
307+
308+ ` ` ` python
309+ from empathy_os.routing import ChainExecutor
310+
311+ executor = ChainExecutor()
312+
313+ # Check what chains would trigger
314+ result = {"high_severity_count": 5}
315+ triggers = executor.get_triggered_chains("security-audit", result)
316+ # → [ChainTrigger(next="dependency-check"), ...]
317+
318+ # Execute a template
319+ template = executor.get_template("full-security-review")
320+ # → ["security-audit", "dependency-check", "code-review"]
321+ ` ` `
322+
323+ ---
324+
325+ # # Prompt Engineering Wizard
326+
327+ Analyze, generate, and optimize prompts :
328+
329+ ` ` ` python
330+ from coach_wizards import PromptEngineeringWizard
331+
332+ wizard = PromptEngineeringWizard()
333+
334+ # Analyze existing prompts
335+ analysis = wizard.analyze_prompt("Fix this bug")
336+ print(f"Score: {analysis.overall_score}") # → 0.13 (poor)
337+ print(f"Issues: {analysis.issues}") # → ["Missing role", "No output format"]
338+
339+ # Generate optimized prompts
340+ prompt = wizard.generate_prompt(
341+ task="Review code for security vulnerabilities",
342+ role="a senior security engineer",
343+ constraints=["Focus on OWASP top 10"],
344+ output_format="JSON with severity and recommendation"
345+ )
346+
347+ # Optimize tokens (reduce costs)
348+ result = wizard.optimize_tokens(verbose_prompt)
349+ print(f"Reduced: {result.token_reduction:.0%}") # → 20% reduction
350+
351+ # Add chain-of-thought scaffolding
352+ enhanced = wizard.add_chain_of_thought(prompt, "debug")
353+ ` ` `
354+
355+ ---
356+
210357# # Install Options
211358
212359` ` ` bash
@@ -233,9 +380,13 @@ cd empathy-framework && pip install -e .[dev]
233380| Component | Description |
234381|-----------|-------------|
235382| **Empathy OS** | Core engine for human↔AI and AI↔AI collaboration |
383+ | **Smart Router** | Natural language wizard dispatch with LLM classification |
384+ | **Memory Graph** | Cross-wizard knowledge sharing (bugs, fixes, patterns) |
385+ | **Auto-Chaining** | Wizards trigger related wizards based on findings |
236386| **Multi-Model Router** | Smart routing across providers and tiers |
237387| **Memory System** | Redis short-term + encrypted long-term patterns |
238- | **30+ Production Wizards** | Security, performance, testing, docs, compliance |
388+ | **17 Coach Wizards** | Security, performance, testing, docs, prompt engineering |
389+ | **10 Cost-Optimized Workflows** | Multi-tier pipelines with XML prompts |
239390| **Healthcare Suite** | SBAR, SOAP notes, clinical protocols (HIPAA) |
240391| **Code Inspection** | Unified pipeline with SARIF/GitHub Actions support |
241392| **VSCode Extension** | Visual dashboard for memory and workflows |
0 commit comments