empathy-framework 4.1.1__py3-none-any.whl → 4.4.0__py3-none-any.whl

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 (45) hide show
  1. {empathy_framework-4.1.1.dist-info → empathy_framework-4.4.0.dist-info}/METADATA +77 -12
  2. {empathy_framework-4.1.1.dist-info → empathy_framework-4.4.0.dist-info}/RECORD +45 -14
  3. empathy_os/cli_unified.py +13 -0
  4. empathy_os/memory/long_term.py +5 -0
  5. empathy_os/memory/unified.py +149 -9
  6. empathy_os/meta_workflows/__init__.py +74 -0
  7. empathy_os/meta_workflows/agent_creator.py +254 -0
  8. empathy_os/meta_workflows/builtin_templates.py +567 -0
  9. empathy_os/meta_workflows/cli_meta_workflows.py +1551 -0
  10. empathy_os/meta_workflows/form_engine.py +304 -0
  11. empathy_os/meta_workflows/intent_detector.py +298 -0
  12. empathy_os/meta_workflows/models.py +567 -0
  13. empathy_os/meta_workflows/pattern_learner.py +754 -0
  14. empathy_os/meta_workflows/session_context.py +398 -0
  15. empathy_os/meta_workflows/template_registry.py +229 -0
  16. empathy_os/meta_workflows/workflow.py +980 -0
  17. empathy_os/orchestration/execution_strategies.py +888 -1
  18. empathy_os/orchestration/pattern_learner.py +699 -0
  19. empathy_os/socratic/__init__.py +273 -0
  20. empathy_os/socratic/ab_testing.py +969 -0
  21. empathy_os/socratic/blueprint.py +532 -0
  22. empathy_os/socratic/cli.py +689 -0
  23. empathy_os/socratic/collaboration.py +1112 -0
  24. empathy_os/socratic/domain_templates.py +916 -0
  25. empathy_os/socratic/embeddings.py +734 -0
  26. empathy_os/socratic/engine.py +729 -0
  27. empathy_os/socratic/explainer.py +663 -0
  28. empathy_os/socratic/feedback.py +767 -0
  29. empathy_os/socratic/forms.py +624 -0
  30. empathy_os/socratic/generator.py +716 -0
  31. empathy_os/socratic/llm_analyzer.py +635 -0
  32. empathy_os/socratic/mcp_server.py +751 -0
  33. empathy_os/socratic/session.py +306 -0
  34. empathy_os/socratic/storage.py +635 -0
  35. empathy_os/socratic/success.py +719 -0
  36. empathy_os/socratic/visual_editor.py +812 -0
  37. empathy_os/socratic/web_ui.py +925 -0
  38. empathy_os/workflows/manage_documentation.py +18 -2
  39. empathy_os/workflows/release_prep_crew.py +16 -1
  40. empathy_os/workflows/test_coverage_boost_crew.py +16 -1
  41. empathy_os/workflows/test_maintenance_crew.py +18 -1
  42. {empathy_framework-4.1.1.dist-info → empathy_framework-4.4.0.dist-info}/WHEEL +0 -0
  43. {empathy_framework-4.1.1.dist-info → empathy_framework-4.4.0.dist-info}/entry_points.txt +0 -0
  44. {empathy_framework-4.1.1.dist-info → empathy_framework-4.4.0.dist-info}/licenses/LICENSE +0 -0
  45. {empathy_framework-4.1.1.dist-info → empathy_framework-4.4.0.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: empathy-framework
3
- Version: 4.1.1
4
- Summary: AI collaboration framework with progressive tier escalation (70-85% cost savings), meta-orchestration, dynamic agent composition (6 patterns), intelligent caching (85% hit rate), tier routing, XML-enhanced prompts, persistent memory, and multi-agent orchestration. Production workflows: Progressive Test Generation, Release Prep, Test Coverage Boost.
3
+ Version: 4.4.0
4
+ Summary: AI collaboration framework with real LLM agent execution, AskUserQuestion tool integration, Socratic agent generation, progressive tier escalation (70-85% cost savings), meta-orchestration, dynamic agent composition (6 patterns), intelligent caching (85% hit rate), semantic workflow discovery, visual workflow editor, MCP integration for Claude Code, and multi-agent orchestration.
5
5
  Author-email: Patrick Roebuck <admin@smartaimemory.com>
6
6
  Maintainer-email: Smart-AI-Memory <admin@smartaimemory.com>
7
7
  License: # Fair Source License, version 0.9
@@ -176,9 +176,6 @@ Requires-Dist: rich<14.0.0,>=13.0.0
176
176
  Requires-Dist: typer<1.0.0,>=0.9.0
177
177
  Requires-Dist: pyyaml<7.0,>=6.0
178
178
  Requires-Dist: anthropic<1.0.0,>=0.25.0
179
- Requires-Dist: crewai<1.0.0,>=0.1.0
180
- Requires-Dist: langchain<2.0.0,>=0.1.0
181
- Requires-Dist: langchain-core<2.0.0,>=1.2.6
182
179
  Provides-Extra: anthropic
183
180
  Requires-Dist: anthropic<1.0.0,>=0.25.0; extra == "anthropic"
184
181
  Provides-Extra: openai
@@ -200,6 +197,8 @@ Requires-Dist: langgraph-checkpoint<4.0.0,>=3.0.0; extra == "agents"
200
197
  Requires-Dist: marshmallow<5.0.0,>=4.1.2; extra == "agents"
201
198
  Provides-Extra: crewai
202
199
  Requires-Dist: crewai<1.0.0,>=0.1.0; extra == "crewai"
200
+ Requires-Dist: langchain<2.0.0,>=0.1.0; extra == "crewai"
201
+ Requires-Dist: langchain-core<2.0.0,>=1.2.6; extra == "crewai"
203
202
  Provides-Extra: cache
204
203
  Requires-Dist: sentence-transformers<4.0.0,>=2.0.0; extra == "cache"
205
204
  Requires-Dist: torch<3.0.0,>=2.0.0; extra == "cache"
@@ -251,9 +250,9 @@ Requires-Dist: mkdocstrings[python]<1.0.0,>=0.24.0; extra == "docs"
251
250
  Requires-Dist: mkdocs-with-pdf<1.0.0,>=0.9.3; extra == "docs"
252
251
  Requires-Dist: pymdown-extensions<11.0,>=10.0; extra == "docs"
253
252
  Provides-Extra: dev
254
- Requires-Dist: pytest<9.0,>=7.0; extra == "dev"
255
- Requires-Dist: pytest-asyncio<1.0,>=0.21; extra == "dev"
256
- Requires-Dist: pytest-cov<5.0,>=4.0; extra == "dev"
253
+ Requires-Dist: pytest<10.0,>=7.0; extra == "dev"
254
+ Requires-Dist: pytest-asyncio<2.0,>=0.21; extra == "dev"
255
+ Requires-Dist: pytest-cov<8.0,>=4.0; extra == "dev"
257
256
  Requires-Dist: pytest-xdist<4.0,>=3.5.0; extra == "dev"
258
257
  Requires-Dist: pytest-testmon<3.0,>=2.1.0; extra == "dev"
259
258
  Requires-Dist: pytest-picked<1.0,>=0.5.0; extra == "dev"
@@ -262,7 +261,7 @@ Requires-Dist: mypy<2.0,>=1.0; extra == "dev"
262
261
  Requires-Dist: ruff<1.0,>=0.1; extra == "dev"
263
262
  Requires-Dist: coverage<8.0,>=7.0; extra == "dev"
264
263
  Requires-Dist: bandit<2.0,>=1.7; extra == "dev"
265
- Requires-Dist: pre-commit<4.0,>=3.0; extra == "dev"
264
+ Requires-Dist: pre-commit<5.0,>=3.0; extra == "dev"
266
265
  Requires-Dist: httpx<1.0.0,>=0.27.0; extra == "dev"
267
266
  Requires-Dist: fastapi<1.0.0,>=0.109.1; extra == "dev"
268
267
  Provides-Extra: developer
@@ -373,11 +372,77 @@ Dynamic: license-file
373
372
  pip install empathy-framework[developer] # Lightweight for individual developers
374
373
  ```
375
374
 
376
- ## What's New in v4.0.0 🎭 **PARADIGM SHIFT**
375
+ ## What's New in v4.2.0 🤖 **META-WORKFLOW SYSTEM**
377
376
 
378
- ### **Meta-Orchestration: AI Agents That Compose Themselves**
377
+ ### **Intelligent Workflow Orchestration Through Forms + Dynamic Agents**
379
378
 
380
- **The breakthrough:** Instead of manually wiring agent workflows, v4.0 introduces a meta-orchestration system that analyzes tasks, selects optimal agent teams, chooses composition patterns, and learns from outcomes.
379
+ **The breakthrough:** v4.2 introduces a meta-workflow system that combines Socratic forms (interactive questions), dynamic agent team creation, and pattern learning for self-improving workflows.
380
+
381
+ **How it works:**
382
+
383
+ 1. 🎯 **Template Selection** - Choose from pre-built workflow templates (e.g., `python_package_publish`)
384
+ 2. 📝 **Socratic Forms** - Answer interactive questions about your workflow requirements
385
+ 3. 🤖 **Dynamic Agent Creation** - System generates optimized agent team based on your responses
386
+ 4. ⚡ **Progressive Execution** - Agents execute with tier escalation (cheap → capable → premium)
387
+ 5. 🧠 **Pattern Learning** - System learns from outcomes to optimize future workflows
388
+
389
+ **Quick Start:**
390
+
391
+ ```bash
392
+ # Run meta-workflow with interactive form
393
+ empathy meta-workflow run python_package_publish
394
+
395
+ # View pattern learning insights
396
+ empathy meta-workflow analytics python_package_publish
397
+
398
+ # List historical executions
399
+ empathy meta-workflow list-runs
400
+ ```
401
+
402
+ **Example workflow:**
403
+
404
+ ```python
405
+ from empathy_os.meta_workflows import TemplateRegistry, MetaWorkflow, FormResponse
406
+
407
+ # Load template
408
+ registry = TemplateRegistry()
409
+ template = registry.load_template("python_package_publish")
410
+
411
+ # Create workflow
412
+ workflow = MetaWorkflow(template=template)
413
+
414
+ # Execute with form responses
415
+ response = FormResponse(
416
+ template_id="python_package_publish",
417
+ responses={
418
+ "has_tests": "Yes",
419
+ "test_coverage_required": "90%",
420
+ "quality_checks": ["Linting (ruff)", "Type checking (mypy)"],
421
+ "version_bump": "minor",
422
+ },
423
+ )
424
+ result = workflow.execute(form_response=response, mock_execution=True)
425
+
426
+ print(f"✅ Created {len(result.agents_created)} agents")
427
+ print(f"💰 Total cost: ${result.total_cost:.2f}")
428
+ ```
429
+
430
+ **Key Features:**
431
+
432
+ - ✅ **Interactive forms** via `AskUserQuestion` (batched, max 4 at a time)
433
+ - ✅ **Dynamic agent generation** from templates based on responses
434
+ - ✅ **Hybrid storage** - files (persistent) + memory (semantic queries)
435
+ - ✅ **Pattern learning** - analyzes historical executions for optimization
436
+ - ✅ **7 CLI commands** - list, run, analytics, show, export, validate
437
+ - ✅ **Security hardened** - OWASP Top 10 compliant, AST-verified
438
+
439
+ ---
440
+
441
+ ## What's in v4.0.0 🎭 **META-ORCHESTRATION**
442
+
443
+ ### **AI Agents That Compose Themselves**
444
+
445
+ **The concept:** Instead of manually wiring agent workflows, v4.0 introduces a meta-orchestration system that analyzes tasks, selects optimal agent teams, chooses composition patterns, and learns from outcomes.
381
446
 
382
447
  **What this means:**
383
448
 
@@ -20,7 +20,7 @@ coach_wizards/refactoring_wizard.py,sha256=X0MTx3BHpOlOMAYDow-3HX5GyryY70JGAF5vA
20
20
  coach_wizards/scaling_wizard.py,sha256=n1RLtpWmj1RSEGSWssMiUPwCdpskO3z2Z3yhLlTdXro,2598
21
21
  coach_wizards/security_wizard.py,sha256=19SOClSxo6N-QqUc_QsFXOE7yEquiZF4kLi7jRomA7g,2605
22
22
  coach_wizards/testing_wizard.py,sha256=vKFgFG4uJfAVFmCIQbkrWNvZhIfLC6ve_XbvWZKrPg4,2563
23
- empathy_framework-4.1.1.dist-info/licenses/LICENSE,sha256=IJ9eeI5KSrD5P7alsn7sI_6_1bDihxBA5S4Sen4jf2k,4937
23
+ empathy_framework-4.4.0.dist-info/licenses/LICENSE,sha256=IJ9eeI5KSrD5P7alsn7sI_6_1bDihxBA5S4Sen4jf2k,4937
24
24
  empathy_healthcare_plugin/__init__.py,sha256=4NioL1_86UXzkd-QNkQZUSZ8rKTQGSP0TC9VXP32kQs,295
25
25
  empathy_healthcare_plugin/monitors/__init__.py,sha256=Udp8qfZR504QAq5_eQjvtIaE7v06Yguc7nuF40KllQc,196
26
26
  empathy_healthcare_plugin/monitors/clinical_protocol_monitor.py,sha256=MWE5t8tW9HWZn_SNo-inx8-0nhdTNGhbcB8ZeDWyXa0,11648
@@ -100,7 +100,7 @@ empathy_os/agent_monitoring.py,sha256=s4seLC_J4AtQ3PYWrRPO8YHM-Fbm0Q36kPEdlTHf2H
100
100
  empathy_os/cache_monitor.py,sha256=DTR8xr9d63czGzzdfrBFWp8hkoWPFsL-hpihPGmkbEc,11072
101
101
  empathy_os/cache_stats.py,sha256=rWJPBNFEfhuLwKYKy89D_Qa9GPIyVso2jdCKp_cdJhI,10232
102
102
  empathy_os/cli.py,sha256=gr9cUowOsvsfqQzhsLPNCny1tpgJtg1vP6C2NNq8vV0,128006
103
- empathy_os/cli_unified.py,sha256=u7pKE4ZaXXiM55fxCfbRbiQpJ3HYmYUreTc8u16-TvQ,38172
103
+ empathy_os/cli_unified.py,sha256=PsTvjs6PjhF3NP-07gokeKSYRyNhYoUwAatgXV9iBLk,38686
104
104
  empathy_os/config.py,sha256=jsFQuXpZP_jt6UrZtfLlkBZwPUSNbnW5VVtMS5JIhbA,16276
105
105
  empathy_os/coordination.py,sha256=E2HvHxKk1xbYswtgxhnVKB6DRxfXUV5pCt-XWHOvNKM,28509
106
106
  empathy_os/core.py,sha256=PvrPs8JQPwQjPZZQj6zy6xQTFGHKziaeRxCIlIs3iHA,52951
@@ -148,17 +148,28 @@ empathy_os/memory/config.py,sha256=EoBBZLgyY5sHT3kLeyWjyI4b6hRA3Xiaoo3xdMLLGos,6
148
148
  empathy_os/memory/control_panel.py,sha256=ylU2RODUIXQSMhBLcqPI5KkOAOpcmuABVcd2AleeSaw,47334
149
149
  empathy_os/memory/edges.py,sha256=ljku2CYeetJ7qDnQUJobrPZdBaYFxkn_PfGSNa9sVDE,5891
150
150
  empathy_os/memory/graph.py,sha256=Up4PCG8BbK5fmGym7rNEPZsCNjS7TQ3_F9-S6-mS2L4,18820
151
- empathy_os/memory/long_term.py,sha256=btzHt3PBtQGnD8WJgSHDp0s-0zHUhlYWlex0fLe4CVs,50682
151
+ empathy_os/memory/long_term.py,sha256=dMKL3a3lZgc5bq7eQAUMp4gPwq-6R6k62M5yDOcbSrw,50882
152
152
  empathy_os/memory/nodes.py,sha256=lVLN9pp8cFSBrO2Nh8d0zTOglM3QBaYCtwfO5P8dryc,4752
153
153
  empathy_os/memory/redis_bootstrap.py,sha256=G71loEE2LTcn0BCp_mN96Bk37ygFz1ImORiLoEmg9jA,16508
154
154
  empathy_os/memory/short_term.py,sha256=cp38F77ouFKzwaDgLxUOGGkKTauxcIQy9CH12w3XuKQ,71445
155
155
  empathy_os/memory/summary_index.py,sha256=7m_m2xH3KMBJWRJFvk3hAws_tgPD4VCfFBxwAbV9fCo,20777
156
- empathy_os/memory/unified.py,sha256=GKl91rfVQho_27VscaRG6LhnM2lPiJ4k1Dh2cCaDOGA,23734
156
+ empathy_os/memory/unified.py,sha256=L5yZiMOUmrJSKjkOtW5eB0DV9ONRwx3-1XBzFCLcUNo,29168
157
157
  empathy_os/memory/security/__init__.py,sha256=f_t-pFO1aHOE8uFJ0icGaCt2xCvWx-bFxBcv9U3Cu3Q,868
158
158
  empathy_os/memory/security/audit_logger.py,sha256=DP9OYdoavUN6ZlPYmidGVgFyivkQ8Y5huVP6gZYJ5bQ,34259
159
159
  empathy_os/memory/security/pii_scrubber.py,sha256=ucPdE_ZEObR3T8hPK--tabdzLDumZQV4YUfislELvCc,21563
160
160
  empathy_os/memory/security/secrets_detector.py,sha256=bJsXTD95yEnfShDMxvCndzF8X7HNvkJamLXmkvWwpbk,22775
161
161
  empathy_os/memory/storage/__init__.py,sha256=sPLdecYJ1z6nZTIl8gmbozjdCPp0SZLKsKoi8L1xhcE,480
162
+ empathy_os/meta_workflows/__init__.py,sha256=REUdSgr5kRxPuzj1R3qy50_BEdImoNOry_UNwn2jRYo,1845
163
+ empathy_os/meta_workflows/agent_creator.py,sha256=f2Bc_Qm4bj7DFpGzhDf41RnUK4rG4jQRpRWYiQ_AdjE,8061
164
+ empathy_os/meta_workflows/builtin_templates.py,sha256=znZ2mF4mEuHuiYuV7GkUpDvKrEQjHYQNhkkcqB7JkrU,20619
165
+ empathy_os/meta_workflows/cli_meta_workflows.py,sha256=ZpcESKWJ5uk0g8VwmpNilNpajdLxkWCMXattMR3Qei0,56599
166
+ empathy_os/meta_workflows/form_engine.py,sha256=tUeSU_TofTS7ZjhWL5tIw4DxrleaHfFQf2mMDI4IaMg,10877
167
+ empathy_os/meta_workflows/intent_detector.py,sha256=heWc6nm-EyMz-Ru2TfaNnWSLqduhOxfTVK80Plf96y4,10126
168
+ empathy_os/meta_workflows/models.py,sha256=jtuAgSuY-vHbjqVOo4AIoq1SXfp-DxUhPyAcmwqjbcI,18909
169
+ empathy_os/meta_workflows/pattern_learner.py,sha256=9DA6L39zu88ohu5zC9PmmJPaIb15of6GwFP7qyy1SlE,26529
170
+ empathy_os/meta_workflows/session_context.py,sha256=WTdhWAKHq6cLJBLHT-jwjxOwQyUPId_F8GPjQlI7gvY,12366
171
+ empathy_os/meta_workflows/template_registry.py,sha256=eFv4rlHcsuk7tnpLCjTNytYipmgyuruW_VZKdXmSXSE,7488
172
+ empathy_os/meta_workflows/workflow.py,sha256=BByaH4bTfLVPgglv0wwZBLjz6jDi54kj5m-ZQtwPbdY,35048
162
173
  empathy_os/metrics/__init__.py,sha256=b0lkly5Fz89AvvGqV6lLYx8hWlmttL1ZCPuWlHjwXxY,369
163
174
  empathy_os/metrics/prompt_metrics.py,sha256=9ZUxM5zJX7v9MxKbDfuP4zWdFKy2sNZO6zRdSELZgTo,6315
164
175
  empathy_os/models/__init__.py,sha256=gP9DDNB6kyQJroon182ZYDJ4-IkREkDwRitZg1Xgw_4,3324
@@ -183,8 +194,9 @@ empathy_os/optimization/context_optimizer.py,sha256=lPWXuG7K1OMVNZKOdQT2SlZhLfjM
183
194
  empathy_os/orchestration/__init__.py,sha256=BuIuXDQ2MWPOIkhVkjFCkKjbiDwAqCmrL096ou2NYFE,876
184
195
  empathy_os/orchestration/agent_templates.py,sha256=t8LxeqiTdgqYvW1BE8IXswAFamVTrScycb2VnG0qBCM,16283
185
196
  empathy_os/orchestration/config_store.py,sha256=TZLjzCr1g0nAP1eEZA9fMUy3OjF6XsWIQaJnX_PpLDY,16774
186
- empathy_os/orchestration/execution_strategies.py,sha256=mMwunWgCiag-GejdMD6sfHHobwCkMFPp96E9pCBHa0s,26892
197
+ empathy_os/orchestration/execution_strategies.py,sha256=PRlCJkHgITS4Kuqb6Etk28Yk2wb-ReyBFodfVM87s3g,57002
187
198
  empathy_os/orchestration/meta_orchestrator.py,sha256=lFyqXat7wULVzNkED2Uxst5Bol-JPOgUHU5U8LevIgM,21591
199
+ empathy_os/orchestration/pattern_learner.py,sha256=_S_SN0V2JUtswRISGQwMJQBpE9aOavK3Rehwh3iiwIg,22398
188
200
  empathy_os/orchestration/real_tools.py,sha256=FC-nvuRv6ZMvub4IUuIrIlqXxmyX7URPX_SNLHLmHe4,31778
189
201
  empathy_os/patterns/refactoring_memory.json,sha256=nk7Bh2QE8Zm4iz3nxzARYiqzBWqZrKXhypDHPC63f_U,2995
190
202
  empathy_os/patterns/debugging/all_patterns.json,sha256=0nxtlmJzqAn2fV162OgoTWtWXiJNzcZ04_uIRaUqC6U,2283
@@ -220,6 +232,25 @@ empathy_os/scaffolding/README.md,sha256=VwSG36Cr0WH8Gep1-Dd9tPEzRLCra1KhqsNJQnjb
220
232
  empathy_os/scaffolding/__init__.py,sha256=-fqOQ0E3lb--D-0vic8d_1I1xiHeJiyKEHWpZvhz-Rk,977
221
233
  empathy_os/scaffolding/__main__.py,sha256=r-lWXicNLuTgliqw28yDV3PxX8SdX8fg4jm55RxmElo,280
222
234
  empathy_os/scaffolding/cli.py,sha256=2UxU_JUgtAuCkMXe9f2zYFbkMMtjk5DIOae5NjPC3yo,6700
235
+ empathy_os/socratic/__init__.py,sha256=HEj8vxokJmr2bRWyNP5QUGy1toG7QyVG2u3T5FbXQWM,6097
236
+ empathy_os/socratic/ab_testing.py,sha256=uXRT1EhfDrDaqFJ0xI_C7K6bXEZ1b9Pj9F97q-bQLgk,30043
237
+ empathy_os/socratic/blueprint.py,sha256=AvvXxxKuu8gmcKL4_gB1YonkgF3IzXfyZ_82WVF5E78,17147
238
+ empathy_os/socratic/cli.py,sha256=-RR90BY4oXrgBPeuN6nXP30TXtvEliWki2SfJNRibPg,21103
239
+ empathy_os/socratic/collaboration.py,sha256=TpQRP0OHmCOWPDnQALmvZMYm6CNPGeFv2GgIJJzDcOU,33000
240
+ empathy_os/socratic/domain_templates.py,sha256=-qh-I8CemX-XkSDnki7VxlMvtpI1lgzDQ3OZto0sP9U,30138
241
+ empathy_os/socratic/embeddings.py,sha256=XvEq6D26t-lE4ZpzLYo2_U2cCCQ-vqcqGWHj1Z_aBMw,22909
242
+ empathy_os/socratic/engine.py,sha256=whzO0OGhZvlcZT3qdr6uGtwZ0OXWfOsXX9bWE-TNwZ8,25261
243
+ empathy_os/socratic/explainer.py,sha256=7dsvNrqZ-LmAKdTInx_eo-gKD2hw3BxOsrxdxz5RG0k,23402
244
+ empathy_os/socratic/feedback.py,sha256=4mSCmWbPLdt8vCaB41fI3HcmqVLwZVUsrw0-4tavNSA,27076
245
+ empathy_os/socratic/forms.py,sha256=JvsxdnR5gAKa-4fN40_65_PtcFkUcFhQUpOmlD_k3d0,18984
246
+ empathy_os/socratic/generator.py,sha256=cYwZRIxWmGCRHQLgHFv6Uq1rvAOOyCf-nGD6gqDPZ4s,24200
247
+ empathy_os/socratic/llm_analyzer.py,sha256=J2kznd8NvYcvEZNi8TPARmsuNX5sIq3hxAGogV0Hme8,21147
248
+ empathy_os/socratic/mcp_server.py,sha256=HqziHg1TQcQk_jDyJY9wOG0OJGzdfUgbzh62xKOQzc4,25056
249
+ empathy_os/socratic/session.py,sha256=9bwxlZpNaX1TiZEEPcN9uHCM5vWGcZqw9uGv5lrqYaU,9957
250
+ empathy_os/socratic/storage.py,sha256=x-17Nng2O5ghOX6j_5muZyoDCmAovClhT1gv2p0uBnQ,21054
251
+ empathy_os/socratic/success.py,sha256=8-EEyfRu_z9C14OSOJqzyBPEgq4fxKTEcnS81YGPFxc,24510
252
+ empathy_os/socratic/visual_editor.py,sha256=gRxJTZfO4jHziC3iNhY6SwZxApmKVn6niQObZhQP23k,25653
253
+ empathy_os/socratic/web_ui.py,sha256=jW66CXea_dA-Kcj0ac6pCT9QuufmymXahzBDdJQXiNI,24760
223
254
  empathy_os/telemetry/__init__.py,sha256=6ZFO0r4I-WIE9BByVsKwyGFsGg-UEy3-OZNofHSr54A,263
224
255
  empathy_os/telemetry/cli.py,sha256=F-PktRoYEIzCrtoWLNZgKWvI0RzvC7YQagiDbmcXcfE,47167
225
256
  empathy_os/telemetry/usage_tracker.py,sha256=bytIjrtaXSV1wu4tDx46P7SvsZp7iNmv4S9N68RYNw4,21216
@@ -253,7 +284,7 @@ empathy_os/workflows/document_manager_README.md,sha256=aKegxvNXTHpxQsShpSp9cdhF6
253
284
  empathy_os/workflows/documentation_orchestrator.py,sha256=sSzTsLJPkSlHcE_o-pfM-27DVAVpwPcmxPZT71GYfeo,43013
254
285
  empathy_os/workflows/manage_docs.py,sha256=lSdQCG1y2R_9C9PLFS3dgFunRkLrRuwYskIRfGWwlcE,2127
255
286
  empathy_os/workflows/manage_docs_README.md,sha256=0v-DOpTdfXQ5qIFzVCtV2IY-QBNw5s_Yvp3YCFOnxaQ,1907
256
- empathy_os/workflows/manage_documentation.py,sha256=gknIse4MzTLxRowIAS07WSXNqWAoWCfxmoIJSbTYBNM,29419
287
+ empathy_os/workflows/manage_documentation.py,sha256=PVIgpLjGVvLm_xEd_LG1BS6b4Fqeq3SOqYl_cx24rVU,30079
257
288
  empathy_os/workflows/new_sample_workflow1.py,sha256=W59znXxsq5kgk4ZI3psC41KtzkLo5lmQ08SbMYXcJVg,4103
258
289
  empathy_os/workflows/new_sample_workflow1_README.md,sha256=bzLyqukgaKilG1OnCdLsc5GNWsYEagI7mn3n80BPMHY,2366
259
290
  empathy_os/workflows/orchestrated_health_check.py,sha256=reO1vrSNm14MU5EaVI_338qjCCs1TDUB1AEruAEFTfw,30403
@@ -264,7 +295,7 @@ empathy_os/workflows/progress.py,sha256=J1ooVZp6WoaKz9IwDsoYFtfJGFTtSDU3kHewkGMj
264
295
  empathy_os/workflows/progress_server.py,sha256=aLDrcBuxqN9_mfJRcRLJypuB4uRMFq9u4C_li9HioOM,10233
265
296
  empathy_os/workflows/refactor_plan.py,sha256=JmW0bMuQDHwCL77ZHC76pVFpp_UY9vke9phVVJfHyDw,25600
266
297
  empathy_os/workflows/release_prep.py,sha256=hJOEgGK3R8Z0NRg0oLWedAhPD3p4tuT6JfLRlYQ_FO0,28263
267
- empathy_os/workflows/release_prep_crew.py,sha256=cRRD45DjrJpfjGb7e0agGwchZxwcfmKXATQdzMBp7TE,33246
298
+ empathy_os/workflows/release_prep_crew.py,sha256=TcEyjsEsKQC4Y7OYEaOoXaLbt5zhHKksVMj1cxLciwY,33899
268
299
  empathy_os/workflows/research_synthesis.py,sha256=7KozOOlFJADiVR1Y9LP3-DwwNG6JhRRnOLgCDGkdvSM,13967
269
300
  empathy_os/workflows/secure_release.py,sha256=IzJjaQau90-Q7So1E_Lx0uuechAqI_0D2U0RwO3uilg,20966
270
301
  empathy_os/workflows/security_adapters.py,sha256=UX4vRQwuSmA_V8t5sh5BGzT4RRkCk6lt6jy_VkhqJ1s,10945
@@ -272,12 +303,12 @@ empathy_os/workflows/security_audit.py,sha256=lBuJIpTAUWUBg3nql-elyv-JuwuHm0vHge
272
303
  empathy_os/workflows/step_config.py,sha256=CdRNAQ1SiPsuAl10s58ioyk5w8XCArecSS9AjyHWQJM,7213
273
304
  empathy_os/workflows/test5.py,sha256=6o_sFk4dAIyOIVY9nDilgQWaJIGjl551wzphbcnXwTI,3767
274
305
  empathy_os/workflows/test5_README.md,sha256=bnYhbwyNVGN0dbIcnAUhEJbwSf4cE-UAkD09p_gvThc,2406
275
- empathy_os/workflows/test_coverage_boost_crew.py,sha256=i9jxiDHjHVRu2X__ygR_tXBO-Fvti6t_wBtxiJzxoWQ,30375
306
+ empathy_os/workflows/test_coverage_boost_crew.py,sha256=KBymYu6YDX8cN_DnsTwZZPOg96sjHnNiK9TQxOl14g8,31048
276
307
  empathy_os/workflows/test_gen.py,sha256=Lw9Hh-feqiM9GCjWUJzlNyEPMqxP34LSNEscbuOUZjU,70621
277
308
  empathy_os/workflows/test_lifecycle.py,sha256=c6UDSd6kOQdCHmaJviwAnUVceVQuSdLNQ9eKbVooiMY,16890
278
309
  empathy_os/workflows/test_maintenance.py,sha256=jiMeYX7Qg3CnRU5xW8LuOXnARxV7uqfygDKkIsEgL0s,22941
279
310
  empathy_os/workflows/test_maintenance_cli.py,sha256=U8t-1uK9iqEg9RoVXbS27KbhqvbXm30anQH4GbCvKBM,17879
280
- empathy_os/workflows/test_maintenance_crew.py,sha256=HKelVZBremOzfwWi4lH2Mniv8cDkYm4eZhcelHIJByU,28734
311
+ empathy_os/workflows/test_maintenance_crew.py,sha256=J69GSEZYHcXLojkyoEtFqNFXtZewU2KlhsqzY3nDNhY,29457
281
312
  empathy_os/workflows/test_runner.py,sha256=A5gwpVCdNm33bkaobnvcbop__aUzgtTEl5hWWN8EVPc,11490
282
313
  empathy_os/workflows/tier_tracking.py,sha256=j6Lt9K4JkEib0sO-Brswt7K0NOZmHALloQ9I0ZIYnFg,16491
283
314
  empathy_os/workflows/xml_enhanced_crew.py,sha256=SnPb-LdUNn3MWlm5c_6OB1IWKV_D6XjCsgmi_hRFhuk,9000
@@ -363,8 +394,8 @@ workflow_scaffolding/__init__.py,sha256=UpX5vjjjPjIaAKyIV1D4GxJzLUZy5DzdzgSkePYM
363
394
  workflow_scaffolding/__main__.py,sha256=0qspuNoadTDqyskXTlT8Sahqau-XIxN35NHTSGVW6z4,236
364
395
  workflow_scaffolding/cli.py,sha256=yLgvMsPbqI-LHt7UKXMuj-Dc0-44EqWiChldysrw1YQ,6763
365
396
  workflow_scaffolding/generator.py,sha256=9eEmm324kVzf8BCtXEML090pyke06o0U7aGATzZIaPM,8869
366
- empathy_framework-4.1.1.dist-info/METADATA,sha256=7OybwRJEFJGBjlTmNicBMa-HI1k0W1gk2U2o6V1da4s,53876
367
- empathy_framework-4.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
368
- empathy_framework-4.1.1.dist-info/entry_points.txt,sha256=41rM9JgcKpkU8dr4VvPcbiPy2GQX68cEj10l3XMH0FQ,1519
369
- empathy_framework-4.1.1.dist-info/top_level.txt,sha256=wrNU1aVMutVDACer58H-udv0P_171Dv6z_42sZtZ-xM,124
370
- empathy_framework-4.1.1.dist-info/RECORD,,
397
+ empathy_framework-4.4.0.dist-info/METADATA,sha256=iFFX3CQYFCv-oYrm7utIvzhy7IM3f3Sknjh1BkoVKcc,56221
398
+ empathy_framework-4.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
399
+ empathy_framework-4.4.0.dist-info/entry_points.txt,sha256=41rM9JgcKpkU8dr4VvPcbiPy2GQX68cEj10l3XMH0FQ,1519
400
+ empathy_framework-4.4.0.dist-info/top_level.txt,sha256=wrNU1aVMutVDACer58H-udv0P_171Dv6z_42sZtZ-xM,124
401
+ empathy_framework-4.4.0.dist-info/RECORD,,
empathy_os/cli_unified.py CHANGED
@@ -831,6 +831,19 @@ def telemetry_reset(
831
831
  subprocess.run(args, check=False)
832
832
 
833
833
 
834
+ # =============================================================================
835
+ # META-WORKFLOW SUBCOMMAND GROUP
836
+ # =============================================================================
837
+
838
+ try:
839
+ from empathy_os.meta_workflows.cli_meta_workflows import meta_workflow_app
840
+ app.add_typer(meta_workflow_app, name="meta-workflow")
841
+ except ImportError as e:
842
+ # Meta-workflow system is optional/experimental
843
+ import logging
844
+ logging.getLogger(__name__).debug(f"Meta-workflow CLI not available: {e}")
845
+
846
+
834
847
  # =============================================================================
835
848
  # PROGRESSIVE WORKFLOW SUBCOMMAND GROUP
836
849
  # =============================================================================
@@ -1289,6 +1289,11 @@ class LongTermMemory:
1289
1289
  if not key or not key.strip():
1290
1290
  raise ValueError("key cannot be empty")
1291
1291
 
1292
+ # Validate key for path traversal attacks
1293
+ if ".." in key or key.startswith("/") or "\x00" in key:
1294
+ logger.error("path_traversal_attempt", key=key)
1295
+ return False
1296
+
1292
1297
  try:
1293
1298
  # Convert classification to string
1294
1299
  classification_str = "INTERNAL" # Default
@@ -26,11 +26,13 @@ Copyright 2025 Smart AI Memory, LLC
26
26
  Licensed under Fair Source 0.9
27
27
  """
28
28
 
29
+ import json
29
30
  import os
30
31
  import uuid
31
32
  from dataclasses import dataclass, field
32
33
  from datetime import datetime
33
34
  from enum import Enum
35
+ from pathlib import Path
34
36
  from typing import Any
35
37
 
36
38
  import structlog
@@ -489,26 +491,164 @@ class UnifiedMemory:
489
491
  classification: Classification | None = None,
490
492
  limit: int = 10,
491
493
  ) -> list[dict[str, Any]]:
492
- """Search patterns in long-term memory.
494
+ """Search patterns in long-term memory with keyword matching and relevance scoring.
495
+
496
+ Implements keyword-based search with:
497
+ 1. Full-text search in pattern content and metadata
498
+ 2. Filter by pattern_type and classification
499
+ 3. Relevance scoring (exact matches rank higher)
500
+ 4. Results sorted by relevance
493
501
 
494
502
  Args:
495
- query: Text to search for in pattern content
496
- pattern_type: Filter by pattern type
503
+ query: Text to search for in pattern content (case-insensitive)
504
+ pattern_type: Filter by pattern type (e.g., "meta_workflow_execution")
497
505
  classification: Filter by classification level
498
506
  limit: Maximum results to return
499
507
 
500
508
  Returns:
501
- List of matching patterns
509
+ List of matching patterns with metadata, sorted by relevance
502
510
 
511
+ Example:
512
+ >>> patterns = memory.search_patterns(
513
+ ... query="successful workflows",
514
+ ... pattern_type="meta_workflow_execution",
515
+ ... limit=5
516
+ ... )
503
517
  """
504
518
  if not self._long_term:
519
+ logger.debug("long_term_memory_unavailable")
505
520
  return []
506
521
 
507
- # Note: Full search implementation depends on storage backend
508
- # For now, return patterns matching type/classification
509
- patterns: list[dict[str, Any]] = []
510
- # This would be implemented based on the storage backend
511
- return patterns
522
+ try:
523
+ # Get all patterns from storage
524
+ all_patterns = self._get_all_patterns()
525
+
526
+ # Filter and score patterns
527
+ scored_patterns = []
528
+ query_lower = query.lower() if query else ""
529
+
530
+ for pattern in all_patterns:
531
+ # Apply filters
532
+ if pattern_type and pattern.get("pattern_type") != pattern_type:
533
+ continue
534
+
535
+ if classification:
536
+ pattern_class = pattern.get("classification")
537
+ if isinstance(classification, Classification):
538
+ if pattern_class != classification.value:
539
+ continue
540
+ elif pattern_class != classification:
541
+ continue
542
+
543
+ # Calculate relevance score
544
+ score = 0.0
545
+
546
+ if query:
547
+ content = str(pattern.get("content", "")).lower()
548
+ metadata_str = str(pattern.get("metadata", {})).lower()
549
+
550
+ # Exact phrase match in content (highest score)
551
+ if query_lower in content:
552
+ score += 10.0
553
+
554
+ # Keyword matching (medium score)
555
+ query_words = query_lower.split()
556
+ for word in query_words:
557
+ if len(word) < 3: # Skip short words
558
+ continue
559
+ if word in content:
560
+ score += 2.0
561
+ if word in metadata_str:
562
+ score += 1.0
563
+
564
+ # Skip if no matches found
565
+ if score == 0.0:
566
+ continue
567
+ else:
568
+ # No query - all filtered patterns have equal score
569
+ score = 1.0
570
+
571
+ scored_patterns.append((score, pattern))
572
+
573
+ # Sort by relevance (highest score first)
574
+ scored_patterns.sort(key=lambda x: x[0], reverse=True)
575
+
576
+ # Return top N patterns (without scores)
577
+ return [pattern for _, pattern in scored_patterns[:limit]]
578
+
579
+ except Exception as e:
580
+ logger.error("pattern_search_failed", error=str(e))
581
+ return []
582
+
583
+ def _get_all_patterns(self) -> list[dict[str, Any]]:
584
+ """Get all patterns from long-term memory storage.
585
+
586
+ Scans the storage directory for pattern files and loads them.
587
+ This is a helper method for search_patterns().
588
+
589
+ In production with large datasets, this should be replaced with:
590
+ - Database queries with indexes
591
+ - Full-text search engine (Elasticsearch, etc.)
592
+ - Vector embeddings for semantic search
593
+
594
+ Returns:
595
+ List of all stored patterns
596
+
597
+ Note:
598
+ This performs a full scan and is O(n). For large datasets,
599
+ use indexed storage backends.
600
+ """
601
+ if not self._long_term:
602
+ return []
603
+
604
+ try:
605
+ # Get storage directory from long-term memory
606
+ storage_dir = None
607
+
608
+ # Try different ways to access storage directory
609
+ if hasattr(self._long_term, 'storage_dir'):
610
+ storage_dir = Path(self._long_term.storage_dir)
611
+ elif hasattr(self._long_term, 'storage'):
612
+ if hasattr(self._long_term.storage, 'storage_dir'):
613
+ storage_dir = Path(self._long_term.storage.storage_dir)
614
+ elif hasattr(self._long_term, '_storage'):
615
+ if hasattr(self._long_term._storage, 'storage_dir'):
616
+ storage_dir = Path(self._long_term._storage.storage_dir)
617
+
618
+ if not storage_dir:
619
+ logger.warning("cannot_access_storage_directory")
620
+ return []
621
+
622
+ patterns = []
623
+
624
+ # Scan for pattern files (*.json)
625
+ if storage_dir.exists():
626
+ for pattern_file in storage_dir.rglob("*.json"):
627
+ try:
628
+ with pattern_file.open('r', encoding='utf-8') as f:
629
+ pattern_data = json.load(f)
630
+ patterns.append(pattern_data)
631
+ except json.JSONDecodeError as e:
632
+ logger.debug(
633
+ "pattern_json_decode_failed",
634
+ file=str(pattern_file),
635
+ error=str(e)
636
+ )
637
+ continue
638
+ except Exception as e:
639
+ logger.debug(
640
+ "pattern_load_failed",
641
+ file=str(pattern_file),
642
+ error=str(e)
643
+ )
644
+ continue
645
+
646
+ logger.debug("patterns_loaded", count=len(patterns))
647
+ return patterns
648
+
649
+ except Exception as e:
650
+ logger.error("get_all_patterns_failed", error=str(e))
651
+ return []
512
652
 
513
653
  # =========================================================================
514
654
  # PATTERN PROMOTION (SHORT-TERM → LONG-TERM)
@@ -0,0 +1,74 @@
1
+ """Meta-workflow system for dynamic agent team generation.
2
+
3
+ This package provides:
4
+ - Socratic form engine for requirements gathering
5
+ - Dynamic agent generation from templates
6
+ - Pattern learning from historical executions
7
+ - Template registry for reusable workflows
8
+
9
+ Created: 2026-01-17
10
+ Version: 1.0.0 (experimental)
11
+ """
12
+
13
+ from empathy_os.meta_workflows.agent_creator import DynamicAgentCreator
14
+ from empathy_os.meta_workflows.form_engine import SocraticFormEngine
15
+ from empathy_os.meta_workflows.intent_detector import (
16
+ IntentDetector,
17
+ IntentMatch,
18
+ auto_detect_template,
19
+ detect_and_suggest,
20
+ )
21
+ from empathy_os.meta_workflows.models import (
22
+ AgentCompositionRule,
23
+ AgentExecutionResult,
24
+ AgentSpec,
25
+ FormQuestion,
26
+ FormResponse,
27
+ FormSchema,
28
+ MetaWorkflowResult,
29
+ MetaWorkflowTemplate,
30
+ PatternInsight,
31
+ QuestionType,
32
+ TierStrategy,
33
+ )
34
+ from empathy_os.meta_workflows.pattern_learner import PatternLearner
35
+ from empathy_os.meta_workflows.template_registry import TemplateRegistry
36
+ from empathy_os.meta_workflows.workflow import (
37
+ MetaWorkflow,
38
+ list_execution_results,
39
+ load_execution_result,
40
+ )
41
+
42
+ __version__ = "1.0.0"
43
+
44
+ __all__ = [
45
+ # Enums
46
+ "QuestionType",
47
+ "TierStrategy",
48
+ # Form components
49
+ "FormQuestion",
50
+ "FormSchema",
51
+ "FormResponse",
52
+ "SocraticFormEngine",
53
+ # Agent components
54
+ "AgentCompositionRule",
55
+ "AgentSpec",
56
+ "AgentExecutionResult",
57
+ "DynamicAgentCreator",
58
+ # Meta-workflow components
59
+ "MetaWorkflowTemplate",
60
+ "MetaWorkflowResult",
61
+ "TemplateRegistry",
62
+ "MetaWorkflow",
63
+ # Helpers
64
+ "list_execution_results",
65
+ "load_execution_result",
66
+ # Analytics
67
+ "PatternInsight",
68
+ "PatternLearner",
69
+ # Intent detection
70
+ "IntentDetector",
71
+ "IntentMatch",
72
+ "auto_detect_template",
73
+ "detect_and_suggest",
74
+ ]